• 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/io.proto
18 
19 package com.google.cloud.automl.v1;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Output configuration for BatchPredict Action.
26  * As destination the
27  * [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination]
28  * must be set unless specified otherwise for a domain. If gcs_destination is
29  * set then in the given directory a new directory is created. Its name
30  * will be
31  * "prediction-&lt;model-display-name&gt;-&lt;timestamp-of-prediction-call&gt;",
32  * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents
33  * of it depends on the ML problem the predictions are made for.
34  *  *  For Image Classification:
35  *         In the created directory files `image_classification_1.jsonl`,
36  *         `image_classification_2.jsonl`,...,`image_classification_N.jsonl`
37  *         will be created, where N may be 1, and depends on the
38  *         total number of the successfully predicted images and annotations.
39  *         A single image will be listed only once with all its annotations,
40  *         and its annotations will never be split across files.
41  *         Each .JSONL file will contain, per line, a JSON representation of a
42  *         proto that wraps image's "ID" : "&lt;id_value&gt;" followed by a list of
43  *         zero or more AnnotationPayload protos (called annotations), which
44  *         have classification detail populated.
45  *         If prediction for any image failed (partially or completely), then an
46  *         additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl`
47  *         files will be created (N depends on total number of failed
48  *         predictions). These files will have a JSON representation of a proto
49  *         that wraps the same "ID" : "&lt;id_value&gt;" but here followed by
50  *         exactly one
51  *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
52  *         containing only `code` and `message`fields.
53  *  *  For Image Object Detection:
54  *         In the created directory files `image_object_detection_1.jsonl`,
55  *         `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl`
56  *         will be created, where N may be 1, and depends on the
57  *         total number of the successfully predicted images and annotations.
58  *         Each .JSONL file will contain, per line, a JSON representation of a
59  *         proto that wraps image's "ID" : "&lt;id_value&gt;" followed by a list of
60  *         zero or more AnnotationPayload protos (called annotations), which
61  *         have image_object_detection detail populated. A single image will
62  *         be listed only once with all its annotations, and its annotations
63  *         will never be split across files.
64  *         If prediction for any image failed (partially or completely), then
65  *         additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl`
66  *         files will be created (N depends on total number of failed
67  *         predictions). These files will have a JSON representation of a proto
68  *         that wraps the same "ID" : "&lt;id_value&gt;" but here followed by
69  *         exactly one
70  *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
71  *         containing only `code` and `message`fields.
72  *  *  For Video Classification:
73  *         In the created directory a video_classification.csv file, and a .JSON
74  *         file per each video classification requested in the input (i.e. each
75  *         line in given CSV(s)), will be created.
76  *         The format of video_classification.csv is:
77  *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS
78  *         where:
79  *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1
80  *             the prediction input lines (i.e. video_classification.csv has
81  *             precisely the same number of lines as the prediction input had.)
82  *         JSON_FILE_NAME = Name of .JSON file in the output directory, which
83  *             contains prediction responses for the video time segment.
84  *         STATUS = "OK" if prediction completed successfully, or an error code
85  *             with message otherwise. If STATUS is not "OK" then the .JSON file
86  *             for that line may not exist or be empty.
87  *         Each .JSON file, assuming STATUS is "OK", will contain a list of
88  *         AnnotationPayload protos in JSON format, which are the predictions
89  *         for the video time segment the file is assigned to in the
90  *         video_classification.csv. All AnnotationPayload protos will have
91  *         video_classification field set, and will be sorted by
92  *         video_classification.type field (note that the returned types are
93  *         governed by `classifaction_types` parameter in
94  *         [PredictService.BatchPredictRequest.params][]).
95  *  *  For Video Object Tracking:
96  *         In the created directory a video_object_tracking.csv file will be
97  *         created, and multiple files video_object_trackinng_1.json,
98  *         video_object_trackinng_2.json,..., video_object_trackinng_N.json,
99  *         where N is the number of requests in the input (i.e. the number of
100  *         lines in given CSV(s)).
101  *         The format of video_object_tracking.csv is:
102  *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS
103  *         where:
104  *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1
105  *             the prediction input lines (i.e. video_object_tracking.csv has
106  *             precisely the same number of lines as the prediction input had.)
107  *         JSON_FILE_NAME = Name of .JSON file in the output directory, which
108  *             contains prediction responses for the video time segment.
109  *         STATUS = "OK" if prediction completed successfully, or an error
110  *             code with message otherwise. If STATUS is not "OK" then the .JSON
111  *             file for that line may not exist or be empty.
112  *         Each .JSON file, assuming STATUS is "OK", will contain a list of
113  *         AnnotationPayload protos in JSON format, which are the predictions
114  *         for each frame of the video time segment the file is assigned to in
115  *         video_object_tracking.csv. All AnnotationPayload protos will have
116  *         video_object_tracking field set.
117  *  *  For Text Classification:
118  *         In the created directory files `text_classification_1.jsonl`,
119  *         `text_classification_2.jsonl`,...,`text_classification_N.jsonl`
120  *         will be created, where N may be 1, and depends on the
121  *         total number of inputs and annotations found.
122  *         Each .JSONL file will contain, per line, a JSON representation of a
123  *         proto that wraps input text file (or document) in
124  *         the text snippet (or document) proto and a list of
125  *         zero or more AnnotationPayload protos (called annotations), which
126  *         have classification detail populated. A single text file (or
127  *         document) will be listed only once with all its annotations, and its
128  *         annotations will never be split across files.
129  *         If prediction for any input file (or document) failed (partially or
130  *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
131  *         `errors_N.jsonl` files will be created (N depends on total number of
132  *         failed predictions). These files will have a JSON representation of a
133  *         proto that wraps input file followed by exactly one
134  *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
135  *         containing only `code` and `message`.
136  *  *  For Text Sentiment:
137  *         In the created directory files `text_sentiment_1.jsonl`,
138  *         `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl`
139  *         will be created, where N may be 1, and depends on the
140  *         total number of inputs and annotations found.
141  *         Each .JSONL file will contain, per line, a JSON representation of a
142  *         proto that wraps input text file (or document) in
143  *         the text snippet (or document) proto and a list of
144  *         zero or more AnnotationPayload protos (called annotations), which
145  *         have text_sentiment detail populated. A single text file (or
146  *         document) will be listed only once with all its annotations, and its
147  *         annotations will never be split across files.
148  *         If prediction for any input file (or document) failed (partially or
149  *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
150  *         `errors_N.jsonl` files will be created (N depends on total number of
151  *         failed predictions). These files will have a JSON representation of a
152  *         proto that wraps input file followed by exactly one
153  *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
154  *         containing only `code` and `message`.
155  *   *  For Text Extraction:
156  *         In the created directory files `text_extraction_1.jsonl`,
157  *         `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl`
158  *         will be created, where N may be 1, and depends on the
159  *         total number of inputs and annotations found.
160  *         The contents of these .JSONL file(s) depend on whether the input
161  *         used inline text, or documents.
162  *         If input was inline, then each .JSONL file will contain, per line,
163  *           a JSON representation of a proto that wraps given in request text
164  *           snippet's "id" (if specified), followed by input text snippet,
165  *           and a list of zero or more
166  *           AnnotationPayload protos (called annotations), which have
167  *           text_extraction detail populated. A single text snippet will be
168  *           listed only once with all its annotations, and its annotations will
169  *           never be split across files.
170  *         If input used documents, then each .JSONL file will contain, per
171  *           line, a JSON representation of a proto that wraps given in request
172  *           document proto, followed by its OCR-ed representation in the form
173  *           of a text snippet, finally followed by a list of zero or more
174  *           AnnotationPayload protos (called annotations), which have
175  *           text_extraction detail populated and refer, via their indices, to
176  *           the OCR-ed text snippet. A single document (and its text snippet)
177  *           will be listed only once with all its annotations, and its
178  *           annotations will never be split across files.
179  *         If prediction for any text snippet failed (partially or completely),
180  *         then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
181  *         `errors_N.jsonl` files will be created (N depends on total number of
182  *         failed predictions). These files will have a JSON representation of a
183  *         proto that wraps either the "id" : "&lt;id_value&gt;" (in case of inline)
184  *         or the document proto (in case of document) but here followed by
185  *         exactly one
186  *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
187  *         containing only `code` and `message`.
188  *  *  For Tables:
189  *         Output depends on whether
190  *         [gcs_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.gcs_destination]
191  *         or
192  *         [bigquery_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.bigquery_destination]
193  *         is set (either is allowed).
194  *         Google Cloud Storage case:
195  *           In the created directory files `tables_1.csv`, `tables_2.csv`,...,
196  *           `tables_N.csv` will be created, where N may be 1, and depends on
197  *           the total number of the successfully predicted rows.
198  *           For all CLASSIFICATION
199  *           [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]:
200  *             Each .csv file will contain a header, listing all columns'
201  *             [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name]
202  *             given on input followed by M target column names in the format of
203  *             "&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
204  *             [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;_&lt;target
205  *             value&gt;_score" where M is the number of distinct target values,
206  *             i.e. number of distinct values in the target column of the table
207  *             used to train the model. Subsequent lines will contain the
208  *             respective values of successfully predicted rows, with the last,
209  *             i.e. the target, columns having the corresponding prediction
210  *             [scores][google.cloud.automl.v1p1beta.TablesAnnotation.score].
211  *           For REGRESSION and FORECASTING
212  *           [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]:
213  *             Each .csv file will contain a header, listing all columns'
214  *             [display_name-s][google.cloud.automl.v1p1beta.display_name]
215  *             given on input followed by the predicted target column with name
216  *             in the format of
217  *             "predicted_&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
218  *             [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;"
219  *             Subsequent lines will contain the respective values of
220  *             successfully predicted rows, with the last, i.e. the target,
221  *             column having the predicted target value.
222  *             If prediction for any rows failed, then an additional
223  *             `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be
224  *             created (N depends on total number of failed rows). These files
225  *             will have analogous format as `tables_*.csv`, but always with a
226  *             single target column having
227  *             [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
228  *             represented as a JSON string, and containing only `code` and
229  *             `message`.
230  *         BigQuery case:
231  *           [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination]
232  *           pointing to a BigQuery project must be set. In the given project a
233  *           new dataset will be created with name
234  *           `prediction_&lt;model-display-name&gt;_&lt;timestamp-of-prediction-call&gt;`
235  *           where &lt;model-display-name&gt; will be made
236  *           BigQuery-dataset-name compatible (e.g. most special characters will
237  *           become underscores), and timestamp will be in
238  *           YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset
239  *           two tables will be created, `predictions`, and `errors`.
240  *           The `predictions` table's column names will be the input columns'
241  *           [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name]
242  *           followed by the target column with name in the format of
243  *           "predicted_&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
244  *           [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;"
245  *           The input feature columns will contain the respective values of
246  *           successfully predicted rows, with the target column having an
247  *           ARRAY of
248  *           [AnnotationPayloads][google.cloud.automl.v1p1beta.AnnotationPayload],
249  *           represented as STRUCT-s, containing
250  *           [TablesAnnotation][google.cloud.automl.v1p1beta.TablesAnnotation].
251  *           The `errors` table contains rows for which the prediction has
252  *           failed, it has analogous input columns while the target column name
253  *           is in the format of
254  *           "errors_&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
255  *           [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;",
256  *           and as a value has
257  *           [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
258  *           represented as a STRUCT, and containing only `code` and `message`.
259  * </pre>
260  *
261  * Protobuf type {@code google.cloud.automl.v1.BatchPredictOutputConfig}
262  */
263 public final class BatchPredictOutputConfig extends com.google.protobuf.GeneratedMessageV3
264     implements
265     // @@protoc_insertion_point(message_implements:google.cloud.automl.v1.BatchPredictOutputConfig)
266     BatchPredictOutputConfigOrBuilder {
267   private static final long serialVersionUID = 0L;
268   // Use BatchPredictOutputConfig.newBuilder() to construct.
BatchPredictOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)269   private BatchPredictOutputConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
270     super(builder);
271   }
272 
BatchPredictOutputConfig()273   private BatchPredictOutputConfig() {}
274 
275   @java.lang.Override
276   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)277   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
278     return new BatchPredictOutputConfig();
279   }
280 
281   @java.lang.Override
getUnknownFields()282   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
283     return this.unknownFields;
284   }
285 
getDescriptor()286   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
287     return com.google.cloud.automl.v1.Io
288         .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_descriptor;
289   }
290 
291   @java.lang.Override
292   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()293       internalGetFieldAccessorTable() {
294     return com.google.cloud.automl.v1.Io
295         .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_fieldAccessorTable
296         .ensureFieldAccessorsInitialized(
297             com.google.cloud.automl.v1.BatchPredictOutputConfig.class,
298             com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder.class);
299   }
300 
301   private int destinationCase_ = 0;
302   private java.lang.Object destination_;
303 
304   public enum DestinationCase
305       implements
306           com.google.protobuf.Internal.EnumLite,
307           com.google.protobuf.AbstractMessage.InternalOneOfEnum {
308     GCS_DESTINATION(1),
309     DESTINATION_NOT_SET(0);
310     private final int value;
311 
DestinationCase(int value)312     private DestinationCase(int value) {
313       this.value = value;
314     }
315     /**
316      * @param value The number of the enum to look for.
317      * @return The enum associated with the given number.
318      * @deprecated Use {@link #forNumber(int)} instead.
319      */
320     @java.lang.Deprecated
valueOf(int value)321     public static DestinationCase valueOf(int value) {
322       return forNumber(value);
323     }
324 
forNumber(int value)325     public static DestinationCase forNumber(int value) {
326       switch (value) {
327         case 1:
328           return GCS_DESTINATION;
329         case 0:
330           return DESTINATION_NOT_SET;
331         default:
332           return null;
333       }
334     }
335 
getNumber()336     public int getNumber() {
337       return this.value;
338     }
339   };
340 
getDestinationCase()341   public DestinationCase getDestinationCase() {
342     return DestinationCase.forNumber(destinationCase_);
343   }
344 
345   public static final int GCS_DESTINATION_FIELD_NUMBER = 1;
346   /**
347    *
348    *
349    * <pre>
350    * Required. The Google Cloud Storage location of the directory where the output is to
351    * be written to.
352    * </pre>
353    *
354    * <code>
355    * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
356    * </code>
357    *
358    * @return Whether the gcsDestination field is set.
359    */
360   @java.lang.Override
hasGcsDestination()361   public boolean hasGcsDestination() {
362     return destinationCase_ == 1;
363   }
364   /**
365    *
366    *
367    * <pre>
368    * Required. The Google Cloud Storage location of the directory where the output is to
369    * be written to.
370    * </pre>
371    *
372    * <code>
373    * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
374    * </code>
375    *
376    * @return The gcsDestination.
377    */
378   @java.lang.Override
getGcsDestination()379   public com.google.cloud.automl.v1.GcsDestination getGcsDestination() {
380     if (destinationCase_ == 1) {
381       return (com.google.cloud.automl.v1.GcsDestination) destination_;
382     }
383     return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance();
384   }
385   /**
386    *
387    *
388    * <pre>
389    * Required. The Google Cloud Storage location of the directory where the output is to
390    * be written to.
391    * </pre>
392    *
393    * <code>
394    * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
395    * </code>
396    */
397   @java.lang.Override
getGcsDestinationOrBuilder()398   public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() {
399     if (destinationCase_ == 1) {
400       return (com.google.cloud.automl.v1.GcsDestination) destination_;
401     }
402     return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance();
403   }
404 
405   private byte memoizedIsInitialized = -1;
406 
407   @java.lang.Override
isInitialized()408   public final boolean isInitialized() {
409     byte isInitialized = memoizedIsInitialized;
410     if (isInitialized == 1) return true;
411     if (isInitialized == 0) return false;
412 
413     memoizedIsInitialized = 1;
414     return true;
415   }
416 
417   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)418   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
419     if (destinationCase_ == 1) {
420       output.writeMessage(1, (com.google.cloud.automl.v1.GcsDestination) destination_);
421     }
422     getUnknownFields().writeTo(output);
423   }
424 
425   @java.lang.Override
getSerializedSize()426   public int getSerializedSize() {
427     int size = memoizedSize;
428     if (size != -1) return size;
429 
430     size = 0;
431     if (destinationCase_ == 1) {
432       size +=
433           com.google.protobuf.CodedOutputStream.computeMessageSize(
434               1, (com.google.cloud.automl.v1.GcsDestination) destination_);
435     }
436     size += getUnknownFields().getSerializedSize();
437     memoizedSize = size;
438     return size;
439   }
440 
441   @java.lang.Override
equals(final java.lang.Object obj)442   public boolean equals(final java.lang.Object obj) {
443     if (obj == this) {
444       return true;
445     }
446     if (!(obj instanceof com.google.cloud.automl.v1.BatchPredictOutputConfig)) {
447       return super.equals(obj);
448     }
449     com.google.cloud.automl.v1.BatchPredictOutputConfig other =
450         (com.google.cloud.automl.v1.BatchPredictOutputConfig) obj;
451 
452     if (!getDestinationCase().equals(other.getDestinationCase())) return false;
453     switch (destinationCase_) {
454       case 1:
455         if (!getGcsDestination().equals(other.getGcsDestination())) return false;
456         break;
457       case 0:
458       default:
459     }
460     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
461     return true;
462   }
463 
464   @java.lang.Override
hashCode()465   public int hashCode() {
466     if (memoizedHashCode != 0) {
467       return memoizedHashCode;
468     }
469     int hash = 41;
470     hash = (19 * hash) + getDescriptor().hashCode();
471     switch (destinationCase_) {
472       case 1:
473         hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER;
474         hash = (53 * hash) + getGcsDestination().hashCode();
475         break;
476       case 0:
477       default:
478     }
479     hash = (29 * hash) + getUnknownFields().hashCode();
480     memoizedHashCode = hash;
481     return hash;
482   }
483 
parseFrom( java.nio.ByteBuffer data)484   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
485       java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
486     return PARSER.parseFrom(data);
487   }
488 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)489   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
490       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
491       throws com.google.protobuf.InvalidProtocolBufferException {
492     return PARSER.parseFrom(data, extensionRegistry);
493   }
494 
parseFrom( com.google.protobuf.ByteString data)495   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
496       com.google.protobuf.ByteString data)
497       throws com.google.protobuf.InvalidProtocolBufferException {
498     return PARSER.parseFrom(data);
499   }
500 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)501   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
502       com.google.protobuf.ByteString data,
503       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
504       throws com.google.protobuf.InvalidProtocolBufferException {
505     return PARSER.parseFrom(data, extensionRegistry);
506   }
507 
parseFrom(byte[] data)508   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(byte[] data)
509       throws com.google.protobuf.InvalidProtocolBufferException {
510     return PARSER.parseFrom(data);
511   }
512 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)513   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
514       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
515       throws com.google.protobuf.InvalidProtocolBufferException {
516     return PARSER.parseFrom(data, extensionRegistry);
517   }
518 
parseFrom( java.io.InputStream input)519   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
520       java.io.InputStream input) throws java.io.IOException {
521     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
522   }
523 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)524   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
525       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
526       throws java.io.IOException {
527     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
528         PARSER, input, extensionRegistry);
529   }
530 
parseDelimitedFrom( java.io.InputStream input)531   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseDelimitedFrom(
532       java.io.InputStream input) throws java.io.IOException {
533     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
534   }
535 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)536   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseDelimitedFrom(
537       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
538       throws java.io.IOException {
539     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
540         PARSER, input, extensionRegistry);
541   }
542 
parseFrom( com.google.protobuf.CodedInputStream input)543   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
544       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
545     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
546   }
547 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)548   public static com.google.cloud.automl.v1.BatchPredictOutputConfig parseFrom(
549       com.google.protobuf.CodedInputStream input,
550       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
551       throws java.io.IOException {
552     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
553         PARSER, input, extensionRegistry);
554   }
555 
556   @java.lang.Override
newBuilderForType()557   public Builder newBuilderForType() {
558     return newBuilder();
559   }
560 
newBuilder()561   public static Builder newBuilder() {
562     return DEFAULT_INSTANCE.toBuilder();
563   }
564 
newBuilder(com.google.cloud.automl.v1.BatchPredictOutputConfig prototype)565   public static Builder newBuilder(com.google.cloud.automl.v1.BatchPredictOutputConfig prototype) {
566     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
567   }
568 
569   @java.lang.Override
toBuilder()570   public Builder toBuilder() {
571     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
572   }
573 
574   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)575   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
576     Builder builder = new Builder(parent);
577     return builder;
578   }
579   /**
580    *
581    *
582    * <pre>
583    * Output configuration for BatchPredict Action.
584    * As destination the
585    * [gcs_destination][google.cloud.automl.v1.BatchPredictOutputConfig.gcs_destination]
586    * must be set unless specified otherwise for a domain. If gcs_destination is
587    * set then in the given directory a new directory is created. Its name
588    * will be
589    * "prediction-&lt;model-display-name&gt;-&lt;timestamp-of-prediction-call&gt;",
590    * where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. The contents
591    * of it depends on the ML problem the predictions are made for.
592    *  *  For Image Classification:
593    *         In the created directory files `image_classification_1.jsonl`,
594    *         `image_classification_2.jsonl`,...,`image_classification_N.jsonl`
595    *         will be created, where N may be 1, and depends on the
596    *         total number of the successfully predicted images and annotations.
597    *         A single image will be listed only once with all its annotations,
598    *         and its annotations will never be split across files.
599    *         Each .JSONL file will contain, per line, a JSON representation of a
600    *         proto that wraps image's "ID" : "&lt;id_value&gt;" followed by a list of
601    *         zero or more AnnotationPayload protos (called annotations), which
602    *         have classification detail populated.
603    *         If prediction for any image failed (partially or completely), then an
604    *         additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl`
605    *         files will be created (N depends on total number of failed
606    *         predictions). These files will have a JSON representation of a proto
607    *         that wraps the same "ID" : "&lt;id_value&gt;" but here followed by
608    *         exactly one
609    *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
610    *         containing only `code` and `message`fields.
611    *  *  For Image Object Detection:
612    *         In the created directory files `image_object_detection_1.jsonl`,
613    *         `image_object_detection_2.jsonl`,...,`image_object_detection_N.jsonl`
614    *         will be created, where N may be 1, and depends on the
615    *         total number of the successfully predicted images and annotations.
616    *         Each .JSONL file will contain, per line, a JSON representation of a
617    *         proto that wraps image's "ID" : "&lt;id_value&gt;" followed by a list of
618    *         zero or more AnnotationPayload protos (called annotations), which
619    *         have image_object_detection detail populated. A single image will
620    *         be listed only once with all its annotations, and its annotations
621    *         will never be split across files.
622    *         If prediction for any image failed (partially or completely), then
623    *         additional `errors_1.jsonl`, `errors_2.jsonl`,..., `errors_N.jsonl`
624    *         files will be created (N depends on total number of failed
625    *         predictions). These files will have a JSON representation of a proto
626    *         that wraps the same "ID" : "&lt;id_value&gt;" but here followed by
627    *         exactly one
628    *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
629    *         containing only `code` and `message`fields.
630    *  *  For Video Classification:
631    *         In the created directory a video_classification.csv file, and a .JSON
632    *         file per each video classification requested in the input (i.e. each
633    *         line in given CSV(s)), will be created.
634    *         The format of video_classification.csv is:
635    *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS
636    *         where:
637    *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1
638    *             the prediction input lines (i.e. video_classification.csv has
639    *             precisely the same number of lines as the prediction input had.)
640    *         JSON_FILE_NAME = Name of .JSON file in the output directory, which
641    *             contains prediction responses for the video time segment.
642    *         STATUS = "OK" if prediction completed successfully, or an error code
643    *             with message otherwise. If STATUS is not "OK" then the .JSON file
644    *             for that line may not exist or be empty.
645    *         Each .JSON file, assuming STATUS is "OK", will contain a list of
646    *         AnnotationPayload protos in JSON format, which are the predictions
647    *         for the video time segment the file is assigned to in the
648    *         video_classification.csv. All AnnotationPayload protos will have
649    *         video_classification field set, and will be sorted by
650    *         video_classification.type field (note that the returned types are
651    *         governed by `classifaction_types` parameter in
652    *         [PredictService.BatchPredictRequest.params][]).
653    *  *  For Video Object Tracking:
654    *         In the created directory a video_object_tracking.csv file will be
655    *         created, and multiple files video_object_trackinng_1.json,
656    *         video_object_trackinng_2.json,..., video_object_trackinng_N.json,
657    *         where N is the number of requests in the input (i.e. the number of
658    *         lines in given CSV(s)).
659    *         The format of video_object_tracking.csv is:
660    *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END,JSON_FILE_NAME,STATUS
661    *         where:
662    *         GCS_FILE_PATH,TIME_SEGMENT_START,TIME_SEGMENT_END = matches 1 to 1
663    *             the prediction input lines (i.e. video_object_tracking.csv has
664    *             precisely the same number of lines as the prediction input had.)
665    *         JSON_FILE_NAME = Name of .JSON file in the output directory, which
666    *             contains prediction responses for the video time segment.
667    *         STATUS = "OK" if prediction completed successfully, or an error
668    *             code with message otherwise. If STATUS is not "OK" then the .JSON
669    *             file for that line may not exist or be empty.
670    *         Each .JSON file, assuming STATUS is "OK", will contain a list of
671    *         AnnotationPayload protos in JSON format, which are the predictions
672    *         for each frame of the video time segment the file is assigned to in
673    *         video_object_tracking.csv. All AnnotationPayload protos will have
674    *         video_object_tracking field set.
675    *  *  For Text Classification:
676    *         In the created directory files `text_classification_1.jsonl`,
677    *         `text_classification_2.jsonl`,...,`text_classification_N.jsonl`
678    *         will be created, where N may be 1, and depends on the
679    *         total number of inputs and annotations found.
680    *         Each .JSONL file will contain, per line, a JSON representation of a
681    *         proto that wraps input text file (or document) in
682    *         the text snippet (or document) proto and a list of
683    *         zero or more AnnotationPayload protos (called annotations), which
684    *         have classification detail populated. A single text file (or
685    *         document) will be listed only once with all its annotations, and its
686    *         annotations will never be split across files.
687    *         If prediction for any input file (or document) failed (partially or
688    *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
689    *         `errors_N.jsonl` files will be created (N depends on total number of
690    *         failed predictions). These files will have a JSON representation of a
691    *         proto that wraps input file followed by exactly one
692    *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
693    *         containing only `code` and `message`.
694    *  *  For Text Sentiment:
695    *         In the created directory files `text_sentiment_1.jsonl`,
696    *         `text_sentiment_2.jsonl`,...,`text_sentiment_N.jsonl`
697    *         will be created, where N may be 1, and depends on the
698    *         total number of inputs and annotations found.
699    *         Each .JSONL file will contain, per line, a JSON representation of a
700    *         proto that wraps input text file (or document) in
701    *         the text snippet (or document) proto and a list of
702    *         zero or more AnnotationPayload protos (called annotations), which
703    *         have text_sentiment detail populated. A single text file (or
704    *         document) will be listed only once with all its annotations, and its
705    *         annotations will never be split across files.
706    *         If prediction for any input file (or document) failed (partially or
707    *         completely), then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
708    *         `errors_N.jsonl` files will be created (N depends on total number of
709    *         failed predictions). These files will have a JSON representation of a
710    *         proto that wraps input file followed by exactly one
711    *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
712    *         containing only `code` and `message`.
713    *   *  For Text Extraction:
714    *         In the created directory files `text_extraction_1.jsonl`,
715    *         `text_extraction_2.jsonl`,...,`text_extraction_N.jsonl`
716    *         will be created, where N may be 1, and depends on the
717    *         total number of inputs and annotations found.
718    *         The contents of these .JSONL file(s) depend on whether the input
719    *         used inline text, or documents.
720    *         If input was inline, then each .JSONL file will contain, per line,
721    *           a JSON representation of a proto that wraps given in request text
722    *           snippet's "id" (if specified), followed by input text snippet,
723    *           and a list of zero or more
724    *           AnnotationPayload protos (called annotations), which have
725    *           text_extraction detail populated. A single text snippet will be
726    *           listed only once with all its annotations, and its annotations will
727    *           never be split across files.
728    *         If input used documents, then each .JSONL file will contain, per
729    *           line, a JSON representation of a proto that wraps given in request
730    *           document proto, followed by its OCR-ed representation in the form
731    *           of a text snippet, finally followed by a list of zero or more
732    *           AnnotationPayload protos (called annotations), which have
733    *           text_extraction detail populated and refer, via their indices, to
734    *           the OCR-ed text snippet. A single document (and its text snippet)
735    *           will be listed only once with all its annotations, and its
736    *           annotations will never be split across files.
737    *         If prediction for any text snippet failed (partially or completely),
738    *         then additional `errors_1.jsonl`, `errors_2.jsonl`,...,
739    *         `errors_N.jsonl` files will be created (N depends on total number of
740    *         failed predictions). These files will have a JSON representation of a
741    *         proto that wraps either the "id" : "&lt;id_value&gt;" (in case of inline)
742    *         or the document proto (in case of document) but here followed by
743    *         exactly one
744    *         [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
745    *         containing only `code` and `message`.
746    *  *  For Tables:
747    *         Output depends on whether
748    *         [gcs_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.gcs_destination]
749    *         or
750    *         [bigquery_destination][google.cloud.automl.v1p1beta.BatchPredictOutputConfig.bigquery_destination]
751    *         is set (either is allowed).
752    *         Google Cloud Storage case:
753    *           In the created directory files `tables_1.csv`, `tables_2.csv`,...,
754    *           `tables_N.csv` will be created, where N may be 1, and depends on
755    *           the total number of the successfully predicted rows.
756    *           For all CLASSIFICATION
757    *           [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]:
758    *             Each .csv file will contain a header, listing all columns'
759    *             [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name]
760    *             given on input followed by M target column names in the format of
761    *             "&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
762    *             [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;_&lt;target
763    *             value&gt;_score" where M is the number of distinct target values,
764    *             i.e. number of distinct values in the target column of the table
765    *             used to train the model. Subsequent lines will contain the
766    *             respective values of successfully predicted rows, with the last,
767    *             i.e. the target, columns having the corresponding prediction
768    *             [scores][google.cloud.automl.v1p1beta.TablesAnnotation.score].
769    *           For REGRESSION and FORECASTING
770    *           [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]:
771    *             Each .csv file will contain a header, listing all columns'
772    *             [display_name-s][google.cloud.automl.v1p1beta.display_name]
773    *             given on input followed by the predicted target column with name
774    *             in the format of
775    *             "predicted_&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
776    *             [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;"
777    *             Subsequent lines will contain the respective values of
778    *             successfully predicted rows, with the last, i.e. the target,
779    *             column having the predicted target value.
780    *             If prediction for any rows failed, then an additional
781    *             `errors_1.csv`, `errors_2.csv`,..., `errors_N.csv` will be
782    *             created (N depends on total number of failed rows). These files
783    *             will have analogous format as `tables_*.csv`, but always with a
784    *             single target column having
785    *             [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
786    *             represented as a JSON string, and containing only `code` and
787    *             `message`.
788    *         BigQuery case:
789    *           [bigquery_destination][google.cloud.automl.v1p1beta.OutputConfig.bigquery_destination]
790    *           pointing to a BigQuery project must be set. In the given project a
791    *           new dataset will be created with name
792    *           `prediction_&lt;model-display-name&gt;_&lt;timestamp-of-prediction-call&gt;`
793    *           where &lt;model-display-name&gt; will be made
794    *           BigQuery-dataset-name compatible (e.g. most special characters will
795    *           become underscores), and timestamp will be in
796    *           YYYY_MM_DDThh_mm_ss_sssZ "based on ISO-8601" format. In the dataset
797    *           two tables will be created, `predictions`, and `errors`.
798    *           The `predictions` table's column names will be the input columns'
799    *           [display_name-s][google.cloud.automl.v1p1beta.ColumnSpec.display_name]
800    *           followed by the target column with name in the format of
801    *           "predicted_&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
802    *           [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;"
803    *           The input feature columns will contain the respective values of
804    *           successfully predicted rows, with the target column having an
805    *           ARRAY of
806    *           [AnnotationPayloads][google.cloud.automl.v1p1beta.AnnotationPayload],
807    *           represented as STRUCT-s, containing
808    *           [TablesAnnotation][google.cloud.automl.v1p1beta.TablesAnnotation].
809    *           The `errors` table contains rows for which the prediction has
810    *           failed, it has analogous input columns while the target column name
811    *           is in the format of
812    *           "errors_&lt;[target_column_specs][google.cloud.automl.v1p1beta.TablesModelMetadata.target_column_spec]
813    *           [display_name][google.cloud.automl.v1p1beta.ColumnSpec.display_name]&gt;",
814    *           and as a value has
815    *           [`google.rpc.Status`](https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto)
816    *           represented as a STRUCT, and containing only `code` and `message`.
817    * </pre>
818    *
819    * Protobuf type {@code google.cloud.automl.v1.BatchPredictOutputConfig}
820    */
821   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
822       implements
823       // @@protoc_insertion_point(builder_implements:google.cloud.automl.v1.BatchPredictOutputConfig)
824       com.google.cloud.automl.v1.BatchPredictOutputConfigOrBuilder {
getDescriptor()825     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
826       return com.google.cloud.automl.v1.Io
827           .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_descriptor;
828     }
829 
830     @java.lang.Override
831     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()832         internalGetFieldAccessorTable() {
833       return com.google.cloud.automl.v1.Io
834           .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_fieldAccessorTable
835           .ensureFieldAccessorsInitialized(
836               com.google.cloud.automl.v1.BatchPredictOutputConfig.class,
837               com.google.cloud.automl.v1.BatchPredictOutputConfig.Builder.class);
838     }
839 
840     // Construct using com.google.cloud.automl.v1.BatchPredictOutputConfig.newBuilder()
Builder()841     private Builder() {}
842 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)843     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
844       super(parent);
845     }
846 
847     @java.lang.Override
clear()848     public Builder clear() {
849       super.clear();
850       bitField0_ = 0;
851       if (gcsDestinationBuilder_ != null) {
852         gcsDestinationBuilder_.clear();
853       }
854       destinationCase_ = 0;
855       destination_ = null;
856       return this;
857     }
858 
859     @java.lang.Override
getDescriptorForType()860     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
861       return com.google.cloud.automl.v1.Io
862           .internal_static_google_cloud_automl_v1_BatchPredictOutputConfig_descriptor;
863     }
864 
865     @java.lang.Override
getDefaultInstanceForType()866     public com.google.cloud.automl.v1.BatchPredictOutputConfig getDefaultInstanceForType() {
867       return com.google.cloud.automl.v1.BatchPredictOutputConfig.getDefaultInstance();
868     }
869 
870     @java.lang.Override
build()871     public com.google.cloud.automl.v1.BatchPredictOutputConfig build() {
872       com.google.cloud.automl.v1.BatchPredictOutputConfig result = buildPartial();
873       if (!result.isInitialized()) {
874         throw newUninitializedMessageException(result);
875       }
876       return result;
877     }
878 
879     @java.lang.Override
buildPartial()880     public com.google.cloud.automl.v1.BatchPredictOutputConfig buildPartial() {
881       com.google.cloud.automl.v1.BatchPredictOutputConfig result =
882           new com.google.cloud.automl.v1.BatchPredictOutputConfig(this);
883       if (bitField0_ != 0) {
884         buildPartial0(result);
885       }
886       buildPartialOneofs(result);
887       onBuilt();
888       return result;
889     }
890 
buildPartial0(com.google.cloud.automl.v1.BatchPredictOutputConfig result)891     private void buildPartial0(com.google.cloud.automl.v1.BatchPredictOutputConfig result) {
892       int from_bitField0_ = bitField0_;
893     }
894 
buildPartialOneofs(com.google.cloud.automl.v1.BatchPredictOutputConfig result)895     private void buildPartialOneofs(com.google.cloud.automl.v1.BatchPredictOutputConfig result) {
896       result.destinationCase_ = destinationCase_;
897       result.destination_ = this.destination_;
898       if (destinationCase_ == 1 && gcsDestinationBuilder_ != null) {
899         result.destination_ = gcsDestinationBuilder_.build();
900       }
901     }
902 
903     @java.lang.Override
clone()904     public Builder clone() {
905       return super.clone();
906     }
907 
908     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)909     public Builder setField(
910         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
911       return super.setField(field, value);
912     }
913 
914     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)915     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
916       return super.clearField(field);
917     }
918 
919     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)920     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
921       return super.clearOneof(oneof);
922     }
923 
924     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)925     public Builder setRepeatedField(
926         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
927       return super.setRepeatedField(field, index, value);
928     }
929 
930     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)931     public Builder addRepeatedField(
932         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
933       return super.addRepeatedField(field, value);
934     }
935 
936     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)937     public Builder mergeFrom(com.google.protobuf.Message other) {
938       if (other instanceof com.google.cloud.automl.v1.BatchPredictOutputConfig) {
939         return mergeFrom((com.google.cloud.automl.v1.BatchPredictOutputConfig) other);
940       } else {
941         super.mergeFrom(other);
942         return this;
943       }
944     }
945 
mergeFrom(com.google.cloud.automl.v1.BatchPredictOutputConfig other)946     public Builder mergeFrom(com.google.cloud.automl.v1.BatchPredictOutputConfig other) {
947       if (other == com.google.cloud.automl.v1.BatchPredictOutputConfig.getDefaultInstance())
948         return this;
949       switch (other.getDestinationCase()) {
950         case GCS_DESTINATION:
951           {
952             mergeGcsDestination(other.getGcsDestination());
953             break;
954           }
955         case DESTINATION_NOT_SET:
956           {
957             break;
958           }
959       }
960       this.mergeUnknownFields(other.getUnknownFields());
961       onChanged();
962       return this;
963     }
964 
965     @java.lang.Override
isInitialized()966     public final boolean isInitialized() {
967       return true;
968     }
969 
970     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)971     public Builder mergeFrom(
972         com.google.protobuf.CodedInputStream input,
973         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
974         throws java.io.IOException {
975       if (extensionRegistry == null) {
976         throw new java.lang.NullPointerException();
977       }
978       try {
979         boolean done = false;
980         while (!done) {
981           int tag = input.readTag();
982           switch (tag) {
983             case 0:
984               done = true;
985               break;
986             case 10:
987               {
988                 input.readMessage(getGcsDestinationFieldBuilder().getBuilder(), extensionRegistry);
989                 destinationCase_ = 1;
990                 break;
991               } // case 10
992             default:
993               {
994                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
995                   done = true; // was an endgroup tag
996                 }
997                 break;
998               } // default:
999           } // switch (tag)
1000         } // while (!done)
1001       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1002         throw e.unwrapIOException();
1003       } finally {
1004         onChanged();
1005       } // finally
1006       return this;
1007     }
1008 
1009     private int destinationCase_ = 0;
1010     private java.lang.Object destination_;
1011 
getDestinationCase()1012     public DestinationCase getDestinationCase() {
1013       return DestinationCase.forNumber(destinationCase_);
1014     }
1015 
clearDestination()1016     public Builder clearDestination() {
1017       destinationCase_ = 0;
1018       destination_ = null;
1019       onChanged();
1020       return this;
1021     }
1022 
1023     private int bitField0_;
1024 
1025     private com.google.protobuf.SingleFieldBuilderV3<
1026             com.google.cloud.automl.v1.GcsDestination,
1027             com.google.cloud.automl.v1.GcsDestination.Builder,
1028             com.google.cloud.automl.v1.GcsDestinationOrBuilder>
1029         gcsDestinationBuilder_;
1030     /**
1031      *
1032      *
1033      * <pre>
1034      * Required. The Google Cloud Storage location of the directory where the output is to
1035      * be written to.
1036      * </pre>
1037      *
1038      * <code>
1039      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1040      * </code>
1041      *
1042      * @return Whether the gcsDestination field is set.
1043      */
1044     @java.lang.Override
hasGcsDestination()1045     public boolean hasGcsDestination() {
1046       return destinationCase_ == 1;
1047     }
1048     /**
1049      *
1050      *
1051      * <pre>
1052      * Required. The Google Cloud Storage location of the directory where the output is to
1053      * be written to.
1054      * </pre>
1055      *
1056      * <code>
1057      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1058      * </code>
1059      *
1060      * @return The gcsDestination.
1061      */
1062     @java.lang.Override
getGcsDestination()1063     public com.google.cloud.automl.v1.GcsDestination getGcsDestination() {
1064       if (gcsDestinationBuilder_ == null) {
1065         if (destinationCase_ == 1) {
1066           return (com.google.cloud.automl.v1.GcsDestination) destination_;
1067         }
1068         return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance();
1069       } else {
1070         if (destinationCase_ == 1) {
1071           return gcsDestinationBuilder_.getMessage();
1072         }
1073         return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance();
1074       }
1075     }
1076     /**
1077      *
1078      *
1079      * <pre>
1080      * Required. The Google Cloud Storage location of the directory where the output is to
1081      * be written to.
1082      * </pre>
1083      *
1084      * <code>
1085      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1086      * </code>
1087      */
setGcsDestination(com.google.cloud.automl.v1.GcsDestination value)1088     public Builder setGcsDestination(com.google.cloud.automl.v1.GcsDestination value) {
1089       if (gcsDestinationBuilder_ == null) {
1090         if (value == null) {
1091           throw new NullPointerException();
1092         }
1093         destination_ = value;
1094         onChanged();
1095       } else {
1096         gcsDestinationBuilder_.setMessage(value);
1097       }
1098       destinationCase_ = 1;
1099       return this;
1100     }
1101     /**
1102      *
1103      *
1104      * <pre>
1105      * Required. The Google Cloud Storage location of the directory where the output is to
1106      * be written to.
1107      * </pre>
1108      *
1109      * <code>
1110      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1111      * </code>
1112      */
setGcsDestination( com.google.cloud.automl.v1.GcsDestination.Builder builderForValue)1113     public Builder setGcsDestination(
1114         com.google.cloud.automl.v1.GcsDestination.Builder builderForValue) {
1115       if (gcsDestinationBuilder_ == null) {
1116         destination_ = builderForValue.build();
1117         onChanged();
1118       } else {
1119         gcsDestinationBuilder_.setMessage(builderForValue.build());
1120       }
1121       destinationCase_ = 1;
1122       return this;
1123     }
1124     /**
1125      *
1126      *
1127      * <pre>
1128      * Required. The Google Cloud Storage location of the directory where the output is to
1129      * be written to.
1130      * </pre>
1131      *
1132      * <code>
1133      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1134      * </code>
1135      */
mergeGcsDestination(com.google.cloud.automl.v1.GcsDestination value)1136     public Builder mergeGcsDestination(com.google.cloud.automl.v1.GcsDestination value) {
1137       if (gcsDestinationBuilder_ == null) {
1138         if (destinationCase_ == 1
1139             && destination_ != com.google.cloud.automl.v1.GcsDestination.getDefaultInstance()) {
1140           destination_ =
1141               com.google.cloud.automl.v1.GcsDestination.newBuilder(
1142                       (com.google.cloud.automl.v1.GcsDestination) destination_)
1143                   .mergeFrom(value)
1144                   .buildPartial();
1145         } else {
1146           destination_ = value;
1147         }
1148         onChanged();
1149       } else {
1150         if (destinationCase_ == 1) {
1151           gcsDestinationBuilder_.mergeFrom(value);
1152         } else {
1153           gcsDestinationBuilder_.setMessage(value);
1154         }
1155       }
1156       destinationCase_ = 1;
1157       return this;
1158     }
1159     /**
1160      *
1161      *
1162      * <pre>
1163      * Required. The Google Cloud Storage location of the directory where the output is to
1164      * be written to.
1165      * </pre>
1166      *
1167      * <code>
1168      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1169      * </code>
1170      */
clearGcsDestination()1171     public Builder clearGcsDestination() {
1172       if (gcsDestinationBuilder_ == null) {
1173         if (destinationCase_ == 1) {
1174           destinationCase_ = 0;
1175           destination_ = null;
1176           onChanged();
1177         }
1178       } else {
1179         if (destinationCase_ == 1) {
1180           destinationCase_ = 0;
1181           destination_ = null;
1182         }
1183         gcsDestinationBuilder_.clear();
1184       }
1185       return this;
1186     }
1187     /**
1188      *
1189      *
1190      * <pre>
1191      * Required. The Google Cloud Storage location of the directory where the output is to
1192      * be written to.
1193      * </pre>
1194      *
1195      * <code>
1196      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1197      * </code>
1198      */
getGcsDestinationBuilder()1199     public com.google.cloud.automl.v1.GcsDestination.Builder getGcsDestinationBuilder() {
1200       return getGcsDestinationFieldBuilder().getBuilder();
1201     }
1202     /**
1203      *
1204      *
1205      * <pre>
1206      * Required. The Google Cloud Storage location of the directory where the output is to
1207      * be written to.
1208      * </pre>
1209      *
1210      * <code>
1211      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1212      * </code>
1213      */
1214     @java.lang.Override
getGcsDestinationOrBuilder()1215     public com.google.cloud.automl.v1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() {
1216       if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) {
1217         return gcsDestinationBuilder_.getMessageOrBuilder();
1218       } else {
1219         if (destinationCase_ == 1) {
1220           return (com.google.cloud.automl.v1.GcsDestination) destination_;
1221         }
1222         return com.google.cloud.automl.v1.GcsDestination.getDefaultInstance();
1223       }
1224     }
1225     /**
1226      *
1227      *
1228      * <pre>
1229      * Required. The Google Cloud Storage location of the directory where the output is to
1230      * be written to.
1231      * </pre>
1232      *
1233      * <code>
1234      * .google.cloud.automl.v1.GcsDestination gcs_destination = 1 [(.google.api.field_behavior) = REQUIRED];
1235      * </code>
1236      */
1237     private com.google.protobuf.SingleFieldBuilderV3<
1238             com.google.cloud.automl.v1.GcsDestination,
1239             com.google.cloud.automl.v1.GcsDestination.Builder,
1240             com.google.cloud.automl.v1.GcsDestinationOrBuilder>
getGcsDestinationFieldBuilder()1241         getGcsDestinationFieldBuilder() {
1242       if (gcsDestinationBuilder_ == null) {
1243         if (!(destinationCase_ == 1)) {
1244           destination_ = com.google.cloud.automl.v1.GcsDestination.getDefaultInstance();
1245         }
1246         gcsDestinationBuilder_ =
1247             new com.google.protobuf.SingleFieldBuilderV3<
1248                 com.google.cloud.automl.v1.GcsDestination,
1249                 com.google.cloud.automl.v1.GcsDestination.Builder,
1250                 com.google.cloud.automl.v1.GcsDestinationOrBuilder>(
1251                 (com.google.cloud.automl.v1.GcsDestination) destination_,
1252                 getParentForChildren(),
1253                 isClean());
1254         destination_ = null;
1255       }
1256       destinationCase_ = 1;
1257       onChanged();
1258       return gcsDestinationBuilder_;
1259     }
1260 
1261     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1262     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1263       return super.setUnknownFields(unknownFields);
1264     }
1265 
1266     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1267     public final Builder mergeUnknownFields(
1268         final com.google.protobuf.UnknownFieldSet unknownFields) {
1269       return super.mergeUnknownFields(unknownFields);
1270     }
1271 
1272     // @@protoc_insertion_point(builder_scope:google.cloud.automl.v1.BatchPredictOutputConfig)
1273   }
1274 
1275   // @@protoc_insertion_point(class_scope:google.cloud.automl.v1.BatchPredictOutputConfig)
1276   private static final com.google.cloud.automl.v1.BatchPredictOutputConfig DEFAULT_INSTANCE;
1277 
1278   static {
1279     DEFAULT_INSTANCE = new com.google.cloud.automl.v1.BatchPredictOutputConfig();
1280   }
1281 
getDefaultInstance()1282   public static com.google.cloud.automl.v1.BatchPredictOutputConfig getDefaultInstance() {
1283     return DEFAULT_INSTANCE;
1284   }
1285 
1286   private static final com.google.protobuf.Parser<BatchPredictOutputConfig> PARSER =
1287       new com.google.protobuf.AbstractParser<BatchPredictOutputConfig>() {
1288         @java.lang.Override
1289         public BatchPredictOutputConfig parsePartialFrom(
1290             com.google.protobuf.CodedInputStream input,
1291             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1292             throws com.google.protobuf.InvalidProtocolBufferException {
1293           Builder builder = newBuilder();
1294           try {
1295             builder.mergeFrom(input, extensionRegistry);
1296           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1297             throw e.setUnfinishedMessage(builder.buildPartial());
1298           } catch (com.google.protobuf.UninitializedMessageException e) {
1299             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1300           } catch (java.io.IOException e) {
1301             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1302                 .setUnfinishedMessage(builder.buildPartial());
1303           }
1304           return builder.buildPartial();
1305         }
1306       };
1307 
parser()1308   public static com.google.protobuf.Parser<BatchPredictOutputConfig> parser() {
1309     return PARSER;
1310   }
1311 
1312   @java.lang.Override
getParserForType()1313   public com.google.protobuf.Parser<BatchPredictOutputConfig> getParserForType() {
1314     return PARSER;
1315   }
1316 
1317   @java.lang.Override
getDefaultInstanceForType()1318   public com.google.cloud.automl.v1.BatchPredictOutputConfig getDefaultInstanceForType() {
1319     return DEFAULT_INSTANCE;
1320   }
1321 }
1322