• 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/dialogflow/v2/document.proto
18 
19 package com.google.cloud.dialogflow.v2;
20 
21 /**
22  *
23  *
24  * <pre>
25  * A knowledge document to be used by a
26  * [KnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBase].
27  * For more information, see the [knowledge base
28  * guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases).
29  * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
30  * only use `projects.knowledgeBases.documents`.
31  * </pre>
32  *
33  * Protobuf type {@code google.cloud.dialogflow.v2.Document}
34  */
35 public final class Document extends com.google.protobuf.GeneratedMessageV3
36     implements
37     // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.Document)
38     DocumentOrBuilder {
39   private static final long serialVersionUID = 0L;
40   // Use Document.newBuilder() to construct.
Document(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)41   private Document(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
42     super(builder);
43   }
44 
Document()45   private Document() {
46     name_ = "";
47     displayName_ = "";
48     mimeType_ = "";
49     knowledgeTypes_ = java.util.Collections.emptyList();
50     state_ = 0;
51   }
52 
53   @java.lang.Override
54   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)55   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
56     return new Document();
57   }
58 
59   @java.lang.Override
getUnknownFields()60   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
61     return this.unknownFields;
62   }
63 
getDescriptor()64   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
65     return com.google.cloud.dialogflow.v2.DocumentProto
66         .internal_static_google_cloud_dialogflow_v2_Document_descriptor;
67   }
68 
69   @SuppressWarnings({"rawtypes"})
70   @java.lang.Override
internalGetMapField(int number)71   protected com.google.protobuf.MapField internalGetMapField(int number) {
72     switch (number) {
73       case 7:
74         return internalGetMetadata();
75       default:
76         throw new RuntimeException("Invalid map field number: " + number);
77     }
78   }
79 
80   @java.lang.Override
81   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()82       internalGetFieldAccessorTable() {
83     return com.google.cloud.dialogflow.v2.DocumentProto
84         .internal_static_google_cloud_dialogflow_v2_Document_fieldAccessorTable
85         .ensureFieldAccessorsInitialized(
86             com.google.cloud.dialogflow.v2.Document.class,
87             com.google.cloud.dialogflow.v2.Document.Builder.class);
88   }
89 
90   /**
91    *
92    *
93    * <pre>
94    * The knowledge type of document content.
95    * </pre>
96    *
97    * Protobuf enum {@code google.cloud.dialogflow.v2.Document.KnowledgeType}
98    */
99   public enum KnowledgeType implements com.google.protobuf.ProtocolMessageEnum {
100     /**
101      *
102      *
103      * <pre>
104      * The type is unspecified or arbitrary.
105      * </pre>
106      *
107      * <code>KNOWLEDGE_TYPE_UNSPECIFIED = 0;</code>
108      */
109     KNOWLEDGE_TYPE_UNSPECIFIED(0),
110     /**
111      *
112      *
113      * <pre>
114      * The document content contains question and answer pairs as either HTML or
115      * CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats
116      * may fail to be parsed.
117      * CSV must have questions in the first column and answers in the second,
118      * with no header. Because of this explicit format, they are always parsed
119      * accurately.
120      * </pre>
121      *
122      * <code>FAQ = 1;</code>
123      */
124     FAQ(1),
125     /**
126      *
127      *
128      * <pre>
129      * Documents for which unstructured text is extracted and used for
130      * question answering.
131      * </pre>
132      *
133      * <code>EXTRACTIVE_QA = 2;</code>
134      */
135     EXTRACTIVE_QA(2),
136     /**
137      *
138      *
139      * <pre>
140      * The entire document content as a whole can be used for query results.
141      * Only for Contact Center Solutions on Dialogflow.
142      * </pre>
143      *
144      * <code>ARTICLE_SUGGESTION = 3;</code>
145      */
146     ARTICLE_SUGGESTION(3),
147     /**
148      *
149      *
150      * <pre>
151      * The document contains agent-facing Smart Reply entries.
152      * </pre>
153      *
154      * <code>AGENT_FACING_SMART_REPLY = 4;</code>
155      */
156     AGENT_FACING_SMART_REPLY(4),
157     UNRECOGNIZED(-1),
158     ;
159 
160     /**
161      *
162      *
163      * <pre>
164      * The type is unspecified or arbitrary.
165      * </pre>
166      *
167      * <code>KNOWLEDGE_TYPE_UNSPECIFIED = 0;</code>
168      */
169     public static final int KNOWLEDGE_TYPE_UNSPECIFIED_VALUE = 0;
170     /**
171      *
172      *
173      * <pre>
174      * The document content contains question and answer pairs as either HTML or
175      * CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats
176      * may fail to be parsed.
177      * CSV must have questions in the first column and answers in the second,
178      * with no header. Because of this explicit format, they are always parsed
179      * accurately.
180      * </pre>
181      *
182      * <code>FAQ = 1;</code>
183      */
184     public static final int FAQ_VALUE = 1;
185     /**
186      *
187      *
188      * <pre>
189      * Documents for which unstructured text is extracted and used for
190      * question answering.
191      * </pre>
192      *
193      * <code>EXTRACTIVE_QA = 2;</code>
194      */
195     public static final int EXTRACTIVE_QA_VALUE = 2;
196     /**
197      *
198      *
199      * <pre>
200      * The entire document content as a whole can be used for query results.
201      * Only for Contact Center Solutions on Dialogflow.
202      * </pre>
203      *
204      * <code>ARTICLE_SUGGESTION = 3;</code>
205      */
206     public static final int ARTICLE_SUGGESTION_VALUE = 3;
207     /**
208      *
209      *
210      * <pre>
211      * The document contains agent-facing Smart Reply entries.
212      * </pre>
213      *
214      * <code>AGENT_FACING_SMART_REPLY = 4;</code>
215      */
216     public static final int AGENT_FACING_SMART_REPLY_VALUE = 4;
217 
getNumber()218     public final int getNumber() {
219       if (this == UNRECOGNIZED) {
220         throw new java.lang.IllegalArgumentException(
221             "Can't get the number of an unknown enum value.");
222       }
223       return value;
224     }
225 
226     /**
227      * @param value The numeric wire value of the corresponding enum entry.
228      * @return The enum associated with the given numeric wire value.
229      * @deprecated Use {@link #forNumber(int)} instead.
230      */
231     @java.lang.Deprecated
valueOf(int value)232     public static KnowledgeType valueOf(int value) {
233       return forNumber(value);
234     }
235 
236     /**
237      * @param value The numeric wire value of the corresponding enum entry.
238      * @return The enum associated with the given numeric wire value.
239      */
forNumber(int value)240     public static KnowledgeType forNumber(int value) {
241       switch (value) {
242         case 0:
243           return KNOWLEDGE_TYPE_UNSPECIFIED;
244         case 1:
245           return FAQ;
246         case 2:
247           return EXTRACTIVE_QA;
248         case 3:
249           return ARTICLE_SUGGESTION;
250         case 4:
251           return AGENT_FACING_SMART_REPLY;
252         default:
253           return null;
254       }
255     }
256 
internalGetValueMap()257     public static com.google.protobuf.Internal.EnumLiteMap<KnowledgeType> internalGetValueMap() {
258       return internalValueMap;
259     }
260 
261     private static final com.google.protobuf.Internal.EnumLiteMap<KnowledgeType> internalValueMap =
262         new com.google.protobuf.Internal.EnumLiteMap<KnowledgeType>() {
263           public KnowledgeType findValueByNumber(int number) {
264             return KnowledgeType.forNumber(number);
265           }
266         };
267 
getValueDescriptor()268     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
269       if (this == UNRECOGNIZED) {
270         throw new java.lang.IllegalStateException(
271             "Can't get the descriptor of an unrecognized enum value.");
272       }
273       return getDescriptor().getValues().get(ordinal());
274     }
275 
getDescriptorForType()276     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
277       return getDescriptor();
278     }
279 
getDescriptor()280     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
281       return com.google.cloud.dialogflow.v2.Document.getDescriptor().getEnumTypes().get(0);
282     }
283 
284     private static final KnowledgeType[] VALUES = values();
285 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)286     public static KnowledgeType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
287       if (desc.getType() != getDescriptor()) {
288         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
289       }
290       if (desc.getIndex() == -1) {
291         return UNRECOGNIZED;
292       }
293       return VALUES[desc.getIndex()];
294     }
295 
296     private final int value;
297 
KnowledgeType(int value)298     private KnowledgeType(int value) {
299       this.value = value;
300     }
301 
302     // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2.Document.KnowledgeType)
303   }
304 
305   /**
306    *
307    *
308    * <pre>
309    * Possible states of the document
310    * </pre>
311    *
312    * Protobuf enum {@code google.cloud.dialogflow.v2.Document.State}
313    */
314   public enum State implements com.google.protobuf.ProtocolMessageEnum {
315     /**
316      *
317      *
318      * <pre>
319      * The document state is unspecified.
320      * </pre>
321      *
322      * <code>STATE_UNSPECIFIED = 0;</code>
323      */
324     STATE_UNSPECIFIED(0),
325     /**
326      *
327      *
328      * <pre>
329      * The document creation is in progress.
330      * </pre>
331      *
332      * <code>CREATING = 1;</code>
333      */
334     CREATING(1),
335     /**
336      *
337      *
338      * <pre>
339      * The document is active and ready to use.
340      * </pre>
341      *
342      * <code>ACTIVE = 2;</code>
343      */
344     ACTIVE(2),
345     /**
346      *
347      *
348      * <pre>
349      * The document updation is in progress.
350      * </pre>
351      *
352      * <code>UPDATING = 3;</code>
353      */
354     UPDATING(3),
355     /**
356      *
357      *
358      * <pre>
359      * The document is reloading.
360      * </pre>
361      *
362      * <code>RELOADING = 4;</code>
363      */
364     RELOADING(4),
365     /**
366      *
367      *
368      * <pre>
369      * The document deletion is in progress.
370      * </pre>
371      *
372      * <code>DELETING = 5;</code>
373      */
374     DELETING(5),
375     UNRECOGNIZED(-1),
376     ;
377 
378     /**
379      *
380      *
381      * <pre>
382      * The document state is unspecified.
383      * </pre>
384      *
385      * <code>STATE_UNSPECIFIED = 0;</code>
386      */
387     public static final int STATE_UNSPECIFIED_VALUE = 0;
388     /**
389      *
390      *
391      * <pre>
392      * The document creation is in progress.
393      * </pre>
394      *
395      * <code>CREATING = 1;</code>
396      */
397     public static final int CREATING_VALUE = 1;
398     /**
399      *
400      *
401      * <pre>
402      * The document is active and ready to use.
403      * </pre>
404      *
405      * <code>ACTIVE = 2;</code>
406      */
407     public static final int ACTIVE_VALUE = 2;
408     /**
409      *
410      *
411      * <pre>
412      * The document updation is in progress.
413      * </pre>
414      *
415      * <code>UPDATING = 3;</code>
416      */
417     public static final int UPDATING_VALUE = 3;
418     /**
419      *
420      *
421      * <pre>
422      * The document is reloading.
423      * </pre>
424      *
425      * <code>RELOADING = 4;</code>
426      */
427     public static final int RELOADING_VALUE = 4;
428     /**
429      *
430      *
431      * <pre>
432      * The document deletion is in progress.
433      * </pre>
434      *
435      * <code>DELETING = 5;</code>
436      */
437     public static final int DELETING_VALUE = 5;
438 
getNumber()439     public final int getNumber() {
440       if (this == UNRECOGNIZED) {
441         throw new java.lang.IllegalArgumentException(
442             "Can't get the number of an unknown enum value.");
443       }
444       return value;
445     }
446 
447     /**
448      * @param value The numeric wire value of the corresponding enum entry.
449      * @return The enum associated with the given numeric wire value.
450      * @deprecated Use {@link #forNumber(int)} instead.
451      */
452     @java.lang.Deprecated
valueOf(int value)453     public static State valueOf(int value) {
454       return forNumber(value);
455     }
456 
457     /**
458      * @param value The numeric wire value of the corresponding enum entry.
459      * @return The enum associated with the given numeric wire value.
460      */
forNumber(int value)461     public static State forNumber(int value) {
462       switch (value) {
463         case 0:
464           return STATE_UNSPECIFIED;
465         case 1:
466           return CREATING;
467         case 2:
468           return ACTIVE;
469         case 3:
470           return UPDATING;
471         case 4:
472           return RELOADING;
473         case 5:
474           return DELETING;
475         default:
476           return null;
477       }
478     }
479 
internalGetValueMap()480     public static com.google.protobuf.Internal.EnumLiteMap<State> internalGetValueMap() {
481       return internalValueMap;
482     }
483 
484     private static final com.google.protobuf.Internal.EnumLiteMap<State> internalValueMap =
485         new com.google.protobuf.Internal.EnumLiteMap<State>() {
486           public State findValueByNumber(int number) {
487             return State.forNumber(number);
488           }
489         };
490 
getValueDescriptor()491     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
492       if (this == UNRECOGNIZED) {
493         throw new java.lang.IllegalStateException(
494             "Can't get the descriptor of an unrecognized enum value.");
495       }
496       return getDescriptor().getValues().get(ordinal());
497     }
498 
getDescriptorForType()499     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
500       return getDescriptor();
501     }
502 
getDescriptor()503     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
504       return com.google.cloud.dialogflow.v2.Document.getDescriptor().getEnumTypes().get(1);
505     }
506 
507     private static final State[] VALUES = values();
508 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)509     public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
510       if (desc.getType() != getDescriptor()) {
511         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
512       }
513       if (desc.getIndex() == -1) {
514         return UNRECOGNIZED;
515       }
516       return VALUES[desc.getIndex()];
517     }
518 
519     private final int value;
520 
State(int value)521     private State(int value) {
522       this.value = value;
523     }
524 
525     // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2.Document.State)
526   }
527 
528   public interface ReloadStatusOrBuilder
529       extends
530       // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.Document.ReloadStatus)
531       com.google.protobuf.MessageOrBuilder {
532 
533     /**
534      *
535      *
536      * <pre>
537      * The time of a reload attempt.
538      * This reload may have been triggered automatically or manually and may
539      * not have succeeded.
540      * </pre>
541      *
542      * <code>.google.protobuf.Timestamp time = 1;</code>
543      *
544      * @return Whether the time field is set.
545      */
hasTime()546     boolean hasTime();
547     /**
548      *
549      *
550      * <pre>
551      * The time of a reload attempt.
552      * This reload may have been triggered automatically or manually and may
553      * not have succeeded.
554      * </pre>
555      *
556      * <code>.google.protobuf.Timestamp time = 1;</code>
557      *
558      * @return The time.
559      */
getTime()560     com.google.protobuf.Timestamp getTime();
561     /**
562      *
563      *
564      * <pre>
565      * The time of a reload attempt.
566      * This reload may have been triggered automatically or manually and may
567      * not have succeeded.
568      * </pre>
569      *
570      * <code>.google.protobuf.Timestamp time = 1;</code>
571      */
getTimeOrBuilder()572     com.google.protobuf.TimestampOrBuilder getTimeOrBuilder();
573 
574     /**
575      *
576      *
577      * <pre>
578      * The status of a reload attempt or the initial load.
579      * </pre>
580      *
581      * <code>.google.rpc.Status status = 2;</code>
582      *
583      * @return Whether the status field is set.
584      */
hasStatus()585     boolean hasStatus();
586     /**
587      *
588      *
589      * <pre>
590      * The status of a reload attempt or the initial load.
591      * </pre>
592      *
593      * <code>.google.rpc.Status status = 2;</code>
594      *
595      * @return The status.
596      */
getStatus()597     com.google.rpc.Status getStatus();
598     /**
599      *
600      *
601      * <pre>
602      * The status of a reload attempt or the initial load.
603      * </pre>
604      *
605      * <code>.google.rpc.Status status = 2;</code>
606      */
getStatusOrBuilder()607     com.google.rpc.StatusOrBuilder getStatusOrBuilder();
608   }
609   /**
610    *
611    *
612    * <pre>
613    * The status of a reload attempt.
614    * </pre>
615    *
616    * Protobuf type {@code google.cloud.dialogflow.v2.Document.ReloadStatus}
617    */
618   public static final class ReloadStatus extends com.google.protobuf.GeneratedMessageV3
619       implements
620       // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.Document.ReloadStatus)
621       ReloadStatusOrBuilder {
622     private static final long serialVersionUID = 0L;
623     // Use ReloadStatus.newBuilder() to construct.
ReloadStatus(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)624     private ReloadStatus(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
625       super(builder);
626     }
627 
ReloadStatus()628     private ReloadStatus() {}
629 
630     @java.lang.Override
631     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)632     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
633       return new ReloadStatus();
634     }
635 
636     @java.lang.Override
getUnknownFields()637     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
638       return this.unknownFields;
639     }
640 
getDescriptor()641     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
642       return com.google.cloud.dialogflow.v2.DocumentProto
643           .internal_static_google_cloud_dialogflow_v2_Document_ReloadStatus_descriptor;
644     }
645 
646     @java.lang.Override
647     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()648         internalGetFieldAccessorTable() {
649       return com.google.cloud.dialogflow.v2.DocumentProto
650           .internal_static_google_cloud_dialogflow_v2_Document_ReloadStatus_fieldAccessorTable
651           .ensureFieldAccessorsInitialized(
652               com.google.cloud.dialogflow.v2.Document.ReloadStatus.class,
653               com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder.class);
654     }
655 
656     public static final int TIME_FIELD_NUMBER = 1;
657     private com.google.protobuf.Timestamp time_;
658     /**
659      *
660      *
661      * <pre>
662      * The time of a reload attempt.
663      * This reload may have been triggered automatically or manually and may
664      * not have succeeded.
665      * </pre>
666      *
667      * <code>.google.protobuf.Timestamp time = 1;</code>
668      *
669      * @return Whether the time field is set.
670      */
671     @java.lang.Override
hasTime()672     public boolean hasTime() {
673       return time_ != null;
674     }
675     /**
676      *
677      *
678      * <pre>
679      * The time of a reload attempt.
680      * This reload may have been triggered automatically or manually and may
681      * not have succeeded.
682      * </pre>
683      *
684      * <code>.google.protobuf.Timestamp time = 1;</code>
685      *
686      * @return The time.
687      */
688     @java.lang.Override
getTime()689     public com.google.protobuf.Timestamp getTime() {
690       return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
691     }
692     /**
693      *
694      *
695      * <pre>
696      * The time of a reload attempt.
697      * This reload may have been triggered automatically or manually and may
698      * not have succeeded.
699      * </pre>
700      *
701      * <code>.google.protobuf.Timestamp time = 1;</code>
702      */
703     @java.lang.Override
getTimeOrBuilder()704     public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
705       return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
706     }
707 
708     public static final int STATUS_FIELD_NUMBER = 2;
709     private com.google.rpc.Status status_;
710     /**
711      *
712      *
713      * <pre>
714      * The status of a reload attempt or the initial load.
715      * </pre>
716      *
717      * <code>.google.rpc.Status status = 2;</code>
718      *
719      * @return Whether the status field is set.
720      */
721     @java.lang.Override
hasStatus()722     public boolean hasStatus() {
723       return status_ != null;
724     }
725     /**
726      *
727      *
728      * <pre>
729      * The status of a reload attempt or the initial load.
730      * </pre>
731      *
732      * <code>.google.rpc.Status status = 2;</code>
733      *
734      * @return The status.
735      */
736     @java.lang.Override
getStatus()737     public com.google.rpc.Status getStatus() {
738       return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
739     }
740     /**
741      *
742      *
743      * <pre>
744      * The status of a reload attempt or the initial load.
745      * </pre>
746      *
747      * <code>.google.rpc.Status status = 2;</code>
748      */
749     @java.lang.Override
getStatusOrBuilder()750     public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
751       return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
752     }
753 
754     private byte memoizedIsInitialized = -1;
755 
756     @java.lang.Override
isInitialized()757     public final boolean isInitialized() {
758       byte isInitialized = memoizedIsInitialized;
759       if (isInitialized == 1) return true;
760       if (isInitialized == 0) return false;
761 
762       memoizedIsInitialized = 1;
763       return true;
764     }
765 
766     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)767     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
768       if (time_ != null) {
769         output.writeMessage(1, getTime());
770       }
771       if (status_ != null) {
772         output.writeMessage(2, getStatus());
773       }
774       getUnknownFields().writeTo(output);
775     }
776 
777     @java.lang.Override
getSerializedSize()778     public int getSerializedSize() {
779       int size = memoizedSize;
780       if (size != -1) return size;
781 
782       size = 0;
783       if (time_ != null) {
784         size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTime());
785       }
786       if (status_ != null) {
787         size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getStatus());
788       }
789       size += getUnknownFields().getSerializedSize();
790       memoizedSize = size;
791       return size;
792     }
793 
794     @java.lang.Override
equals(final java.lang.Object obj)795     public boolean equals(final java.lang.Object obj) {
796       if (obj == this) {
797         return true;
798       }
799       if (!(obj instanceof com.google.cloud.dialogflow.v2.Document.ReloadStatus)) {
800         return super.equals(obj);
801       }
802       com.google.cloud.dialogflow.v2.Document.ReloadStatus other =
803           (com.google.cloud.dialogflow.v2.Document.ReloadStatus) obj;
804 
805       if (hasTime() != other.hasTime()) return false;
806       if (hasTime()) {
807         if (!getTime().equals(other.getTime())) return false;
808       }
809       if (hasStatus() != other.hasStatus()) return false;
810       if (hasStatus()) {
811         if (!getStatus().equals(other.getStatus())) return false;
812       }
813       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
814       return true;
815     }
816 
817     @java.lang.Override
hashCode()818     public int hashCode() {
819       if (memoizedHashCode != 0) {
820         return memoizedHashCode;
821       }
822       int hash = 41;
823       hash = (19 * hash) + getDescriptor().hashCode();
824       if (hasTime()) {
825         hash = (37 * hash) + TIME_FIELD_NUMBER;
826         hash = (53 * hash) + getTime().hashCode();
827       }
828       if (hasStatus()) {
829         hash = (37 * hash) + STATUS_FIELD_NUMBER;
830         hash = (53 * hash) + getStatus().hashCode();
831       }
832       hash = (29 * hash) + getUnknownFields().hashCode();
833       memoizedHashCode = hash;
834       return hash;
835     }
836 
parseFrom( java.nio.ByteBuffer data)837     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
838         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
839       return PARSER.parseFrom(data);
840     }
841 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)842     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
843         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
844         throws com.google.protobuf.InvalidProtocolBufferException {
845       return PARSER.parseFrom(data, extensionRegistry);
846     }
847 
parseFrom( com.google.protobuf.ByteString data)848     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
849         com.google.protobuf.ByteString data)
850         throws com.google.protobuf.InvalidProtocolBufferException {
851       return PARSER.parseFrom(data);
852     }
853 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)854     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
855         com.google.protobuf.ByteString data,
856         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
857         throws com.google.protobuf.InvalidProtocolBufferException {
858       return PARSER.parseFrom(data, extensionRegistry);
859     }
860 
parseFrom(byte[] data)861     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(byte[] data)
862         throws com.google.protobuf.InvalidProtocolBufferException {
863       return PARSER.parseFrom(data);
864     }
865 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)866     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
867         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
868         throws com.google.protobuf.InvalidProtocolBufferException {
869       return PARSER.parseFrom(data, extensionRegistry);
870     }
871 
parseFrom( java.io.InputStream input)872     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
873         java.io.InputStream input) throws java.io.IOException {
874       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
875     }
876 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)877     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
878         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
879         throws java.io.IOException {
880       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
881           PARSER, input, extensionRegistry);
882     }
883 
parseDelimitedFrom( java.io.InputStream input)884     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseDelimitedFrom(
885         java.io.InputStream input) throws java.io.IOException {
886       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
887     }
888 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)889     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseDelimitedFrom(
890         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
891         throws java.io.IOException {
892       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
893           PARSER, input, extensionRegistry);
894     }
895 
parseFrom( com.google.protobuf.CodedInputStream input)896     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
897         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
898       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
899     }
900 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)901     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus parseFrom(
902         com.google.protobuf.CodedInputStream input,
903         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
904         throws java.io.IOException {
905       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
906           PARSER, input, extensionRegistry);
907     }
908 
909     @java.lang.Override
newBuilderForType()910     public Builder newBuilderForType() {
911       return newBuilder();
912     }
913 
newBuilder()914     public static Builder newBuilder() {
915       return DEFAULT_INSTANCE.toBuilder();
916     }
917 
newBuilder( com.google.cloud.dialogflow.v2.Document.ReloadStatus prototype)918     public static Builder newBuilder(
919         com.google.cloud.dialogflow.v2.Document.ReloadStatus prototype) {
920       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
921     }
922 
923     @java.lang.Override
toBuilder()924     public Builder toBuilder() {
925       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
926     }
927 
928     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)929     protected Builder newBuilderForType(
930         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
931       Builder builder = new Builder(parent);
932       return builder;
933     }
934     /**
935      *
936      *
937      * <pre>
938      * The status of a reload attempt.
939      * </pre>
940      *
941      * Protobuf type {@code google.cloud.dialogflow.v2.Document.ReloadStatus}
942      */
943     public static final class Builder
944         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
945         implements
946         // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.Document.ReloadStatus)
947         com.google.cloud.dialogflow.v2.Document.ReloadStatusOrBuilder {
getDescriptor()948       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
949         return com.google.cloud.dialogflow.v2.DocumentProto
950             .internal_static_google_cloud_dialogflow_v2_Document_ReloadStatus_descriptor;
951       }
952 
953       @java.lang.Override
954       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()955           internalGetFieldAccessorTable() {
956         return com.google.cloud.dialogflow.v2.DocumentProto
957             .internal_static_google_cloud_dialogflow_v2_Document_ReloadStatus_fieldAccessorTable
958             .ensureFieldAccessorsInitialized(
959                 com.google.cloud.dialogflow.v2.Document.ReloadStatus.class,
960                 com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder.class);
961       }
962 
963       // Construct using com.google.cloud.dialogflow.v2.Document.ReloadStatus.newBuilder()
Builder()964       private Builder() {}
965 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)966       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
967         super(parent);
968       }
969 
970       @java.lang.Override
clear()971       public Builder clear() {
972         super.clear();
973         bitField0_ = 0;
974         time_ = null;
975         if (timeBuilder_ != null) {
976           timeBuilder_.dispose();
977           timeBuilder_ = null;
978         }
979         status_ = null;
980         if (statusBuilder_ != null) {
981           statusBuilder_.dispose();
982           statusBuilder_ = null;
983         }
984         return this;
985       }
986 
987       @java.lang.Override
getDescriptorForType()988       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
989         return com.google.cloud.dialogflow.v2.DocumentProto
990             .internal_static_google_cloud_dialogflow_v2_Document_ReloadStatus_descriptor;
991       }
992 
993       @java.lang.Override
getDefaultInstanceForType()994       public com.google.cloud.dialogflow.v2.Document.ReloadStatus getDefaultInstanceForType() {
995         return com.google.cloud.dialogflow.v2.Document.ReloadStatus.getDefaultInstance();
996       }
997 
998       @java.lang.Override
build()999       public com.google.cloud.dialogflow.v2.Document.ReloadStatus build() {
1000         com.google.cloud.dialogflow.v2.Document.ReloadStatus result = buildPartial();
1001         if (!result.isInitialized()) {
1002           throw newUninitializedMessageException(result);
1003         }
1004         return result;
1005       }
1006 
1007       @java.lang.Override
buildPartial()1008       public com.google.cloud.dialogflow.v2.Document.ReloadStatus buildPartial() {
1009         com.google.cloud.dialogflow.v2.Document.ReloadStatus result =
1010             new com.google.cloud.dialogflow.v2.Document.ReloadStatus(this);
1011         if (bitField0_ != 0) {
1012           buildPartial0(result);
1013         }
1014         onBuilt();
1015         return result;
1016       }
1017 
buildPartial0(com.google.cloud.dialogflow.v2.Document.ReloadStatus result)1018       private void buildPartial0(com.google.cloud.dialogflow.v2.Document.ReloadStatus result) {
1019         int from_bitField0_ = bitField0_;
1020         if (((from_bitField0_ & 0x00000001) != 0)) {
1021           result.time_ = timeBuilder_ == null ? time_ : timeBuilder_.build();
1022         }
1023         if (((from_bitField0_ & 0x00000002) != 0)) {
1024           result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build();
1025         }
1026       }
1027 
1028       @java.lang.Override
clone()1029       public Builder clone() {
1030         return super.clone();
1031       }
1032 
1033       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1034       public Builder setField(
1035           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1036         return super.setField(field, value);
1037       }
1038 
1039       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1040       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
1041         return super.clearField(field);
1042       }
1043 
1044       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1045       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1046         return super.clearOneof(oneof);
1047       }
1048 
1049       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1050       public Builder setRepeatedField(
1051           com.google.protobuf.Descriptors.FieldDescriptor field,
1052           int index,
1053           java.lang.Object value) {
1054         return super.setRepeatedField(field, index, value);
1055       }
1056 
1057       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1058       public Builder addRepeatedField(
1059           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1060         return super.addRepeatedField(field, value);
1061       }
1062 
1063       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)1064       public Builder mergeFrom(com.google.protobuf.Message other) {
1065         if (other instanceof com.google.cloud.dialogflow.v2.Document.ReloadStatus) {
1066           return mergeFrom((com.google.cloud.dialogflow.v2.Document.ReloadStatus) other);
1067         } else {
1068           super.mergeFrom(other);
1069           return this;
1070         }
1071       }
1072 
mergeFrom(com.google.cloud.dialogflow.v2.Document.ReloadStatus other)1073       public Builder mergeFrom(com.google.cloud.dialogflow.v2.Document.ReloadStatus other) {
1074         if (other == com.google.cloud.dialogflow.v2.Document.ReloadStatus.getDefaultInstance())
1075           return this;
1076         if (other.hasTime()) {
1077           mergeTime(other.getTime());
1078         }
1079         if (other.hasStatus()) {
1080           mergeStatus(other.getStatus());
1081         }
1082         this.mergeUnknownFields(other.getUnknownFields());
1083         onChanged();
1084         return this;
1085       }
1086 
1087       @java.lang.Override
isInitialized()1088       public final boolean isInitialized() {
1089         return true;
1090       }
1091 
1092       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1093       public Builder mergeFrom(
1094           com.google.protobuf.CodedInputStream input,
1095           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1096           throws java.io.IOException {
1097         if (extensionRegistry == null) {
1098           throw new java.lang.NullPointerException();
1099         }
1100         try {
1101           boolean done = false;
1102           while (!done) {
1103             int tag = input.readTag();
1104             switch (tag) {
1105               case 0:
1106                 done = true;
1107                 break;
1108               case 10:
1109                 {
1110                   input.readMessage(getTimeFieldBuilder().getBuilder(), extensionRegistry);
1111                   bitField0_ |= 0x00000001;
1112                   break;
1113                 } // case 10
1114               case 18:
1115                 {
1116                   input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry);
1117                   bitField0_ |= 0x00000002;
1118                   break;
1119                 } // case 18
1120               default:
1121                 {
1122                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1123                     done = true; // was an endgroup tag
1124                   }
1125                   break;
1126                 } // default:
1127             } // switch (tag)
1128           } // while (!done)
1129         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1130           throw e.unwrapIOException();
1131         } finally {
1132           onChanged();
1133         } // finally
1134         return this;
1135       }
1136 
1137       private int bitField0_;
1138 
1139       private com.google.protobuf.Timestamp time_;
1140       private com.google.protobuf.SingleFieldBuilderV3<
1141               com.google.protobuf.Timestamp,
1142               com.google.protobuf.Timestamp.Builder,
1143               com.google.protobuf.TimestampOrBuilder>
1144           timeBuilder_;
1145       /**
1146        *
1147        *
1148        * <pre>
1149        * The time of a reload attempt.
1150        * This reload may have been triggered automatically or manually and may
1151        * not have succeeded.
1152        * </pre>
1153        *
1154        * <code>.google.protobuf.Timestamp time = 1;</code>
1155        *
1156        * @return Whether the time field is set.
1157        */
hasTime()1158       public boolean hasTime() {
1159         return ((bitField0_ & 0x00000001) != 0);
1160       }
1161       /**
1162        *
1163        *
1164        * <pre>
1165        * The time of a reload attempt.
1166        * This reload may have been triggered automatically or manually and may
1167        * not have succeeded.
1168        * </pre>
1169        *
1170        * <code>.google.protobuf.Timestamp time = 1;</code>
1171        *
1172        * @return The time.
1173        */
getTime()1174       public com.google.protobuf.Timestamp getTime() {
1175         if (timeBuilder_ == null) {
1176           return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
1177         } else {
1178           return timeBuilder_.getMessage();
1179         }
1180       }
1181       /**
1182        *
1183        *
1184        * <pre>
1185        * The time of a reload attempt.
1186        * This reload may have been triggered automatically or manually and may
1187        * not have succeeded.
1188        * </pre>
1189        *
1190        * <code>.google.protobuf.Timestamp time = 1;</code>
1191        */
setTime(com.google.protobuf.Timestamp value)1192       public Builder setTime(com.google.protobuf.Timestamp value) {
1193         if (timeBuilder_ == null) {
1194           if (value == null) {
1195             throw new NullPointerException();
1196           }
1197           time_ = value;
1198         } else {
1199           timeBuilder_.setMessage(value);
1200         }
1201         bitField0_ |= 0x00000001;
1202         onChanged();
1203         return this;
1204       }
1205       /**
1206        *
1207        *
1208        * <pre>
1209        * The time of a reload attempt.
1210        * This reload may have been triggered automatically or manually and may
1211        * not have succeeded.
1212        * </pre>
1213        *
1214        * <code>.google.protobuf.Timestamp time = 1;</code>
1215        */
setTime(com.google.protobuf.Timestamp.Builder builderForValue)1216       public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) {
1217         if (timeBuilder_ == null) {
1218           time_ = builderForValue.build();
1219         } else {
1220           timeBuilder_.setMessage(builderForValue.build());
1221         }
1222         bitField0_ |= 0x00000001;
1223         onChanged();
1224         return this;
1225       }
1226       /**
1227        *
1228        *
1229        * <pre>
1230        * The time of a reload attempt.
1231        * This reload may have been triggered automatically or manually and may
1232        * not have succeeded.
1233        * </pre>
1234        *
1235        * <code>.google.protobuf.Timestamp time = 1;</code>
1236        */
mergeTime(com.google.protobuf.Timestamp value)1237       public Builder mergeTime(com.google.protobuf.Timestamp value) {
1238         if (timeBuilder_ == null) {
1239           if (((bitField0_ & 0x00000001) != 0)
1240               && time_ != null
1241               && time_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
1242             getTimeBuilder().mergeFrom(value);
1243           } else {
1244             time_ = value;
1245           }
1246         } else {
1247           timeBuilder_.mergeFrom(value);
1248         }
1249         bitField0_ |= 0x00000001;
1250         onChanged();
1251         return this;
1252       }
1253       /**
1254        *
1255        *
1256        * <pre>
1257        * The time of a reload attempt.
1258        * This reload may have been triggered automatically or manually and may
1259        * not have succeeded.
1260        * </pre>
1261        *
1262        * <code>.google.protobuf.Timestamp time = 1;</code>
1263        */
clearTime()1264       public Builder clearTime() {
1265         bitField0_ = (bitField0_ & ~0x00000001);
1266         time_ = null;
1267         if (timeBuilder_ != null) {
1268           timeBuilder_.dispose();
1269           timeBuilder_ = null;
1270         }
1271         onChanged();
1272         return this;
1273       }
1274       /**
1275        *
1276        *
1277        * <pre>
1278        * The time of a reload attempt.
1279        * This reload may have been triggered automatically or manually and may
1280        * not have succeeded.
1281        * </pre>
1282        *
1283        * <code>.google.protobuf.Timestamp time = 1;</code>
1284        */
getTimeBuilder()1285       public com.google.protobuf.Timestamp.Builder getTimeBuilder() {
1286         bitField0_ |= 0x00000001;
1287         onChanged();
1288         return getTimeFieldBuilder().getBuilder();
1289       }
1290       /**
1291        *
1292        *
1293        * <pre>
1294        * The time of a reload attempt.
1295        * This reload may have been triggered automatically or manually and may
1296        * not have succeeded.
1297        * </pre>
1298        *
1299        * <code>.google.protobuf.Timestamp time = 1;</code>
1300        */
getTimeOrBuilder()1301       public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
1302         if (timeBuilder_ != null) {
1303           return timeBuilder_.getMessageOrBuilder();
1304         } else {
1305           return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
1306         }
1307       }
1308       /**
1309        *
1310        *
1311        * <pre>
1312        * The time of a reload attempt.
1313        * This reload may have been triggered automatically or manually and may
1314        * not have succeeded.
1315        * </pre>
1316        *
1317        * <code>.google.protobuf.Timestamp time = 1;</code>
1318        */
1319       private com.google.protobuf.SingleFieldBuilderV3<
1320               com.google.protobuf.Timestamp,
1321               com.google.protobuf.Timestamp.Builder,
1322               com.google.protobuf.TimestampOrBuilder>
getTimeFieldBuilder()1323           getTimeFieldBuilder() {
1324         if (timeBuilder_ == null) {
1325           timeBuilder_ =
1326               new com.google.protobuf.SingleFieldBuilderV3<
1327                   com.google.protobuf.Timestamp,
1328                   com.google.protobuf.Timestamp.Builder,
1329                   com.google.protobuf.TimestampOrBuilder>(
1330                   getTime(), getParentForChildren(), isClean());
1331           time_ = null;
1332         }
1333         return timeBuilder_;
1334       }
1335 
1336       private com.google.rpc.Status status_;
1337       private com.google.protobuf.SingleFieldBuilderV3<
1338               com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
1339           statusBuilder_;
1340       /**
1341        *
1342        *
1343        * <pre>
1344        * The status of a reload attempt or the initial load.
1345        * </pre>
1346        *
1347        * <code>.google.rpc.Status status = 2;</code>
1348        *
1349        * @return Whether the status field is set.
1350        */
hasStatus()1351       public boolean hasStatus() {
1352         return ((bitField0_ & 0x00000002) != 0);
1353       }
1354       /**
1355        *
1356        *
1357        * <pre>
1358        * The status of a reload attempt or the initial load.
1359        * </pre>
1360        *
1361        * <code>.google.rpc.Status status = 2;</code>
1362        *
1363        * @return The status.
1364        */
getStatus()1365       public com.google.rpc.Status getStatus() {
1366         if (statusBuilder_ == null) {
1367           return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
1368         } else {
1369           return statusBuilder_.getMessage();
1370         }
1371       }
1372       /**
1373        *
1374        *
1375        * <pre>
1376        * The status of a reload attempt or the initial load.
1377        * </pre>
1378        *
1379        * <code>.google.rpc.Status status = 2;</code>
1380        */
setStatus(com.google.rpc.Status value)1381       public Builder setStatus(com.google.rpc.Status value) {
1382         if (statusBuilder_ == null) {
1383           if (value == null) {
1384             throw new NullPointerException();
1385           }
1386           status_ = value;
1387         } else {
1388           statusBuilder_.setMessage(value);
1389         }
1390         bitField0_ |= 0x00000002;
1391         onChanged();
1392         return this;
1393       }
1394       /**
1395        *
1396        *
1397        * <pre>
1398        * The status of a reload attempt or the initial load.
1399        * </pre>
1400        *
1401        * <code>.google.rpc.Status status = 2;</code>
1402        */
setStatus(com.google.rpc.Status.Builder builderForValue)1403       public Builder setStatus(com.google.rpc.Status.Builder builderForValue) {
1404         if (statusBuilder_ == null) {
1405           status_ = builderForValue.build();
1406         } else {
1407           statusBuilder_.setMessage(builderForValue.build());
1408         }
1409         bitField0_ |= 0x00000002;
1410         onChanged();
1411         return this;
1412       }
1413       /**
1414        *
1415        *
1416        * <pre>
1417        * The status of a reload attempt or the initial load.
1418        * </pre>
1419        *
1420        * <code>.google.rpc.Status status = 2;</code>
1421        */
mergeStatus(com.google.rpc.Status value)1422       public Builder mergeStatus(com.google.rpc.Status value) {
1423         if (statusBuilder_ == null) {
1424           if (((bitField0_ & 0x00000002) != 0)
1425               && status_ != null
1426               && status_ != com.google.rpc.Status.getDefaultInstance()) {
1427             getStatusBuilder().mergeFrom(value);
1428           } else {
1429             status_ = value;
1430           }
1431         } else {
1432           statusBuilder_.mergeFrom(value);
1433         }
1434         bitField0_ |= 0x00000002;
1435         onChanged();
1436         return this;
1437       }
1438       /**
1439        *
1440        *
1441        * <pre>
1442        * The status of a reload attempt or the initial load.
1443        * </pre>
1444        *
1445        * <code>.google.rpc.Status status = 2;</code>
1446        */
clearStatus()1447       public Builder clearStatus() {
1448         bitField0_ = (bitField0_ & ~0x00000002);
1449         status_ = null;
1450         if (statusBuilder_ != null) {
1451           statusBuilder_.dispose();
1452           statusBuilder_ = null;
1453         }
1454         onChanged();
1455         return this;
1456       }
1457       /**
1458        *
1459        *
1460        * <pre>
1461        * The status of a reload attempt or the initial load.
1462        * </pre>
1463        *
1464        * <code>.google.rpc.Status status = 2;</code>
1465        */
getStatusBuilder()1466       public com.google.rpc.Status.Builder getStatusBuilder() {
1467         bitField0_ |= 0x00000002;
1468         onChanged();
1469         return getStatusFieldBuilder().getBuilder();
1470       }
1471       /**
1472        *
1473        *
1474        * <pre>
1475        * The status of a reload attempt or the initial load.
1476        * </pre>
1477        *
1478        * <code>.google.rpc.Status status = 2;</code>
1479        */
getStatusOrBuilder()1480       public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
1481         if (statusBuilder_ != null) {
1482           return statusBuilder_.getMessageOrBuilder();
1483         } else {
1484           return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
1485         }
1486       }
1487       /**
1488        *
1489        *
1490        * <pre>
1491        * The status of a reload attempt or the initial load.
1492        * </pre>
1493        *
1494        * <code>.google.rpc.Status status = 2;</code>
1495        */
1496       private com.google.protobuf.SingleFieldBuilderV3<
1497               com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
getStatusFieldBuilder()1498           getStatusFieldBuilder() {
1499         if (statusBuilder_ == null) {
1500           statusBuilder_ =
1501               new com.google.protobuf.SingleFieldBuilderV3<
1502                   com.google.rpc.Status,
1503                   com.google.rpc.Status.Builder,
1504                   com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean());
1505           status_ = null;
1506         }
1507         return statusBuilder_;
1508       }
1509 
1510       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1511       public final Builder setUnknownFields(
1512           final com.google.protobuf.UnknownFieldSet unknownFields) {
1513         return super.setUnknownFields(unknownFields);
1514       }
1515 
1516       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1517       public final Builder mergeUnknownFields(
1518           final com.google.protobuf.UnknownFieldSet unknownFields) {
1519         return super.mergeUnknownFields(unknownFields);
1520       }
1521 
1522       // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.Document.ReloadStatus)
1523     }
1524 
1525     // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Document.ReloadStatus)
1526     private static final com.google.cloud.dialogflow.v2.Document.ReloadStatus DEFAULT_INSTANCE;
1527 
1528     static {
1529       DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.Document.ReloadStatus();
1530     }
1531 
getDefaultInstance()1532     public static com.google.cloud.dialogflow.v2.Document.ReloadStatus getDefaultInstance() {
1533       return DEFAULT_INSTANCE;
1534     }
1535 
1536     private static final com.google.protobuf.Parser<ReloadStatus> PARSER =
1537         new com.google.protobuf.AbstractParser<ReloadStatus>() {
1538           @java.lang.Override
1539           public ReloadStatus parsePartialFrom(
1540               com.google.protobuf.CodedInputStream input,
1541               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1542               throws com.google.protobuf.InvalidProtocolBufferException {
1543             Builder builder = newBuilder();
1544             try {
1545               builder.mergeFrom(input, extensionRegistry);
1546             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1547               throw e.setUnfinishedMessage(builder.buildPartial());
1548             } catch (com.google.protobuf.UninitializedMessageException e) {
1549               throw e.asInvalidProtocolBufferException()
1550                   .setUnfinishedMessage(builder.buildPartial());
1551             } catch (java.io.IOException e) {
1552               throw new com.google.protobuf.InvalidProtocolBufferException(e)
1553                   .setUnfinishedMessage(builder.buildPartial());
1554             }
1555             return builder.buildPartial();
1556           }
1557         };
1558 
parser()1559     public static com.google.protobuf.Parser<ReloadStatus> parser() {
1560       return PARSER;
1561     }
1562 
1563     @java.lang.Override
getParserForType()1564     public com.google.protobuf.Parser<ReloadStatus> getParserForType() {
1565       return PARSER;
1566     }
1567 
1568     @java.lang.Override
getDefaultInstanceForType()1569     public com.google.cloud.dialogflow.v2.Document.ReloadStatus getDefaultInstanceForType() {
1570       return DEFAULT_INSTANCE;
1571     }
1572   }
1573 
1574   private int sourceCase_ = 0;
1575   private java.lang.Object source_;
1576 
1577   public enum SourceCase
1578       implements
1579           com.google.protobuf.Internal.EnumLite,
1580           com.google.protobuf.AbstractMessage.InternalOneOfEnum {
1581     CONTENT_URI(5),
1582     RAW_CONTENT(9),
1583     SOURCE_NOT_SET(0);
1584     private final int value;
1585 
SourceCase(int value)1586     private SourceCase(int value) {
1587       this.value = value;
1588     }
1589     /**
1590      * @param value The number of the enum to look for.
1591      * @return The enum associated with the given number.
1592      * @deprecated Use {@link #forNumber(int)} instead.
1593      */
1594     @java.lang.Deprecated
valueOf(int value)1595     public static SourceCase valueOf(int value) {
1596       return forNumber(value);
1597     }
1598 
forNumber(int value)1599     public static SourceCase forNumber(int value) {
1600       switch (value) {
1601         case 5:
1602           return CONTENT_URI;
1603         case 9:
1604           return RAW_CONTENT;
1605         case 0:
1606           return SOURCE_NOT_SET;
1607         default:
1608           return null;
1609       }
1610     }
1611 
getNumber()1612     public int getNumber() {
1613       return this.value;
1614     }
1615   };
1616 
getSourceCase()1617   public SourceCase getSourceCase() {
1618     return SourceCase.forNumber(sourceCase_);
1619   }
1620 
1621   public static final int NAME_FIELD_NUMBER = 1;
1622 
1623   @SuppressWarnings("serial")
1624   private volatile java.lang.Object name_ = "";
1625   /**
1626    *
1627    *
1628    * <pre>
1629    * Optional. The document resource name.
1630    * The name must be empty when creating a document.
1631    * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
1632    * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
1633    * </pre>
1634    *
1635    * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
1636    *
1637    * @return The name.
1638    */
1639   @java.lang.Override
getName()1640   public java.lang.String getName() {
1641     java.lang.Object ref = name_;
1642     if (ref instanceof java.lang.String) {
1643       return (java.lang.String) ref;
1644     } else {
1645       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1646       java.lang.String s = bs.toStringUtf8();
1647       name_ = s;
1648       return s;
1649     }
1650   }
1651   /**
1652    *
1653    *
1654    * <pre>
1655    * Optional. The document resource name.
1656    * The name must be empty when creating a document.
1657    * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
1658    * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
1659    * </pre>
1660    *
1661    * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
1662    *
1663    * @return The bytes for name.
1664    */
1665   @java.lang.Override
getNameBytes()1666   public com.google.protobuf.ByteString getNameBytes() {
1667     java.lang.Object ref = name_;
1668     if (ref instanceof java.lang.String) {
1669       com.google.protobuf.ByteString b =
1670           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1671       name_ = b;
1672       return b;
1673     } else {
1674       return (com.google.protobuf.ByteString) ref;
1675     }
1676   }
1677 
1678   public static final int DISPLAY_NAME_FIELD_NUMBER = 2;
1679 
1680   @SuppressWarnings("serial")
1681   private volatile java.lang.Object displayName_ = "";
1682   /**
1683    *
1684    *
1685    * <pre>
1686    * Required. The display name of the document. The name must be 1024 bytes or
1687    * less; otherwise, the creation request fails.
1688    * </pre>
1689    *
1690    * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1691    *
1692    * @return The displayName.
1693    */
1694   @java.lang.Override
getDisplayName()1695   public java.lang.String getDisplayName() {
1696     java.lang.Object ref = displayName_;
1697     if (ref instanceof java.lang.String) {
1698       return (java.lang.String) ref;
1699     } else {
1700       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1701       java.lang.String s = bs.toStringUtf8();
1702       displayName_ = s;
1703       return s;
1704     }
1705   }
1706   /**
1707    *
1708    *
1709    * <pre>
1710    * Required. The display name of the document. The name must be 1024 bytes or
1711    * less; otherwise, the creation request fails.
1712    * </pre>
1713    *
1714    * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
1715    *
1716    * @return The bytes for displayName.
1717    */
1718   @java.lang.Override
getDisplayNameBytes()1719   public com.google.protobuf.ByteString getDisplayNameBytes() {
1720     java.lang.Object ref = displayName_;
1721     if (ref instanceof java.lang.String) {
1722       com.google.protobuf.ByteString b =
1723           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1724       displayName_ = b;
1725       return b;
1726     } else {
1727       return (com.google.protobuf.ByteString) ref;
1728     }
1729   }
1730 
1731   public static final int MIME_TYPE_FIELD_NUMBER = 3;
1732 
1733   @SuppressWarnings("serial")
1734   private volatile java.lang.Object mimeType_ = "";
1735   /**
1736    *
1737    *
1738    * <pre>
1739    * Required. The MIME type of this document.
1740    * </pre>
1741    *
1742    * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
1743    *
1744    * @return The mimeType.
1745    */
1746   @java.lang.Override
getMimeType()1747   public java.lang.String getMimeType() {
1748     java.lang.Object ref = mimeType_;
1749     if (ref instanceof java.lang.String) {
1750       return (java.lang.String) ref;
1751     } else {
1752       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1753       java.lang.String s = bs.toStringUtf8();
1754       mimeType_ = s;
1755       return s;
1756     }
1757   }
1758   /**
1759    *
1760    *
1761    * <pre>
1762    * Required. The MIME type of this document.
1763    * </pre>
1764    *
1765    * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
1766    *
1767    * @return The bytes for mimeType.
1768    */
1769   @java.lang.Override
getMimeTypeBytes()1770   public com.google.protobuf.ByteString getMimeTypeBytes() {
1771     java.lang.Object ref = mimeType_;
1772     if (ref instanceof java.lang.String) {
1773       com.google.protobuf.ByteString b =
1774           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1775       mimeType_ = b;
1776       return b;
1777     } else {
1778       return (com.google.protobuf.ByteString) ref;
1779     }
1780   }
1781 
1782   public static final int KNOWLEDGE_TYPES_FIELD_NUMBER = 4;
1783 
1784   @SuppressWarnings("serial")
1785   private java.util.List<java.lang.Integer> knowledgeTypes_;
1786 
1787   private static final com.google.protobuf.Internal.ListAdapter.Converter<
1788           java.lang.Integer, com.google.cloud.dialogflow.v2.Document.KnowledgeType>
1789       knowledgeTypes_converter_ =
1790           new com.google.protobuf.Internal.ListAdapter.Converter<
1791               java.lang.Integer, com.google.cloud.dialogflow.v2.Document.KnowledgeType>() {
1792             public com.google.cloud.dialogflow.v2.Document.KnowledgeType convert(
1793                 java.lang.Integer from) {
1794               com.google.cloud.dialogflow.v2.Document.KnowledgeType result =
1795                   com.google.cloud.dialogflow.v2.Document.KnowledgeType.forNumber(from);
1796               return result == null
1797                   ? com.google.cloud.dialogflow.v2.Document.KnowledgeType.UNRECOGNIZED
1798                   : result;
1799             }
1800           };
1801   /**
1802    *
1803    *
1804    * <pre>
1805    * Required. The knowledge type of document content.
1806    * </pre>
1807    *
1808    * <code>
1809    * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
1810    * </code>
1811    *
1812    * @return A list containing the knowledgeTypes.
1813    */
1814   @java.lang.Override
1815   public java.util.List<com.google.cloud.dialogflow.v2.Document.KnowledgeType>
getKnowledgeTypesList()1816       getKnowledgeTypesList() {
1817     return new com.google.protobuf.Internal.ListAdapter<
1818         java.lang.Integer, com.google.cloud.dialogflow.v2.Document.KnowledgeType>(
1819         knowledgeTypes_, knowledgeTypes_converter_);
1820   }
1821   /**
1822    *
1823    *
1824    * <pre>
1825    * Required. The knowledge type of document content.
1826    * </pre>
1827    *
1828    * <code>
1829    * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
1830    * </code>
1831    *
1832    * @return The count of knowledgeTypes.
1833    */
1834   @java.lang.Override
getKnowledgeTypesCount()1835   public int getKnowledgeTypesCount() {
1836     return knowledgeTypes_.size();
1837   }
1838   /**
1839    *
1840    *
1841    * <pre>
1842    * Required. The knowledge type of document content.
1843    * </pre>
1844    *
1845    * <code>
1846    * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
1847    * </code>
1848    *
1849    * @param index The index of the element to return.
1850    * @return The knowledgeTypes at the given index.
1851    */
1852   @java.lang.Override
getKnowledgeTypes(int index)1853   public com.google.cloud.dialogflow.v2.Document.KnowledgeType getKnowledgeTypes(int index) {
1854     return knowledgeTypes_converter_.convert(knowledgeTypes_.get(index));
1855   }
1856   /**
1857    *
1858    *
1859    * <pre>
1860    * Required. The knowledge type of document content.
1861    * </pre>
1862    *
1863    * <code>
1864    * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
1865    * </code>
1866    *
1867    * @return A list containing the enum numeric values on the wire for knowledgeTypes.
1868    */
1869   @java.lang.Override
getKnowledgeTypesValueList()1870   public java.util.List<java.lang.Integer> getKnowledgeTypesValueList() {
1871     return knowledgeTypes_;
1872   }
1873   /**
1874    *
1875    *
1876    * <pre>
1877    * Required. The knowledge type of document content.
1878    * </pre>
1879    *
1880    * <code>
1881    * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
1882    * </code>
1883    *
1884    * @param index The index of the value to return.
1885    * @return The enum numeric value on the wire of knowledgeTypes at the given index.
1886    */
1887   @java.lang.Override
getKnowledgeTypesValue(int index)1888   public int getKnowledgeTypesValue(int index) {
1889     return knowledgeTypes_.get(index);
1890   }
1891 
1892   private int knowledgeTypesMemoizedSerializedSize;
1893 
1894   public static final int CONTENT_URI_FIELD_NUMBER = 5;
1895   /**
1896    *
1897    *
1898    * <pre>
1899    * The URI where the file content is located.
1900    * For documents stored in Google Cloud Storage, these URIs must have
1901    * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
1902    * NOTE: External URLs must correspond to public webpages, i.e., they must
1903    * be indexed by Google Search. In particular, URLs for showing documents in
1904    * Google Cloud Storage (i.e. the URL in your browser) are not supported.
1905    * Instead use the `gs://` format URI described above.
1906    * </pre>
1907    *
1908    * <code>string content_uri = 5;</code>
1909    *
1910    * @return Whether the contentUri field is set.
1911    */
hasContentUri()1912   public boolean hasContentUri() {
1913     return sourceCase_ == 5;
1914   }
1915   /**
1916    *
1917    *
1918    * <pre>
1919    * The URI where the file content is located.
1920    * For documents stored in Google Cloud Storage, these URIs must have
1921    * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
1922    * NOTE: External URLs must correspond to public webpages, i.e., they must
1923    * be indexed by Google Search. In particular, URLs for showing documents in
1924    * Google Cloud Storage (i.e. the URL in your browser) are not supported.
1925    * Instead use the `gs://` format URI described above.
1926    * </pre>
1927    *
1928    * <code>string content_uri = 5;</code>
1929    *
1930    * @return The contentUri.
1931    */
getContentUri()1932   public java.lang.String getContentUri() {
1933     java.lang.Object ref = "";
1934     if (sourceCase_ == 5) {
1935       ref = source_;
1936     }
1937     if (ref instanceof java.lang.String) {
1938       return (java.lang.String) ref;
1939     } else {
1940       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1941       java.lang.String s = bs.toStringUtf8();
1942       if (sourceCase_ == 5) {
1943         source_ = s;
1944       }
1945       return s;
1946     }
1947   }
1948   /**
1949    *
1950    *
1951    * <pre>
1952    * The URI where the file content is located.
1953    * For documents stored in Google Cloud Storage, these URIs must have
1954    * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
1955    * NOTE: External URLs must correspond to public webpages, i.e., they must
1956    * be indexed by Google Search. In particular, URLs for showing documents in
1957    * Google Cloud Storage (i.e. the URL in your browser) are not supported.
1958    * Instead use the `gs://` format URI described above.
1959    * </pre>
1960    *
1961    * <code>string content_uri = 5;</code>
1962    *
1963    * @return The bytes for contentUri.
1964    */
getContentUriBytes()1965   public com.google.protobuf.ByteString getContentUriBytes() {
1966     java.lang.Object ref = "";
1967     if (sourceCase_ == 5) {
1968       ref = source_;
1969     }
1970     if (ref instanceof java.lang.String) {
1971       com.google.protobuf.ByteString b =
1972           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1973       if (sourceCase_ == 5) {
1974         source_ = b;
1975       }
1976       return b;
1977     } else {
1978       return (com.google.protobuf.ByteString) ref;
1979     }
1980   }
1981 
1982   public static final int RAW_CONTENT_FIELD_NUMBER = 9;
1983   /**
1984    *
1985    *
1986    * <pre>
1987    * The raw content of the document. This field is only permitted for
1988    * EXTRACTIVE_QA and FAQ knowledge types.
1989    * </pre>
1990    *
1991    * <code>bytes raw_content = 9;</code>
1992    *
1993    * @return Whether the rawContent field is set.
1994    */
1995   @java.lang.Override
hasRawContent()1996   public boolean hasRawContent() {
1997     return sourceCase_ == 9;
1998   }
1999   /**
2000    *
2001    *
2002    * <pre>
2003    * The raw content of the document. This field is only permitted for
2004    * EXTRACTIVE_QA and FAQ knowledge types.
2005    * </pre>
2006    *
2007    * <code>bytes raw_content = 9;</code>
2008    *
2009    * @return The rawContent.
2010    */
2011   @java.lang.Override
getRawContent()2012   public com.google.protobuf.ByteString getRawContent() {
2013     if (sourceCase_ == 9) {
2014       return (com.google.protobuf.ByteString) source_;
2015     }
2016     return com.google.protobuf.ByteString.EMPTY;
2017   }
2018 
2019   public static final int ENABLE_AUTO_RELOAD_FIELD_NUMBER = 11;
2020   private boolean enableAutoReload_ = false;
2021   /**
2022    *
2023    *
2024    * <pre>
2025    * Optional. If true, we try to automatically reload the document every day
2026    * (at a time picked by the system). If false or unspecified, we don't try
2027    * to automatically reload the document.
2028    * Currently you can only enable automatic reload for documents sourced from
2029    * a public url, see `source` field for the source types.
2030    * Reload status can be tracked in `latest_reload_status`. If a reload
2031    * fails, we will keep the document unchanged.
2032    * If a reload fails with internal errors, the system will try to reload the
2033    * document on the next day.
2034    * If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the
2035    * system will not try to reload the document anymore. You need to manually
2036    * reload the document successfully by calling `ReloadDocument` and clear the
2037    * errors.
2038    * </pre>
2039    *
2040    * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
2041    *
2042    * @return The enableAutoReload.
2043    */
2044   @java.lang.Override
getEnableAutoReload()2045   public boolean getEnableAutoReload() {
2046     return enableAutoReload_;
2047   }
2048 
2049   public static final int LATEST_RELOAD_STATUS_FIELD_NUMBER = 12;
2050   private com.google.cloud.dialogflow.v2.Document.ReloadStatus latestReloadStatus_;
2051   /**
2052    *
2053    *
2054    * <pre>
2055    * Output only. The time and status of the latest reload.
2056    * This reload may have been triggered automatically or manually
2057    * and may not have succeeded.
2058    * </pre>
2059    *
2060    * <code>
2061    * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
2062    * </code>
2063    *
2064    * @return Whether the latestReloadStatus field is set.
2065    */
2066   @java.lang.Override
hasLatestReloadStatus()2067   public boolean hasLatestReloadStatus() {
2068     return latestReloadStatus_ != null;
2069   }
2070   /**
2071    *
2072    *
2073    * <pre>
2074    * Output only. The time and status of the latest reload.
2075    * This reload may have been triggered automatically or manually
2076    * and may not have succeeded.
2077    * </pre>
2078    *
2079    * <code>
2080    * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
2081    * </code>
2082    *
2083    * @return The latestReloadStatus.
2084    */
2085   @java.lang.Override
getLatestReloadStatus()2086   public com.google.cloud.dialogflow.v2.Document.ReloadStatus getLatestReloadStatus() {
2087     return latestReloadStatus_ == null
2088         ? com.google.cloud.dialogflow.v2.Document.ReloadStatus.getDefaultInstance()
2089         : latestReloadStatus_;
2090   }
2091   /**
2092    *
2093    *
2094    * <pre>
2095    * Output only. The time and status of the latest reload.
2096    * This reload may have been triggered automatically or manually
2097    * and may not have succeeded.
2098    * </pre>
2099    *
2100    * <code>
2101    * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
2102    * </code>
2103    */
2104   @java.lang.Override
2105   public com.google.cloud.dialogflow.v2.Document.ReloadStatusOrBuilder
getLatestReloadStatusOrBuilder()2106       getLatestReloadStatusOrBuilder() {
2107     return latestReloadStatus_ == null
2108         ? com.google.cloud.dialogflow.v2.Document.ReloadStatus.getDefaultInstance()
2109         : latestReloadStatus_;
2110   }
2111 
2112   public static final int METADATA_FIELD_NUMBER = 7;
2113 
2114   private static final class MetadataDefaultEntryHolder {
2115     static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
2116         com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
2117             com.google.cloud.dialogflow.v2.DocumentProto
2118                 .internal_static_google_cloud_dialogflow_v2_Document_MetadataEntry_descriptor,
2119             com.google.protobuf.WireFormat.FieldType.STRING,
2120             "",
2121             com.google.protobuf.WireFormat.FieldType.STRING,
2122             "");
2123   }
2124 
2125   @SuppressWarnings("serial")
2126   private com.google.protobuf.MapField<java.lang.String, java.lang.String> metadata_;
2127 
internalGetMetadata()2128   private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
2129     if (metadata_ == null) {
2130       return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
2131     }
2132     return metadata_;
2133   }
2134 
getMetadataCount()2135   public int getMetadataCount() {
2136     return internalGetMetadata().getMap().size();
2137   }
2138   /**
2139    *
2140    *
2141    * <pre>
2142    * Optional. Metadata for the document. The metadata supports arbitrary
2143    * key-value pairs. Suggested use cases include storing a document's title,
2144    * an external URL distinct from the document's content_uri, etc.
2145    * The max size of a `key` or a `value` of the metadata is 1024 bytes.
2146    * </pre>
2147    *
2148    * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
2149    */
2150   @java.lang.Override
containsMetadata(java.lang.String key)2151   public boolean containsMetadata(java.lang.String key) {
2152     if (key == null) {
2153       throw new NullPointerException("map key");
2154     }
2155     return internalGetMetadata().getMap().containsKey(key);
2156   }
2157   /** Use {@link #getMetadataMap()} instead. */
2158   @java.lang.Override
2159   @java.lang.Deprecated
getMetadata()2160   public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
2161     return getMetadataMap();
2162   }
2163   /**
2164    *
2165    *
2166    * <pre>
2167    * Optional. Metadata for the document. The metadata supports arbitrary
2168    * key-value pairs. Suggested use cases include storing a document's title,
2169    * an external URL distinct from the document's content_uri, etc.
2170    * The max size of a `key` or a `value` of the metadata is 1024 bytes.
2171    * </pre>
2172    *
2173    * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
2174    */
2175   @java.lang.Override
getMetadataMap()2176   public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
2177     return internalGetMetadata().getMap();
2178   }
2179   /**
2180    *
2181    *
2182    * <pre>
2183    * Optional. Metadata for the document. The metadata supports arbitrary
2184    * key-value pairs. Suggested use cases include storing a document's title,
2185    * an external URL distinct from the document's content_uri, etc.
2186    * The max size of a `key` or a `value` of the metadata is 1024 bytes.
2187    * </pre>
2188    *
2189    * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
2190    */
2191   @java.lang.Override
getMetadataOrDefault( java.lang.String key, java.lang.String defaultValue)2192   public /* nullable */ java.lang.String getMetadataOrDefault(
2193       java.lang.String key,
2194       /* nullable */
2195       java.lang.String defaultValue) {
2196     if (key == null) {
2197       throw new NullPointerException("map key");
2198     }
2199     java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
2200     return map.containsKey(key) ? map.get(key) : defaultValue;
2201   }
2202   /**
2203    *
2204    *
2205    * <pre>
2206    * Optional. Metadata for the document. The metadata supports arbitrary
2207    * key-value pairs. Suggested use cases include storing a document's title,
2208    * an external URL distinct from the document's content_uri, etc.
2209    * The max size of a `key` or a `value` of the metadata is 1024 bytes.
2210    * </pre>
2211    *
2212    * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
2213    */
2214   @java.lang.Override
getMetadataOrThrow(java.lang.String key)2215   public java.lang.String getMetadataOrThrow(java.lang.String key) {
2216     if (key == null) {
2217       throw new NullPointerException("map key");
2218     }
2219     java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
2220     if (!map.containsKey(key)) {
2221       throw new java.lang.IllegalArgumentException();
2222     }
2223     return map.get(key);
2224   }
2225 
2226   public static final int STATE_FIELD_NUMBER = 13;
2227   private int state_ = 0;
2228   /**
2229    *
2230    *
2231    * <pre>
2232    * Output only. The current state of the document.
2233    * </pre>
2234    *
2235    * <code>
2236    * .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
2237    * </code>
2238    *
2239    * @return The enum numeric value on the wire for state.
2240    */
2241   @java.lang.Override
getStateValue()2242   public int getStateValue() {
2243     return state_;
2244   }
2245   /**
2246    *
2247    *
2248    * <pre>
2249    * Output only. The current state of the document.
2250    * </pre>
2251    *
2252    * <code>
2253    * .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
2254    * </code>
2255    *
2256    * @return The state.
2257    */
2258   @java.lang.Override
getState()2259   public com.google.cloud.dialogflow.v2.Document.State getState() {
2260     com.google.cloud.dialogflow.v2.Document.State result =
2261         com.google.cloud.dialogflow.v2.Document.State.forNumber(state_);
2262     return result == null ? com.google.cloud.dialogflow.v2.Document.State.UNRECOGNIZED : result;
2263   }
2264 
2265   private byte memoizedIsInitialized = -1;
2266 
2267   @java.lang.Override
isInitialized()2268   public final boolean isInitialized() {
2269     byte isInitialized = memoizedIsInitialized;
2270     if (isInitialized == 1) return true;
2271     if (isInitialized == 0) return false;
2272 
2273     memoizedIsInitialized = 1;
2274     return true;
2275   }
2276 
2277   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)2278   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
2279     getSerializedSize();
2280     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
2281       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
2282     }
2283     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
2284       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_);
2285     }
2286     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) {
2287       com.google.protobuf.GeneratedMessageV3.writeString(output, 3, mimeType_);
2288     }
2289     if (getKnowledgeTypesList().size() > 0) {
2290       output.writeUInt32NoTag(34);
2291       output.writeUInt32NoTag(knowledgeTypesMemoizedSerializedSize);
2292     }
2293     for (int i = 0; i < knowledgeTypes_.size(); i++) {
2294       output.writeEnumNoTag(knowledgeTypes_.get(i));
2295     }
2296     if (sourceCase_ == 5) {
2297       com.google.protobuf.GeneratedMessageV3.writeString(output, 5, source_);
2298     }
2299     com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
2300         output, internalGetMetadata(), MetadataDefaultEntryHolder.defaultEntry, 7);
2301     if (sourceCase_ == 9) {
2302       output.writeBytes(9, (com.google.protobuf.ByteString) source_);
2303     }
2304     if (enableAutoReload_ != false) {
2305       output.writeBool(11, enableAutoReload_);
2306     }
2307     if (latestReloadStatus_ != null) {
2308       output.writeMessage(12, getLatestReloadStatus());
2309     }
2310     if (state_ != com.google.cloud.dialogflow.v2.Document.State.STATE_UNSPECIFIED.getNumber()) {
2311       output.writeEnum(13, state_);
2312     }
2313     getUnknownFields().writeTo(output);
2314   }
2315 
2316   @java.lang.Override
getSerializedSize()2317   public int getSerializedSize() {
2318     int size = memoizedSize;
2319     if (size != -1) return size;
2320 
2321     size = 0;
2322     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
2323       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
2324     }
2325     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
2326       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_);
2327     }
2328     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) {
2329       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, mimeType_);
2330     }
2331     {
2332       int dataSize = 0;
2333       for (int i = 0; i < knowledgeTypes_.size(); i++) {
2334         dataSize +=
2335             com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(knowledgeTypes_.get(i));
2336       }
2337       size += dataSize;
2338       if (!getKnowledgeTypesList().isEmpty()) {
2339         size += 1;
2340         size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize);
2341       }
2342       knowledgeTypesMemoizedSerializedSize = dataSize;
2343     }
2344     if (sourceCase_ == 5) {
2345       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, source_);
2346     }
2347     for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
2348         internalGetMetadata().getMap().entrySet()) {
2349       com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
2350           MetadataDefaultEntryHolder.defaultEntry
2351               .newBuilderForType()
2352               .setKey(entry.getKey())
2353               .setValue(entry.getValue())
2354               .build();
2355       size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, metadata__);
2356     }
2357     if (sourceCase_ == 9) {
2358       size +=
2359           com.google.protobuf.CodedOutputStream.computeBytesSize(
2360               9, (com.google.protobuf.ByteString) source_);
2361     }
2362     if (enableAutoReload_ != false) {
2363       size += com.google.protobuf.CodedOutputStream.computeBoolSize(11, enableAutoReload_);
2364     }
2365     if (latestReloadStatus_ != null) {
2366       size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getLatestReloadStatus());
2367     }
2368     if (state_ != com.google.cloud.dialogflow.v2.Document.State.STATE_UNSPECIFIED.getNumber()) {
2369       size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, state_);
2370     }
2371     size += getUnknownFields().getSerializedSize();
2372     memoizedSize = size;
2373     return size;
2374   }
2375 
2376   @java.lang.Override
equals(final java.lang.Object obj)2377   public boolean equals(final java.lang.Object obj) {
2378     if (obj == this) {
2379       return true;
2380     }
2381     if (!(obj instanceof com.google.cloud.dialogflow.v2.Document)) {
2382       return super.equals(obj);
2383     }
2384     com.google.cloud.dialogflow.v2.Document other = (com.google.cloud.dialogflow.v2.Document) obj;
2385 
2386     if (!getName().equals(other.getName())) return false;
2387     if (!getDisplayName().equals(other.getDisplayName())) return false;
2388     if (!getMimeType().equals(other.getMimeType())) return false;
2389     if (!knowledgeTypes_.equals(other.knowledgeTypes_)) return false;
2390     if (getEnableAutoReload() != other.getEnableAutoReload()) return false;
2391     if (hasLatestReloadStatus() != other.hasLatestReloadStatus()) return false;
2392     if (hasLatestReloadStatus()) {
2393       if (!getLatestReloadStatus().equals(other.getLatestReloadStatus())) return false;
2394     }
2395     if (!internalGetMetadata().equals(other.internalGetMetadata())) return false;
2396     if (state_ != other.state_) return false;
2397     if (!getSourceCase().equals(other.getSourceCase())) return false;
2398     switch (sourceCase_) {
2399       case 5:
2400         if (!getContentUri().equals(other.getContentUri())) return false;
2401         break;
2402       case 9:
2403         if (!getRawContent().equals(other.getRawContent())) return false;
2404         break;
2405       case 0:
2406       default:
2407     }
2408     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
2409     return true;
2410   }
2411 
2412   @java.lang.Override
hashCode()2413   public int hashCode() {
2414     if (memoizedHashCode != 0) {
2415       return memoizedHashCode;
2416     }
2417     int hash = 41;
2418     hash = (19 * hash) + getDescriptor().hashCode();
2419     hash = (37 * hash) + NAME_FIELD_NUMBER;
2420     hash = (53 * hash) + getName().hashCode();
2421     hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
2422     hash = (53 * hash) + getDisplayName().hashCode();
2423     hash = (37 * hash) + MIME_TYPE_FIELD_NUMBER;
2424     hash = (53 * hash) + getMimeType().hashCode();
2425     if (getKnowledgeTypesCount() > 0) {
2426       hash = (37 * hash) + KNOWLEDGE_TYPES_FIELD_NUMBER;
2427       hash = (53 * hash) + knowledgeTypes_.hashCode();
2428     }
2429     hash = (37 * hash) + ENABLE_AUTO_RELOAD_FIELD_NUMBER;
2430     hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnableAutoReload());
2431     if (hasLatestReloadStatus()) {
2432       hash = (37 * hash) + LATEST_RELOAD_STATUS_FIELD_NUMBER;
2433       hash = (53 * hash) + getLatestReloadStatus().hashCode();
2434     }
2435     if (!internalGetMetadata().getMap().isEmpty()) {
2436       hash = (37 * hash) + METADATA_FIELD_NUMBER;
2437       hash = (53 * hash) + internalGetMetadata().hashCode();
2438     }
2439     hash = (37 * hash) + STATE_FIELD_NUMBER;
2440     hash = (53 * hash) + state_;
2441     switch (sourceCase_) {
2442       case 5:
2443         hash = (37 * hash) + CONTENT_URI_FIELD_NUMBER;
2444         hash = (53 * hash) + getContentUri().hashCode();
2445         break;
2446       case 9:
2447         hash = (37 * hash) + RAW_CONTENT_FIELD_NUMBER;
2448         hash = (53 * hash) + getRawContent().hashCode();
2449         break;
2450       case 0:
2451       default:
2452     }
2453     hash = (29 * hash) + getUnknownFields().hashCode();
2454     memoizedHashCode = hash;
2455     return hash;
2456   }
2457 
parseFrom(java.nio.ByteBuffer data)2458   public static com.google.cloud.dialogflow.v2.Document parseFrom(java.nio.ByteBuffer data)
2459       throws com.google.protobuf.InvalidProtocolBufferException {
2460     return PARSER.parseFrom(data);
2461   }
2462 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2463   public static com.google.cloud.dialogflow.v2.Document parseFrom(
2464       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2465       throws com.google.protobuf.InvalidProtocolBufferException {
2466     return PARSER.parseFrom(data, extensionRegistry);
2467   }
2468 
parseFrom( com.google.protobuf.ByteString data)2469   public static com.google.cloud.dialogflow.v2.Document parseFrom(
2470       com.google.protobuf.ByteString data)
2471       throws com.google.protobuf.InvalidProtocolBufferException {
2472     return PARSER.parseFrom(data);
2473   }
2474 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2475   public static com.google.cloud.dialogflow.v2.Document parseFrom(
2476       com.google.protobuf.ByteString data,
2477       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2478       throws com.google.protobuf.InvalidProtocolBufferException {
2479     return PARSER.parseFrom(data, extensionRegistry);
2480   }
2481 
parseFrom(byte[] data)2482   public static com.google.cloud.dialogflow.v2.Document parseFrom(byte[] data)
2483       throws com.google.protobuf.InvalidProtocolBufferException {
2484     return PARSER.parseFrom(data);
2485   }
2486 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2487   public static com.google.cloud.dialogflow.v2.Document parseFrom(
2488       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2489       throws com.google.protobuf.InvalidProtocolBufferException {
2490     return PARSER.parseFrom(data, extensionRegistry);
2491   }
2492 
parseFrom(java.io.InputStream input)2493   public static com.google.cloud.dialogflow.v2.Document parseFrom(java.io.InputStream input)
2494       throws java.io.IOException {
2495     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2496   }
2497 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2498   public static com.google.cloud.dialogflow.v2.Document parseFrom(
2499       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2500       throws java.io.IOException {
2501     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2502         PARSER, input, extensionRegistry);
2503   }
2504 
parseDelimitedFrom( java.io.InputStream input)2505   public static com.google.cloud.dialogflow.v2.Document parseDelimitedFrom(
2506       java.io.InputStream input) throws java.io.IOException {
2507     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
2508   }
2509 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2510   public static com.google.cloud.dialogflow.v2.Document parseDelimitedFrom(
2511       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2512       throws java.io.IOException {
2513     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
2514         PARSER, input, extensionRegistry);
2515   }
2516 
parseFrom( com.google.protobuf.CodedInputStream input)2517   public static com.google.cloud.dialogflow.v2.Document parseFrom(
2518       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
2519     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2520   }
2521 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2522   public static com.google.cloud.dialogflow.v2.Document parseFrom(
2523       com.google.protobuf.CodedInputStream input,
2524       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2525       throws java.io.IOException {
2526     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2527         PARSER, input, extensionRegistry);
2528   }
2529 
2530   @java.lang.Override
newBuilderForType()2531   public Builder newBuilderForType() {
2532     return newBuilder();
2533   }
2534 
newBuilder()2535   public static Builder newBuilder() {
2536     return DEFAULT_INSTANCE.toBuilder();
2537   }
2538 
newBuilder(com.google.cloud.dialogflow.v2.Document prototype)2539   public static Builder newBuilder(com.google.cloud.dialogflow.v2.Document prototype) {
2540     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
2541   }
2542 
2543   @java.lang.Override
toBuilder()2544   public Builder toBuilder() {
2545     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
2546   }
2547 
2548   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2549   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2550     Builder builder = new Builder(parent);
2551     return builder;
2552   }
2553   /**
2554    *
2555    *
2556    * <pre>
2557    * A knowledge document to be used by a
2558    * [KnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBase].
2559    * For more information, see the [knowledge base
2560    * guide](https://cloud.google.com/dialogflow/docs/how/knowledge-bases).
2561    * Note: The `projects.agent.knowledgeBases.documents` resource is deprecated;
2562    * only use `projects.knowledgeBases.documents`.
2563    * </pre>
2564    *
2565    * Protobuf type {@code google.cloud.dialogflow.v2.Document}
2566    */
2567   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
2568       implements
2569       // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.Document)
2570       com.google.cloud.dialogflow.v2.DocumentOrBuilder {
getDescriptor()2571     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
2572       return com.google.cloud.dialogflow.v2.DocumentProto
2573           .internal_static_google_cloud_dialogflow_v2_Document_descriptor;
2574     }
2575 
2576     @SuppressWarnings({"rawtypes"})
internalGetMapField(int number)2577     protected com.google.protobuf.MapField internalGetMapField(int number) {
2578       switch (number) {
2579         case 7:
2580           return internalGetMetadata();
2581         default:
2582           throw new RuntimeException("Invalid map field number: " + number);
2583       }
2584     }
2585 
2586     @SuppressWarnings({"rawtypes"})
internalGetMutableMapField(int number)2587     protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
2588       switch (number) {
2589         case 7:
2590           return internalGetMutableMetadata();
2591         default:
2592           throw new RuntimeException("Invalid map field number: " + number);
2593       }
2594     }
2595 
2596     @java.lang.Override
2597     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()2598         internalGetFieldAccessorTable() {
2599       return com.google.cloud.dialogflow.v2.DocumentProto
2600           .internal_static_google_cloud_dialogflow_v2_Document_fieldAccessorTable
2601           .ensureFieldAccessorsInitialized(
2602               com.google.cloud.dialogflow.v2.Document.class,
2603               com.google.cloud.dialogflow.v2.Document.Builder.class);
2604     }
2605 
2606     // Construct using com.google.cloud.dialogflow.v2.Document.newBuilder()
Builder()2607     private Builder() {}
2608 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2609     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2610       super(parent);
2611     }
2612 
2613     @java.lang.Override
clear()2614     public Builder clear() {
2615       super.clear();
2616       bitField0_ = 0;
2617       name_ = "";
2618       displayName_ = "";
2619       mimeType_ = "";
2620       knowledgeTypes_ = java.util.Collections.emptyList();
2621       bitField0_ = (bitField0_ & ~0x00000008);
2622       enableAutoReload_ = false;
2623       latestReloadStatus_ = null;
2624       if (latestReloadStatusBuilder_ != null) {
2625         latestReloadStatusBuilder_.dispose();
2626         latestReloadStatusBuilder_ = null;
2627       }
2628       internalGetMutableMetadata().clear();
2629       state_ = 0;
2630       sourceCase_ = 0;
2631       source_ = null;
2632       return this;
2633     }
2634 
2635     @java.lang.Override
getDescriptorForType()2636     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
2637       return com.google.cloud.dialogflow.v2.DocumentProto
2638           .internal_static_google_cloud_dialogflow_v2_Document_descriptor;
2639     }
2640 
2641     @java.lang.Override
getDefaultInstanceForType()2642     public com.google.cloud.dialogflow.v2.Document getDefaultInstanceForType() {
2643       return com.google.cloud.dialogflow.v2.Document.getDefaultInstance();
2644     }
2645 
2646     @java.lang.Override
build()2647     public com.google.cloud.dialogflow.v2.Document build() {
2648       com.google.cloud.dialogflow.v2.Document result = buildPartial();
2649       if (!result.isInitialized()) {
2650         throw newUninitializedMessageException(result);
2651       }
2652       return result;
2653     }
2654 
2655     @java.lang.Override
buildPartial()2656     public com.google.cloud.dialogflow.v2.Document buildPartial() {
2657       com.google.cloud.dialogflow.v2.Document result =
2658           new com.google.cloud.dialogflow.v2.Document(this);
2659       buildPartialRepeatedFields(result);
2660       if (bitField0_ != 0) {
2661         buildPartial0(result);
2662       }
2663       buildPartialOneofs(result);
2664       onBuilt();
2665       return result;
2666     }
2667 
buildPartialRepeatedFields(com.google.cloud.dialogflow.v2.Document result)2668     private void buildPartialRepeatedFields(com.google.cloud.dialogflow.v2.Document result) {
2669       if (((bitField0_ & 0x00000008) != 0)) {
2670         knowledgeTypes_ = java.util.Collections.unmodifiableList(knowledgeTypes_);
2671         bitField0_ = (bitField0_ & ~0x00000008);
2672       }
2673       result.knowledgeTypes_ = knowledgeTypes_;
2674     }
2675 
buildPartial0(com.google.cloud.dialogflow.v2.Document result)2676     private void buildPartial0(com.google.cloud.dialogflow.v2.Document result) {
2677       int from_bitField0_ = bitField0_;
2678       if (((from_bitField0_ & 0x00000001) != 0)) {
2679         result.name_ = name_;
2680       }
2681       if (((from_bitField0_ & 0x00000002) != 0)) {
2682         result.displayName_ = displayName_;
2683       }
2684       if (((from_bitField0_ & 0x00000004) != 0)) {
2685         result.mimeType_ = mimeType_;
2686       }
2687       if (((from_bitField0_ & 0x00000040) != 0)) {
2688         result.enableAutoReload_ = enableAutoReload_;
2689       }
2690       if (((from_bitField0_ & 0x00000080) != 0)) {
2691         result.latestReloadStatus_ =
2692             latestReloadStatusBuilder_ == null
2693                 ? latestReloadStatus_
2694                 : latestReloadStatusBuilder_.build();
2695       }
2696       if (((from_bitField0_ & 0x00000100) != 0)) {
2697         result.metadata_ = internalGetMetadata();
2698         result.metadata_.makeImmutable();
2699       }
2700       if (((from_bitField0_ & 0x00000200) != 0)) {
2701         result.state_ = state_;
2702       }
2703     }
2704 
buildPartialOneofs(com.google.cloud.dialogflow.v2.Document result)2705     private void buildPartialOneofs(com.google.cloud.dialogflow.v2.Document result) {
2706       result.sourceCase_ = sourceCase_;
2707       result.source_ = this.source_;
2708     }
2709 
2710     @java.lang.Override
clone()2711     public Builder clone() {
2712       return super.clone();
2713     }
2714 
2715     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2716     public Builder setField(
2717         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2718       return super.setField(field, value);
2719     }
2720 
2721     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)2722     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
2723       return super.clearField(field);
2724     }
2725 
2726     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)2727     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
2728       return super.clearOneof(oneof);
2729     }
2730 
2731     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)2732     public Builder setRepeatedField(
2733         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
2734       return super.setRepeatedField(field, index, value);
2735     }
2736 
2737     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)2738     public Builder addRepeatedField(
2739         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
2740       return super.addRepeatedField(field, value);
2741     }
2742 
2743     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)2744     public Builder mergeFrom(com.google.protobuf.Message other) {
2745       if (other instanceof com.google.cloud.dialogflow.v2.Document) {
2746         return mergeFrom((com.google.cloud.dialogflow.v2.Document) other);
2747       } else {
2748         super.mergeFrom(other);
2749         return this;
2750       }
2751     }
2752 
mergeFrom(com.google.cloud.dialogflow.v2.Document other)2753     public Builder mergeFrom(com.google.cloud.dialogflow.v2.Document other) {
2754       if (other == com.google.cloud.dialogflow.v2.Document.getDefaultInstance()) return this;
2755       if (!other.getName().isEmpty()) {
2756         name_ = other.name_;
2757         bitField0_ |= 0x00000001;
2758         onChanged();
2759       }
2760       if (!other.getDisplayName().isEmpty()) {
2761         displayName_ = other.displayName_;
2762         bitField0_ |= 0x00000002;
2763         onChanged();
2764       }
2765       if (!other.getMimeType().isEmpty()) {
2766         mimeType_ = other.mimeType_;
2767         bitField0_ |= 0x00000004;
2768         onChanged();
2769       }
2770       if (!other.knowledgeTypes_.isEmpty()) {
2771         if (knowledgeTypes_.isEmpty()) {
2772           knowledgeTypes_ = other.knowledgeTypes_;
2773           bitField0_ = (bitField0_ & ~0x00000008);
2774         } else {
2775           ensureKnowledgeTypesIsMutable();
2776           knowledgeTypes_.addAll(other.knowledgeTypes_);
2777         }
2778         onChanged();
2779       }
2780       if (other.getEnableAutoReload() != false) {
2781         setEnableAutoReload(other.getEnableAutoReload());
2782       }
2783       if (other.hasLatestReloadStatus()) {
2784         mergeLatestReloadStatus(other.getLatestReloadStatus());
2785       }
2786       internalGetMutableMetadata().mergeFrom(other.internalGetMetadata());
2787       bitField0_ |= 0x00000100;
2788       if (other.state_ != 0) {
2789         setStateValue(other.getStateValue());
2790       }
2791       switch (other.getSourceCase()) {
2792         case CONTENT_URI:
2793           {
2794             sourceCase_ = 5;
2795             source_ = other.source_;
2796             onChanged();
2797             break;
2798           }
2799         case RAW_CONTENT:
2800           {
2801             setRawContent(other.getRawContent());
2802             break;
2803           }
2804         case SOURCE_NOT_SET:
2805           {
2806             break;
2807           }
2808       }
2809       this.mergeUnknownFields(other.getUnknownFields());
2810       onChanged();
2811       return this;
2812     }
2813 
2814     @java.lang.Override
isInitialized()2815     public final boolean isInitialized() {
2816       return true;
2817     }
2818 
2819     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2820     public Builder mergeFrom(
2821         com.google.protobuf.CodedInputStream input,
2822         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2823         throws java.io.IOException {
2824       if (extensionRegistry == null) {
2825         throw new java.lang.NullPointerException();
2826       }
2827       try {
2828         boolean done = false;
2829         while (!done) {
2830           int tag = input.readTag();
2831           switch (tag) {
2832             case 0:
2833               done = true;
2834               break;
2835             case 10:
2836               {
2837                 name_ = input.readStringRequireUtf8();
2838                 bitField0_ |= 0x00000001;
2839                 break;
2840               } // case 10
2841             case 18:
2842               {
2843                 displayName_ = input.readStringRequireUtf8();
2844                 bitField0_ |= 0x00000002;
2845                 break;
2846               } // case 18
2847             case 26:
2848               {
2849                 mimeType_ = input.readStringRequireUtf8();
2850                 bitField0_ |= 0x00000004;
2851                 break;
2852               } // case 26
2853             case 32:
2854               {
2855                 int tmpRaw = input.readEnum();
2856                 ensureKnowledgeTypesIsMutable();
2857                 knowledgeTypes_.add(tmpRaw);
2858                 break;
2859               } // case 32
2860             case 34:
2861               {
2862                 int length = input.readRawVarint32();
2863                 int oldLimit = input.pushLimit(length);
2864                 while (input.getBytesUntilLimit() > 0) {
2865                   int tmpRaw = input.readEnum();
2866                   ensureKnowledgeTypesIsMutable();
2867                   knowledgeTypes_.add(tmpRaw);
2868                 }
2869                 input.popLimit(oldLimit);
2870                 break;
2871               } // case 34
2872             case 42:
2873               {
2874                 java.lang.String s = input.readStringRequireUtf8();
2875                 sourceCase_ = 5;
2876                 source_ = s;
2877                 break;
2878               } // case 42
2879             case 58:
2880               {
2881                 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> metadata__ =
2882                     input.readMessage(
2883                         MetadataDefaultEntryHolder.defaultEntry.getParserForType(),
2884                         extensionRegistry);
2885                 internalGetMutableMetadata()
2886                     .getMutableMap()
2887                     .put(metadata__.getKey(), metadata__.getValue());
2888                 bitField0_ |= 0x00000100;
2889                 break;
2890               } // case 58
2891             case 74:
2892               {
2893                 source_ = input.readBytes();
2894                 sourceCase_ = 9;
2895                 break;
2896               } // case 74
2897             case 88:
2898               {
2899                 enableAutoReload_ = input.readBool();
2900                 bitField0_ |= 0x00000040;
2901                 break;
2902               } // case 88
2903             case 98:
2904               {
2905                 input.readMessage(
2906                     getLatestReloadStatusFieldBuilder().getBuilder(), extensionRegistry);
2907                 bitField0_ |= 0x00000080;
2908                 break;
2909               } // case 98
2910             case 104:
2911               {
2912                 state_ = input.readEnum();
2913                 bitField0_ |= 0x00000200;
2914                 break;
2915               } // case 104
2916             default:
2917               {
2918                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
2919                   done = true; // was an endgroup tag
2920                 }
2921                 break;
2922               } // default:
2923           } // switch (tag)
2924         } // while (!done)
2925       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
2926         throw e.unwrapIOException();
2927       } finally {
2928         onChanged();
2929       } // finally
2930       return this;
2931     }
2932 
2933     private int sourceCase_ = 0;
2934     private java.lang.Object source_;
2935 
getSourceCase()2936     public SourceCase getSourceCase() {
2937       return SourceCase.forNumber(sourceCase_);
2938     }
2939 
clearSource()2940     public Builder clearSource() {
2941       sourceCase_ = 0;
2942       source_ = null;
2943       onChanged();
2944       return this;
2945     }
2946 
2947     private int bitField0_;
2948 
2949     private java.lang.Object name_ = "";
2950     /**
2951      *
2952      *
2953      * <pre>
2954      * Optional. The document resource name.
2955      * The name must be empty when creating a document.
2956      * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
2957      * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
2958      * </pre>
2959      *
2960      * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
2961      *
2962      * @return The name.
2963      */
getName()2964     public java.lang.String getName() {
2965       java.lang.Object ref = name_;
2966       if (!(ref instanceof java.lang.String)) {
2967         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2968         java.lang.String s = bs.toStringUtf8();
2969         name_ = s;
2970         return s;
2971       } else {
2972         return (java.lang.String) ref;
2973       }
2974     }
2975     /**
2976      *
2977      *
2978      * <pre>
2979      * Optional. The document resource name.
2980      * The name must be empty when creating a document.
2981      * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
2982      * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
2983      * </pre>
2984      *
2985      * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
2986      *
2987      * @return The bytes for name.
2988      */
getNameBytes()2989     public com.google.protobuf.ByteString getNameBytes() {
2990       java.lang.Object ref = name_;
2991       if (ref instanceof String) {
2992         com.google.protobuf.ByteString b =
2993             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2994         name_ = b;
2995         return b;
2996       } else {
2997         return (com.google.protobuf.ByteString) ref;
2998       }
2999     }
3000     /**
3001      *
3002      *
3003      * <pre>
3004      * Optional. The document resource name.
3005      * The name must be empty when creating a document.
3006      * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
3007      * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
3008      * </pre>
3009      *
3010      * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
3011      *
3012      * @param value The name to set.
3013      * @return This builder for chaining.
3014      */
setName(java.lang.String value)3015     public Builder setName(java.lang.String value) {
3016       if (value == null) {
3017         throw new NullPointerException();
3018       }
3019       name_ = value;
3020       bitField0_ |= 0x00000001;
3021       onChanged();
3022       return this;
3023     }
3024     /**
3025      *
3026      *
3027      * <pre>
3028      * Optional. The document resource name.
3029      * The name must be empty when creating a document.
3030      * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
3031      * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
3032      * </pre>
3033      *
3034      * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
3035      *
3036      * @return This builder for chaining.
3037      */
clearName()3038     public Builder clearName() {
3039       name_ = getDefaultInstance().getName();
3040       bitField0_ = (bitField0_ & ~0x00000001);
3041       onChanged();
3042       return this;
3043     }
3044     /**
3045      *
3046      *
3047      * <pre>
3048      * Optional. The document resource name.
3049      * The name must be empty when creating a document.
3050      * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location
3051      * ID&gt;/knowledgeBases/&lt;Knowledge Base ID&gt;/documents/&lt;Document ID&gt;`.
3052      * </pre>
3053      *
3054      * <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
3055      *
3056      * @param value The bytes for name to set.
3057      * @return This builder for chaining.
3058      */
setNameBytes(com.google.protobuf.ByteString value)3059     public Builder setNameBytes(com.google.protobuf.ByteString value) {
3060       if (value == null) {
3061         throw new NullPointerException();
3062       }
3063       checkByteStringIsUtf8(value);
3064       name_ = value;
3065       bitField0_ |= 0x00000001;
3066       onChanged();
3067       return this;
3068     }
3069 
3070     private java.lang.Object displayName_ = "";
3071     /**
3072      *
3073      *
3074      * <pre>
3075      * Required. The display name of the document. The name must be 1024 bytes or
3076      * less; otherwise, the creation request fails.
3077      * </pre>
3078      *
3079      * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
3080      *
3081      * @return The displayName.
3082      */
getDisplayName()3083     public java.lang.String getDisplayName() {
3084       java.lang.Object ref = displayName_;
3085       if (!(ref instanceof java.lang.String)) {
3086         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3087         java.lang.String s = bs.toStringUtf8();
3088         displayName_ = s;
3089         return s;
3090       } else {
3091         return (java.lang.String) ref;
3092       }
3093     }
3094     /**
3095      *
3096      *
3097      * <pre>
3098      * Required. The display name of the document. The name must be 1024 bytes or
3099      * less; otherwise, the creation request fails.
3100      * </pre>
3101      *
3102      * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
3103      *
3104      * @return The bytes for displayName.
3105      */
getDisplayNameBytes()3106     public com.google.protobuf.ByteString getDisplayNameBytes() {
3107       java.lang.Object ref = displayName_;
3108       if (ref instanceof String) {
3109         com.google.protobuf.ByteString b =
3110             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3111         displayName_ = b;
3112         return b;
3113       } else {
3114         return (com.google.protobuf.ByteString) ref;
3115       }
3116     }
3117     /**
3118      *
3119      *
3120      * <pre>
3121      * Required. The display name of the document. The name must be 1024 bytes or
3122      * less; otherwise, the creation request fails.
3123      * </pre>
3124      *
3125      * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
3126      *
3127      * @param value The displayName to set.
3128      * @return This builder for chaining.
3129      */
setDisplayName(java.lang.String value)3130     public Builder setDisplayName(java.lang.String value) {
3131       if (value == null) {
3132         throw new NullPointerException();
3133       }
3134       displayName_ = value;
3135       bitField0_ |= 0x00000002;
3136       onChanged();
3137       return this;
3138     }
3139     /**
3140      *
3141      *
3142      * <pre>
3143      * Required. The display name of the document. The name must be 1024 bytes or
3144      * less; otherwise, the creation request fails.
3145      * </pre>
3146      *
3147      * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
3148      *
3149      * @return This builder for chaining.
3150      */
clearDisplayName()3151     public Builder clearDisplayName() {
3152       displayName_ = getDefaultInstance().getDisplayName();
3153       bitField0_ = (bitField0_ & ~0x00000002);
3154       onChanged();
3155       return this;
3156     }
3157     /**
3158      *
3159      *
3160      * <pre>
3161      * Required. The display name of the document. The name must be 1024 bytes or
3162      * less; otherwise, the creation request fails.
3163      * </pre>
3164      *
3165      * <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
3166      *
3167      * @param value The bytes for displayName to set.
3168      * @return This builder for chaining.
3169      */
setDisplayNameBytes(com.google.protobuf.ByteString value)3170     public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
3171       if (value == null) {
3172         throw new NullPointerException();
3173       }
3174       checkByteStringIsUtf8(value);
3175       displayName_ = value;
3176       bitField0_ |= 0x00000002;
3177       onChanged();
3178       return this;
3179     }
3180 
3181     private java.lang.Object mimeType_ = "";
3182     /**
3183      *
3184      *
3185      * <pre>
3186      * Required. The MIME type of this document.
3187      * </pre>
3188      *
3189      * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
3190      *
3191      * @return The mimeType.
3192      */
getMimeType()3193     public java.lang.String getMimeType() {
3194       java.lang.Object ref = mimeType_;
3195       if (!(ref instanceof java.lang.String)) {
3196         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3197         java.lang.String s = bs.toStringUtf8();
3198         mimeType_ = s;
3199         return s;
3200       } else {
3201         return (java.lang.String) ref;
3202       }
3203     }
3204     /**
3205      *
3206      *
3207      * <pre>
3208      * Required. The MIME type of this document.
3209      * </pre>
3210      *
3211      * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
3212      *
3213      * @return The bytes for mimeType.
3214      */
getMimeTypeBytes()3215     public com.google.protobuf.ByteString getMimeTypeBytes() {
3216       java.lang.Object ref = mimeType_;
3217       if (ref instanceof String) {
3218         com.google.protobuf.ByteString b =
3219             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3220         mimeType_ = b;
3221         return b;
3222       } else {
3223         return (com.google.protobuf.ByteString) ref;
3224       }
3225     }
3226     /**
3227      *
3228      *
3229      * <pre>
3230      * Required. The MIME type of this document.
3231      * </pre>
3232      *
3233      * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
3234      *
3235      * @param value The mimeType to set.
3236      * @return This builder for chaining.
3237      */
setMimeType(java.lang.String value)3238     public Builder setMimeType(java.lang.String value) {
3239       if (value == null) {
3240         throw new NullPointerException();
3241       }
3242       mimeType_ = value;
3243       bitField0_ |= 0x00000004;
3244       onChanged();
3245       return this;
3246     }
3247     /**
3248      *
3249      *
3250      * <pre>
3251      * Required. The MIME type of this document.
3252      * </pre>
3253      *
3254      * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
3255      *
3256      * @return This builder for chaining.
3257      */
clearMimeType()3258     public Builder clearMimeType() {
3259       mimeType_ = getDefaultInstance().getMimeType();
3260       bitField0_ = (bitField0_ & ~0x00000004);
3261       onChanged();
3262       return this;
3263     }
3264     /**
3265      *
3266      *
3267      * <pre>
3268      * Required. The MIME type of this document.
3269      * </pre>
3270      *
3271      * <code>string mime_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
3272      *
3273      * @param value The bytes for mimeType to set.
3274      * @return This builder for chaining.
3275      */
setMimeTypeBytes(com.google.protobuf.ByteString value)3276     public Builder setMimeTypeBytes(com.google.protobuf.ByteString value) {
3277       if (value == null) {
3278         throw new NullPointerException();
3279       }
3280       checkByteStringIsUtf8(value);
3281       mimeType_ = value;
3282       bitField0_ |= 0x00000004;
3283       onChanged();
3284       return this;
3285     }
3286 
3287     private java.util.List<java.lang.Integer> knowledgeTypes_ = java.util.Collections.emptyList();
3288 
ensureKnowledgeTypesIsMutable()3289     private void ensureKnowledgeTypesIsMutable() {
3290       if (!((bitField0_ & 0x00000008) != 0)) {
3291         knowledgeTypes_ = new java.util.ArrayList<java.lang.Integer>(knowledgeTypes_);
3292         bitField0_ |= 0x00000008;
3293       }
3294     }
3295     /**
3296      *
3297      *
3298      * <pre>
3299      * Required. The knowledge type of document content.
3300      * </pre>
3301      *
3302      * <code>
3303      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3304      * </code>
3305      *
3306      * @return A list containing the knowledgeTypes.
3307      */
3308     public java.util.List<com.google.cloud.dialogflow.v2.Document.KnowledgeType>
getKnowledgeTypesList()3309         getKnowledgeTypesList() {
3310       return new com.google.protobuf.Internal.ListAdapter<
3311           java.lang.Integer, com.google.cloud.dialogflow.v2.Document.KnowledgeType>(
3312           knowledgeTypes_, knowledgeTypes_converter_);
3313     }
3314     /**
3315      *
3316      *
3317      * <pre>
3318      * Required. The knowledge type of document content.
3319      * </pre>
3320      *
3321      * <code>
3322      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3323      * </code>
3324      *
3325      * @return The count of knowledgeTypes.
3326      */
getKnowledgeTypesCount()3327     public int getKnowledgeTypesCount() {
3328       return knowledgeTypes_.size();
3329     }
3330     /**
3331      *
3332      *
3333      * <pre>
3334      * Required. The knowledge type of document content.
3335      * </pre>
3336      *
3337      * <code>
3338      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3339      * </code>
3340      *
3341      * @param index The index of the element to return.
3342      * @return The knowledgeTypes at the given index.
3343      */
getKnowledgeTypes(int index)3344     public com.google.cloud.dialogflow.v2.Document.KnowledgeType getKnowledgeTypes(int index) {
3345       return knowledgeTypes_converter_.convert(knowledgeTypes_.get(index));
3346     }
3347     /**
3348      *
3349      *
3350      * <pre>
3351      * Required. The knowledge type of document content.
3352      * </pre>
3353      *
3354      * <code>
3355      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3356      * </code>
3357      *
3358      * @param index The index to set the value at.
3359      * @param value The knowledgeTypes to set.
3360      * @return This builder for chaining.
3361      */
setKnowledgeTypes( int index, com.google.cloud.dialogflow.v2.Document.KnowledgeType value)3362     public Builder setKnowledgeTypes(
3363         int index, com.google.cloud.dialogflow.v2.Document.KnowledgeType value) {
3364       if (value == null) {
3365         throw new NullPointerException();
3366       }
3367       ensureKnowledgeTypesIsMutable();
3368       knowledgeTypes_.set(index, value.getNumber());
3369       onChanged();
3370       return this;
3371     }
3372     /**
3373      *
3374      *
3375      * <pre>
3376      * Required. The knowledge type of document content.
3377      * </pre>
3378      *
3379      * <code>
3380      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3381      * </code>
3382      *
3383      * @param value The knowledgeTypes to add.
3384      * @return This builder for chaining.
3385      */
addKnowledgeTypes(com.google.cloud.dialogflow.v2.Document.KnowledgeType value)3386     public Builder addKnowledgeTypes(com.google.cloud.dialogflow.v2.Document.KnowledgeType value) {
3387       if (value == null) {
3388         throw new NullPointerException();
3389       }
3390       ensureKnowledgeTypesIsMutable();
3391       knowledgeTypes_.add(value.getNumber());
3392       onChanged();
3393       return this;
3394     }
3395     /**
3396      *
3397      *
3398      * <pre>
3399      * Required. The knowledge type of document content.
3400      * </pre>
3401      *
3402      * <code>
3403      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3404      * </code>
3405      *
3406      * @param values The knowledgeTypes to add.
3407      * @return This builder for chaining.
3408      */
addAllKnowledgeTypes( java.lang.Iterable<? extends com.google.cloud.dialogflow.v2.Document.KnowledgeType> values)3409     public Builder addAllKnowledgeTypes(
3410         java.lang.Iterable<? extends com.google.cloud.dialogflow.v2.Document.KnowledgeType>
3411             values) {
3412       ensureKnowledgeTypesIsMutable();
3413       for (com.google.cloud.dialogflow.v2.Document.KnowledgeType value : values) {
3414         knowledgeTypes_.add(value.getNumber());
3415       }
3416       onChanged();
3417       return this;
3418     }
3419     /**
3420      *
3421      *
3422      * <pre>
3423      * Required. The knowledge type of document content.
3424      * </pre>
3425      *
3426      * <code>
3427      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3428      * </code>
3429      *
3430      * @return This builder for chaining.
3431      */
clearKnowledgeTypes()3432     public Builder clearKnowledgeTypes() {
3433       knowledgeTypes_ = java.util.Collections.emptyList();
3434       bitField0_ = (bitField0_ & ~0x00000008);
3435       onChanged();
3436       return this;
3437     }
3438     /**
3439      *
3440      *
3441      * <pre>
3442      * Required. The knowledge type of document content.
3443      * </pre>
3444      *
3445      * <code>
3446      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3447      * </code>
3448      *
3449      * @return A list containing the enum numeric values on the wire for knowledgeTypes.
3450      */
getKnowledgeTypesValueList()3451     public java.util.List<java.lang.Integer> getKnowledgeTypesValueList() {
3452       return java.util.Collections.unmodifiableList(knowledgeTypes_);
3453     }
3454     /**
3455      *
3456      *
3457      * <pre>
3458      * Required. The knowledge type of document content.
3459      * </pre>
3460      *
3461      * <code>
3462      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3463      * </code>
3464      *
3465      * @param index The index of the value to return.
3466      * @return The enum numeric value on the wire of knowledgeTypes at the given index.
3467      */
getKnowledgeTypesValue(int index)3468     public int getKnowledgeTypesValue(int index) {
3469       return knowledgeTypes_.get(index);
3470     }
3471     /**
3472      *
3473      *
3474      * <pre>
3475      * Required. The knowledge type of document content.
3476      * </pre>
3477      *
3478      * <code>
3479      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3480      * </code>
3481      *
3482      * @param index The index to set the value at.
3483      * @param value The enum numeric value on the wire for knowledgeTypes to set.
3484      * @return This builder for chaining.
3485      */
setKnowledgeTypesValue(int index, int value)3486     public Builder setKnowledgeTypesValue(int index, int value) {
3487       ensureKnowledgeTypesIsMutable();
3488       knowledgeTypes_.set(index, value);
3489       onChanged();
3490       return this;
3491     }
3492     /**
3493      *
3494      *
3495      * <pre>
3496      * Required. The knowledge type of document content.
3497      * </pre>
3498      *
3499      * <code>
3500      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3501      * </code>
3502      *
3503      * @param value The enum numeric value on the wire for knowledgeTypes to add.
3504      * @return This builder for chaining.
3505      */
addKnowledgeTypesValue(int value)3506     public Builder addKnowledgeTypesValue(int value) {
3507       ensureKnowledgeTypesIsMutable();
3508       knowledgeTypes_.add(value);
3509       onChanged();
3510       return this;
3511     }
3512     /**
3513      *
3514      *
3515      * <pre>
3516      * Required. The knowledge type of document content.
3517      * </pre>
3518      *
3519      * <code>
3520      * repeated .google.cloud.dialogflow.v2.Document.KnowledgeType knowledge_types = 4 [(.google.api.field_behavior) = REQUIRED];
3521      * </code>
3522      *
3523      * @param values The enum numeric values on the wire for knowledgeTypes to add.
3524      * @return This builder for chaining.
3525      */
addAllKnowledgeTypesValue(java.lang.Iterable<java.lang.Integer> values)3526     public Builder addAllKnowledgeTypesValue(java.lang.Iterable<java.lang.Integer> values) {
3527       ensureKnowledgeTypesIsMutable();
3528       for (int value : values) {
3529         knowledgeTypes_.add(value);
3530       }
3531       onChanged();
3532       return this;
3533     }
3534 
3535     /**
3536      *
3537      *
3538      * <pre>
3539      * The URI where the file content is located.
3540      * For documents stored in Google Cloud Storage, these URIs must have
3541      * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
3542      * NOTE: External URLs must correspond to public webpages, i.e., they must
3543      * be indexed by Google Search. In particular, URLs for showing documents in
3544      * Google Cloud Storage (i.e. the URL in your browser) are not supported.
3545      * Instead use the `gs://` format URI described above.
3546      * </pre>
3547      *
3548      * <code>string content_uri = 5;</code>
3549      *
3550      * @return Whether the contentUri field is set.
3551      */
3552     @java.lang.Override
hasContentUri()3553     public boolean hasContentUri() {
3554       return sourceCase_ == 5;
3555     }
3556     /**
3557      *
3558      *
3559      * <pre>
3560      * The URI where the file content is located.
3561      * For documents stored in Google Cloud Storage, these URIs must have
3562      * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
3563      * NOTE: External URLs must correspond to public webpages, i.e., they must
3564      * be indexed by Google Search. In particular, URLs for showing documents in
3565      * Google Cloud Storage (i.e. the URL in your browser) are not supported.
3566      * Instead use the `gs://` format URI described above.
3567      * </pre>
3568      *
3569      * <code>string content_uri = 5;</code>
3570      *
3571      * @return The contentUri.
3572      */
3573     @java.lang.Override
getContentUri()3574     public java.lang.String getContentUri() {
3575       java.lang.Object ref = "";
3576       if (sourceCase_ == 5) {
3577         ref = source_;
3578       }
3579       if (!(ref instanceof java.lang.String)) {
3580         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3581         java.lang.String s = bs.toStringUtf8();
3582         if (sourceCase_ == 5) {
3583           source_ = s;
3584         }
3585         return s;
3586       } else {
3587         return (java.lang.String) ref;
3588       }
3589     }
3590     /**
3591      *
3592      *
3593      * <pre>
3594      * The URI where the file content is located.
3595      * For documents stored in Google Cloud Storage, these URIs must have
3596      * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
3597      * NOTE: External URLs must correspond to public webpages, i.e., they must
3598      * be indexed by Google Search. In particular, URLs for showing documents in
3599      * Google Cloud Storage (i.e. the URL in your browser) are not supported.
3600      * Instead use the `gs://` format URI described above.
3601      * </pre>
3602      *
3603      * <code>string content_uri = 5;</code>
3604      *
3605      * @return The bytes for contentUri.
3606      */
3607     @java.lang.Override
getContentUriBytes()3608     public com.google.protobuf.ByteString getContentUriBytes() {
3609       java.lang.Object ref = "";
3610       if (sourceCase_ == 5) {
3611         ref = source_;
3612       }
3613       if (ref instanceof String) {
3614         com.google.protobuf.ByteString b =
3615             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3616         if (sourceCase_ == 5) {
3617           source_ = b;
3618         }
3619         return b;
3620       } else {
3621         return (com.google.protobuf.ByteString) ref;
3622       }
3623     }
3624     /**
3625      *
3626      *
3627      * <pre>
3628      * The URI where the file content is located.
3629      * For documents stored in Google Cloud Storage, these URIs must have
3630      * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
3631      * NOTE: External URLs must correspond to public webpages, i.e., they must
3632      * be indexed by Google Search. In particular, URLs for showing documents in
3633      * Google Cloud Storage (i.e. the URL in your browser) are not supported.
3634      * Instead use the `gs://` format URI described above.
3635      * </pre>
3636      *
3637      * <code>string content_uri = 5;</code>
3638      *
3639      * @param value The contentUri to set.
3640      * @return This builder for chaining.
3641      */
setContentUri(java.lang.String value)3642     public Builder setContentUri(java.lang.String value) {
3643       if (value == null) {
3644         throw new NullPointerException();
3645       }
3646       sourceCase_ = 5;
3647       source_ = value;
3648       onChanged();
3649       return this;
3650     }
3651     /**
3652      *
3653      *
3654      * <pre>
3655      * The URI where the file content is located.
3656      * For documents stored in Google Cloud Storage, these URIs must have
3657      * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
3658      * NOTE: External URLs must correspond to public webpages, i.e., they must
3659      * be indexed by Google Search. In particular, URLs for showing documents in
3660      * Google Cloud Storage (i.e. the URL in your browser) are not supported.
3661      * Instead use the `gs://` format URI described above.
3662      * </pre>
3663      *
3664      * <code>string content_uri = 5;</code>
3665      *
3666      * @return This builder for chaining.
3667      */
clearContentUri()3668     public Builder clearContentUri() {
3669       if (sourceCase_ == 5) {
3670         sourceCase_ = 0;
3671         source_ = null;
3672         onChanged();
3673       }
3674       return this;
3675     }
3676     /**
3677      *
3678      *
3679      * <pre>
3680      * The URI where the file content is located.
3681      * For documents stored in Google Cloud Storage, these URIs must have
3682      * the form `gs://&lt;bucket-name&gt;/&lt;object-name&gt;`.
3683      * NOTE: External URLs must correspond to public webpages, i.e., they must
3684      * be indexed by Google Search. In particular, URLs for showing documents in
3685      * Google Cloud Storage (i.e. the URL in your browser) are not supported.
3686      * Instead use the `gs://` format URI described above.
3687      * </pre>
3688      *
3689      * <code>string content_uri = 5;</code>
3690      *
3691      * @param value The bytes for contentUri to set.
3692      * @return This builder for chaining.
3693      */
setContentUriBytes(com.google.protobuf.ByteString value)3694     public Builder setContentUriBytes(com.google.protobuf.ByteString value) {
3695       if (value == null) {
3696         throw new NullPointerException();
3697       }
3698       checkByteStringIsUtf8(value);
3699       sourceCase_ = 5;
3700       source_ = value;
3701       onChanged();
3702       return this;
3703     }
3704 
3705     /**
3706      *
3707      *
3708      * <pre>
3709      * The raw content of the document. This field is only permitted for
3710      * EXTRACTIVE_QA and FAQ knowledge types.
3711      * </pre>
3712      *
3713      * <code>bytes raw_content = 9;</code>
3714      *
3715      * @return Whether the rawContent field is set.
3716      */
hasRawContent()3717     public boolean hasRawContent() {
3718       return sourceCase_ == 9;
3719     }
3720     /**
3721      *
3722      *
3723      * <pre>
3724      * The raw content of the document. This field is only permitted for
3725      * EXTRACTIVE_QA and FAQ knowledge types.
3726      * </pre>
3727      *
3728      * <code>bytes raw_content = 9;</code>
3729      *
3730      * @return The rawContent.
3731      */
getRawContent()3732     public com.google.protobuf.ByteString getRawContent() {
3733       if (sourceCase_ == 9) {
3734         return (com.google.protobuf.ByteString) source_;
3735       }
3736       return com.google.protobuf.ByteString.EMPTY;
3737     }
3738     /**
3739      *
3740      *
3741      * <pre>
3742      * The raw content of the document. This field is only permitted for
3743      * EXTRACTIVE_QA and FAQ knowledge types.
3744      * </pre>
3745      *
3746      * <code>bytes raw_content = 9;</code>
3747      *
3748      * @param value The rawContent to set.
3749      * @return This builder for chaining.
3750      */
setRawContent(com.google.protobuf.ByteString value)3751     public Builder setRawContent(com.google.protobuf.ByteString value) {
3752       if (value == null) {
3753         throw new NullPointerException();
3754       }
3755       sourceCase_ = 9;
3756       source_ = value;
3757       onChanged();
3758       return this;
3759     }
3760     /**
3761      *
3762      *
3763      * <pre>
3764      * The raw content of the document. This field is only permitted for
3765      * EXTRACTIVE_QA and FAQ knowledge types.
3766      * </pre>
3767      *
3768      * <code>bytes raw_content = 9;</code>
3769      *
3770      * @return This builder for chaining.
3771      */
clearRawContent()3772     public Builder clearRawContent() {
3773       if (sourceCase_ == 9) {
3774         sourceCase_ = 0;
3775         source_ = null;
3776         onChanged();
3777       }
3778       return this;
3779     }
3780 
3781     private boolean enableAutoReload_;
3782     /**
3783      *
3784      *
3785      * <pre>
3786      * Optional. If true, we try to automatically reload the document every day
3787      * (at a time picked by the system). If false or unspecified, we don't try
3788      * to automatically reload the document.
3789      * Currently you can only enable automatic reload for documents sourced from
3790      * a public url, see `source` field for the source types.
3791      * Reload status can be tracked in `latest_reload_status`. If a reload
3792      * fails, we will keep the document unchanged.
3793      * If a reload fails with internal errors, the system will try to reload the
3794      * document on the next day.
3795      * If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the
3796      * system will not try to reload the document anymore. You need to manually
3797      * reload the document successfully by calling `ReloadDocument` and clear the
3798      * errors.
3799      * </pre>
3800      *
3801      * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
3802      *
3803      * @return The enableAutoReload.
3804      */
3805     @java.lang.Override
getEnableAutoReload()3806     public boolean getEnableAutoReload() {
3807       return enableAutoReload_;
3808     }
3809     /**
3810      *
3811      *
3812      * <pre>
3813      * Optional. If true, we try to automatically reload the document every day
3814      * (at a time picked by the system). If false or unspecified, we don't try
3815      * to automatically reload the document.
3816      * Currently you can only enable automatic reload for documents sourced from
3817      * a public url, see `source` field for the source types.
3818      * Reload status can be tracked in `latest_reload_status`. If a reload
3819      * fails, we will keep the document unchanged.
3820      * If a reload fails with internal errors, the system will try to reload the
3821      * document on the next day.
3822      * If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the
3823      * system will not try to reload the document anymore. You need to manually
3824      * reload the document successfully by calling `ReloadDocument` and clear the
3825      * errors.
3826      * </pre>
3827      *
3828      * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
3829      *
3830      * @param value The enableAutoReload to set.
3831      * @return This builder for chaining.
3832      */
setEnableAutoReload(boolean value)3833     public Builder setEnableAutoReload(boolean value) {
3834 
3835       enableAutoReload_ = value;
3836       bitField0_ |= 0x00000040;
3837       onChanged();
3838       return this;
3839     }
3840     /**
3841      *
3842      *
3843      * <pre>
3844      * Optional. If true, we try to automatically reload the document every day
3845      * (at a time picked by the system). If false or unspecified, we don't try
3846      * to automatically reload the document.
3847      * Currently you can only enable automatic reload for documents sourced from
3848      * a public url, see `source` field for the source types.
3849      * Reload status can be tracked in `latest_reload_status`. If a reload
3850      * fails, we will keep the document unchanged.
3851      * If a reload fails with internal errors, the system will try to reload the
3852      * document on the next day.
3853      * If a reload fails with non-retriable errors (e.g. PERMISION_DENIED), the
3854      * system will not try to reload the document anymore. You need to manually
3855      * reload the document successfully by calling `ReloadDocument` and clear the
3856      * errors.
3857      * </pre>
3858      *
3859      * <code>bool enable_auto_reload = 11 [(.google.api.field_behavior) = OPTIONAL];</code>
3860      *
3861      * @return This builder for chaining.
3862      */
clearEnableAutoReload()3863     public Builder clearEnableAutoReload() {
3864       bitField0_ = (bitField0_ & ~0x00000040);
3865       enableAutoReload_ = false;
3866       onChanged();
3867       return this;
3868     }
3869 
3870     private com.google.cloud.dialogflow.v2.Document.ReloadStatus latestReloadStatus_;
3871     private com.google.protobuf.SingleFieldBuilderV3<
3872             com.google.cloud.dialogflow.v2.Document.ReloadStatus,
3873             com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder,
3874             com.google.cloud.dialogflow.v2.Document.ReloadStatusOrBuilder>
3875         latestReloadStatusBuilder_;
3876     /**
3877      *
3878      *
3879      * <pre>
3880      * Output only. The time and status of the latest reload.
3881      * This reload may have been triggered automatically or manually
3882      * and may not have succeeded.
3883      * </pre>
3884      *
3885      * <code>
3886      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
3887      * </code>
3888      *
3889      * @return Whether the latestReloadStatus field is set.
3890      */
hasLatestReloadStatus()3891     public boolean hasLatestReloadStatus() {
3892       return ((bitField0_ & 0x00000080) != 0);
3893     }
3894     /**
3895      *
3896      *
3897      * <pre>
3898      * Output only. The time and status of the latest reload.
3899      * This reload may have been triggered automatically or manually
3900      * and may not have succeeded.
3901      * </pre>
3902      *
3903      * <code>
3904      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
3905      * </code>
3906      *
3907      * @return The latestReloadStatus.
3908      */
getLatestReloadStatus()3909     public com.google.cloud.dialogflow.v2.Document.ReloadStatus getLatestReloadStatus() {
3910       if (latestReloadStatusBuilder_ == null) {
3911         return latestReloadStatus_ == null
3912             ? com.google.cloud.dialogflow.v2.Document.ReloadStatus.getDefaultInstance()
3913             : latestReloadStatus_;
3914       } else {
3915         return latestReloadStatusBuilder_.getMessage();
3916       }
3917     }
3918     /**
3919      *
3920      *
3921      * <pre>
3922      * Output only. The time and status of the latest reload.
3923      * This reload may have been triggered automatically or manually
3924      * and may not have succeeded.
3925      * </pre>
3926      *
3927      * <code>
3928      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
3929      * </code>
3930      */
setLatestReloadStatus( com.google.cloud.dialogflow.v2.Document.ReloadStatus value)3931     public Builder setLatestReloadStatus(
3932         com.google.cloud.dialogflow.v2.Document.ReloadStatus value) {
3933       if (latestReloadStatusBuilder_ == null) {
3934         if (value == null) {
3935           throw new NullPointerException();
3936         }
3937         latestReloadStatus_ = value;
3938       } else {
3939         latestReloadStatusBuilder_.setMessage(value);
3940       }
3941       bitField0_ |= 0x00000080;
3942       onChanged();
3943       return this;
3944     }
3945     /**
3946      *
3947      *
3948      * <pre>
3949      * Output only. The time and status of the latest reload.
3950      * This reload may have been triggered automatically or manually
3951      * and may not have succeeded.
3952      * </pre>
3953      *
3954      * <code>
3955      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
3956      * </code>
3957      */
setLatestReloadStatus( com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder builderForValue)3958     public Builder setLatestReloadStatus(
3959         com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder builderForValue) {
3960       if (latestReloadStatusBuilder_ == null) {
3961         latestReloadStatus_ = builderForValue.build();
3962       } else {
3963         latestReloadStatusBuilder_.setMessage(builderForValue.build());
3964       }
3965       bitField0_ |= 0x00000080;
3966       onChanged();
3967       return this;
3968     }
3969     /**
3970      *
3971      *
3972      * <pre>
3973      * Output only. The time and status of the latest reload.
3974      * This reload may have been triggered automatically or manually
3975      * and may not have succeeded.
3976      * </pre>
3977      *
3978      * <code>
3979      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
3980      * </code>
3981      */
mergeLatestReloadStatus( com.google.cloud.dialogflow.v2.Document.ReloadStatus value)3982     public Builder mergeLatestReloadStatus(
3983         com.google.cloud.dialogflow.v2.Document.ReloadStatus value) {
3984       if (latestReloadStatusBuilder_ == null) {
3985         if (((bitField0_ & 0x00000080) != 0)
3986             && latestReloadStatus_ != null
3987             && latestReloadStatus_
3988                 != com.google.cloud.dialogflow.v2.Document.ReloadStatus.getDefaultInstance()) {
3989           getLatestReloadStatusBuilder().mergeFrom(value);
3990         } else {
3991           latestReloadStatus_ = value;
3992         }
3993       } else {
3994         latestReloadStatusBuilder_.mergeFrom(value);
3995       }
3996       bitField0_ |= 0x00000080;
3997       onChanged();
3998       return this;
3999     }
4000     /**
4001      *
4002      *
4003      * <pre>
4004      * Output only. The time and status of the latest reload.
4005      * This reload may have been triggered automatically or manually
4006      * and may not have succeeded.
4007      * </pre>
4008      *
4009      * <code>
4010      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
4011      * </code>
4012      */
clearLatestReloadStatus()4013     public Builder clearLatestReloadStatus() {
4014       bitField0_ = (bitField0_ & ~0x00000080);
4015       latestReloadStatus_ = null;
4016       if (latestReloadStatusBuilder_ != null) {
4017         latestReloadStatusBuilder_.dispose();
4018         latestReloadStatusBuilder_ = null;
4019       }
4020       onChanged();
4021       return this;
4022     }
4023     /**
4024      *
4025      *
4026      * <pre>
4027      * Output only. The time and status of the latest reload.
4028      * This reload may have been triggered automatically or manually
4029      * and may not have succeeded.
4030      * </pre>
4031      *
4032      * <code>
4033      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
4034      * </code>
4035      */
4036     public com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder
getLatestReloadStatusBuilder()4037         getLatestReloadStatusBuilder() {
4038       bitField0_ |= 0x00000080;
4039       onChanged();
4040       return getLatestReloadStatusFieldBuilder().getBuilder();
4041     }
4042     /**
4043      *
4044      *
4045      * <pre>
4046      * Output only. The time and status of the latest reload.
4047      * This reload may have been triggered automatically or manually
4048      * and may not have succeeded.
4049      * </pre>
4050      *
4051      * <code>
4052      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
4053      * </code>
4054      */
4055     public com.google.cloud.dialogflow.v2.Document.ReloadStatusOrBuilder
getLatestReloadStatusOrBuilder()4056         getLatestReloadStatusOrBuilder() {
4057       if (latestReloadStatusBuilder_ != null) {
4058         return latestReloadStatusBuilder_.getMessageOrBuilder();
4059       } else {
4060         return latestReloadStatus_ == null
4061             ? com.google.cloud.dialogflow.v2.Document.ReloadStatus.getDefaultInstance()
4062             : latestReloadStatus_;
4063       }
4064     }
4065     /**
4066      *
4067      *
4068      * <pre>
4069      * Output only. The time and status of the latest reload.
4070      * This reload may have been triggered automatically or manually
4071      * and may not have succeeded.
4072      * </pre>
4073      *
4074      * <code>
4075      * .google.cloud.dialogflow.v2.Document.ReloadStatus latest_reload_status = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];
4076      * </code>
4077      */
4078     private com.google.protobuf.SingleFieldBuilderV3<
4079             com.google.cloud.dialogflow.v2.Document.ReloadStatus,
4080             com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder,
4081             com.google.cloud.dialogflow.v2.Document.ReloadStatusOrBuilder>
getLatestReloadStatusFieldBuilder()4082         getLatestReloadStatusFieldBuilder() {
4083       if (latestReloadStatusBuilder_ == null) {
4084         latestReloadStatusBuilder_ =
4085             new com.google.protobuf.SingleFieldBuilderV3<
4086                 com.google.cloud.dialogflow.v2.Document.ReloadStatus,
4087                 com.google.cloud.dialogflow.v2.Document.ReloadStatus.Builder,
4088                 com.google.cloud.dialogflow.v2.Document.ReloadStatusOrBuilder>(
4089                 getLatestReloadStatus(), getParentForChildren(), isClean());
4090         latestReloadStatus_ = null;
4091       }
4092       return latestReloadStatusBuilder_;
4093     }
4094 
4095     private com.google.protobuf.MapField<java.lang.String, java.lang.String> metadata_;
4096 
internalGetMetadata()4097     private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMetadata() {
4098       if (metadata_ == null) {
4099         return com.google.protobuf.MapField.emptyMapField(MetadataDefaultEntryHolder.defaultEntry);
4100       }
4101       return metadata_;
4102     }
4103 
4104     private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetMutableMetadata()4105         internalGetMutableMetadata() {
4106       if (metadata_ == null) {
4107         metadata_ =
4108             com.google.protobuf.MapField.newMapField(MetadataDefaultEntryHolder.defaultEntry);
4109       }
4110       if (!metadata_.isMutable()) {
4111         metadata_ = metadata_.copy();
4112       }
4113       bitField0_ |= 0x00000100;
4114       onChanged();
4115       return metadata_;
4116     }
4117 
getMetadataCount()4118     public int getMetadataCount() {
4119       return internalGetMetadata().getMap().size();
4120     }
4121     /**
4122      *
4123      *
4124      * <pre>
4125      * Optional. Metadata for the document. The metadata supports arbitrary
4126      * key-value pairs. Suggested use cases include storing a document's title,
4127      * an external URL distinct from the document's content_uri, etc.
4128      * The max size of a `key` or a `value` of the metadata is 1024 bytes.
4129      * </pre>
4130      *
4131      * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
4132      * </code>
4133      */
4134     @java.lang.Override
containsMetadata(java.lang.String key)4135     public boolean containsMetadata(java.lang.String key) {
4136       if (key == null) {
4137         throw new NullPointerException("map key");
4138       }
4139       return internalGetMetadata().getMap().containsKey(key);
4140     }
4141     /** Use {@link #getMetadataMap()} instead. */
4142     @java.lang.Override
4143     @java.lang.Deprecated
getMetadata()4144     public java.util.Map<java.lang.String, java.lang.String> getMetadata() {
4145       return getMetadataMap();
4146     }
4147     /**
4148      *
4149      *
4150      * <pre>
4151      * Optional. Metadata for the document. The metadata supports arbitrary
4152      * key-value pairs. Suggested use cases include storing a document's title,
4153      * an external URL distinct from the document's content_uri, etc.
4154      * The max size of a `key` or a `value` of the metadata is 1024 bytes.
4155      * </pre>
4156      *
4157      * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
4158      * </code>
4159      */
4160     @java.lang.Override
getMetadataMap()4161     public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() {
4162       return internalGetMetadata().getMap();
4163     }
4164     /**
4165      *
4166      *
4167      * <pre>
4168      * Optional. Metadata for the document. The metadata supports arbitrary
4169      * key-value pairs. Suggested use cases include storing a document's title,
4170      * an external URL distinct from the document's content_uri, etc.
4171      * The max size of a `key` or a `value` of the metadata is 1024 bytes.
4172      * </pre>
4173      *
4174      * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
4175      * </code>
4176      */
4177     @java.lang.Override
getMetadataOrDefault( java.lang.String key, java.lang.String defaultValue)4178     public /* nullable */ java.lang.String getMetadataOrDefault(
4179         java.lang.String key,
4180         /* nullable */
4181         java.lang.String defaultValue) {
4182       if (key == null) {
4183         throw new NullPointerException("map key");
4184       }
4185       java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
4186       return map.containsKey(key) ? map.get(key) : defaultValue;
4187     }
4188     /**
4189      *
4190      *
4191      * <pre>
4192      * Optional. Metadata for the document. The metadata supports arbitrary
4193      * key-value pairs. Suggested use cases include storing a document's title,
4194      * an external URL distinct from the document's content_uri, etc.
4195      * The max size of a `key` or a `value` of the metadata is 1024 bytes.
4196      * </pre>
4197      *
4198      * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
4199      * </code>
4200      */
4201     @java.lang.Override
getMetadataOrThrow(java.lang.String key)4202     public java.lang.String getMetadataOrThrow(java.lang.String key) {
4203       if (key == null) {
4204         throw new NullPointerException("map key");
4205       }
4206       java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap();
4207       if (!map.containsKey(key)) {
4208         throw new java.lang.IllegalArgumentException();
4209       }
4210       return map.get(key);
4211     }
4212 
clearMetadata()4213     public Builder clearMetadata() {
4214       bitField0_ = (bitField0_ & ~0x00000100);
4215       internalGetMutableMetadata().getMutableMap().clear();
4216       return this;
4217     }
4218     /**
4219      *
4220      *
4221      * <pre>
4222      * Optional. Metadata for the document. The metadata supports arbitrary
4223      * key-value pairs. Suggested use cases include storing a document's title,
4224      * an external URL distinct from the document's content_uri, etc.
4225      * The max size of a `key` or a `value` of the metadata is 1024 bytes.
4226      * </pre>
4227      *
4228      * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
4229      * </code>
4230      */
removeMetadata(java.lang.String key)4231     public Builder removeMetadata(java.lang.String key) {
4232       if (key == null) {
4233         throw new NullPointerException("map key");
4234       }
4235       internalGetMutableMetadata().getMutableMap().remove(key);
4236       return this;
4237     }
4238     /** Use alternate mutation accessors instead. */
4239     @java.lang.Deprecated
getMutableMetadata()4240     public java.util.Map<java.lang.String, java.lang.String> getMutableMetadata() {
4241       bitField0_ |= 0x00000100;
4242       return internalGetMutableMetadata().getMutableMap();
4243     }
4244     /**
4245      *
4246      *
4247      * <pre>
4248      * Optional. Metadata for the document. The metadata supports arbitrary
4249      * key-value pairs. Suggested use cases include storing a document's title,
4250      * an external URL distinct from the document's content_uri, etc.
4251      * The max size of a `key` or a `value` of the metadata is 1024 bytes.
4252      * </pre>
4253      *
4254      * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
4255      * </code>
4256      */
putMetadata(java.lang.String key, java.lang.String value)4257     public Builder putMetadata(java.lang.String key, java.lang.String value) {
4258       if (key == null) {
4259         throw new NullPointerException("map key");
4260       }
4261       if (value == null) {
4262         throw new NullPointerException("map value");
4263       }
4264       internalGetMutableMetadata().getMutableMap().put(key, value);
4265       bitField0_ |= 0x00000100;
4266       return this;
4267     }
4268     /**
4269      *
4270      *
4271      * <pre>
4272      * Optional. Metadata for the document. The metadata supports arbitrary
4273      * key-value pairs. Suggested use cases include storing a document's title,
4274      * an external URL distinct from the document's content_uri, etc.
4275      * The max size of a `key` or a `value` of the metadata is 1024 bytes.
4276      * </pre>
4277      *
4278      * <code>map&lt;string, string&gt; metadata = 7 [(.google.api.field_behavior) = OPTIONAL];
4279      * </code>
4280      */
putAllMetadata(java.util.Map<java.lang.String, java.lang.String> values)4281     public Builder putAllMetadata(java.util.Map<java.lang.String, java.lang.String> values) {
4282       internalGetMutableMetadata().getMutableMap().putAll(values);
4283       bitField0_ |= 0x00000100;
4284       return this;
4285     }
4286 
4287     private int state_ = 0;
4288     /**
4289      *
4290      *
4291      * <pre>
4292      * Output only. The current state of the document.
4293      * </pre>
4294      *
4295      * <code>
4296      * .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
4297      * </code>
4298      *
4299      * @return The enum numeric value on the wire for state.
4300      */
4301     @java.lang.Override
getStateValue()4302     public int getStateValue() {
4303       return state_;
4304     }
4305     /**
4306      *
4307      *
4308      * <pre>
4309      * Output only. The current state of the document.
4310      * </pre>
4311      *
4312      * <code>
4313      * .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
4314      * </code>
4315      *
4316      * @param value The enum numeric value on the wire for state to set.
4317      * @return This builder for chaining.
4318      */
setStateValue(int value)4319     public Builder setStateValue(int value) {
4320       state_ = value;
4321       bitField0_ |= 0x00000200;
4322       onChanged();
4323       return this;
4324     }
4325     /**
4326      *
4327      *
4328      * <pre>
4329      * Output only. The current state of the document.
4330      * </pre>
4331      *
4332      * <code>
4333      * .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
4334      * </code>
4335      *
4336      * @return The state.
4337      */
4338     @java.lang.Override
getState()4339     public com.google.cloud.dialogflow.v2.Document.State getState() {
4340       com.google.cloud.dialogflow.v2.Document.State result =
4341           com.google.cloud.dialogflow.v2.Document.State.forNumber(state_);
4342       return result == null ? com.google.cloud.dialogflow.v2.Document.State.UNRECOGNIZED : result;
4343     }
4344     /**
4345      *
4346      *
4347      * <pre>
4348      * Output only. The current state of the document.
4349      * </pre>
4350      *
4351      * <code>
4352      * .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
4353      * </code>
4354      *
4355      * @param value The state to set.
4356      * @return This builder for chaining.
4357      */
setState(com.google.cloud.dialogflow.v2.Document.State value)4358     public Builder setState(com.google.cloud.dialogflow.v2.Document.State value) {
4359       if (value == null) {
4360         throw new NullPointerException();
4361       }
4362       bitField0_ |= 0x00000200;
4363       state_ = value.getNumber();
4364       onChanged();
4365       return this;
4366     }
4367     /**
4368      *
4369      *
4370      * <pre>
4371      * Output only. The current state of the document.
4372      * </pre>
4373      *
4374      * <code>
4375      * .google.cloud.dialogflow.v2.Document.State state = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];
4376      * </code>
4377      *
4378      * @return This builder for chaining.
4379      */
clearState()4380     public Builder clearState() {
4381       bitField0_ = (bitField0_ & ~0x00000200);
4382       state_ = 0;
4383       onChanged();
4384       return this;
4385     }
4386 
4387     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)4388     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
4389       return super.setUnknownFields(unknownFields);
4390     }
4391 
4392     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4393     public final Builder mergeUnknownFields(
4394         final com.google.protobuf.UnknownFieldSet unknownFields) {
4395       return super.mergeUnknownFields(unknownFields);
4396     }
4397 
4398     // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.Document)
4399   }
4400 
4401   // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.Document)
4402   private static final com.google.cloud.dialogflow.v2.Document DEFAULT_INSTANCE;
4403 
4404   static {
4405     DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.Document();
4406   }
4407 
getDefaultInstance()4408   public static com.google.cloud.dialogflow.v2.Document getDefaultInstance() {
4409     return DEFAULT_INSTANCE;
4410   }
4411 
4412   private static final com.google.protobuf.Parser<Document> PARSER =
4413       new com.google.protobuf.AbstractParser<Document>() {
4414         @java.lang.Override
4415         public Document parsePartialFrom(
4416             com.google.protobuf.CodedInputStream input,
4417             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
4418             throws com.google.protobuf.InvalidProtocolBufferException {
4419           Builder builder = newBuilder();
4420           try {
4421             builder.mergeFrom(input, extensionRegistry);
4422           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
4423             throw e.setUnfinishedMessage(builder.buildPartial());
4424           } catch (com.google.protobuf.UninitializedMessageException e) {
4425             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
4426           } catch (java.io.IOException e) {
4427             throw new com.google.protobuf.InvalidProtocolBufferException(e)
4428                 .setUnfinishedMessage(builder.buildPartial());
4429           }
4430           return builder.buildPartial();
4431         }
4432       };
4433 
parser()4434   public static com.google.protobuf.Parser<Document> parser() {
4435     return PARSER;
4436   }
4437 
4438   @java.lang.Override
getParserForType()4439   public com.google.protobuf.Parser<Document> getParserForType() {
4440     return PARSER;
4441   }
4442 
4443   @java.lang.Override
getDefaultInstanceForType()4444   public com.google.cloud.dialogflow.v2.Document getDefaultInstanceForType() {
4445     return DEFAULT_INSTANCE;
4446   }
4447 }
4448