From ec1c6ab30d07faf29f6dc75547e18dbfb147d545 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 17:54:19 -0800 Subject: [PATCH 1/9] changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- .../cloud/dialogflow/cx/v3beta1/Match.java | 208 ------------------ .../dialogflow/cx/v3beta1/MatchOrBuilder.java | 27 --- .../dialogflow/cx/v3beta1/SessionProto.java | 157 +++++++------ .../cloud/dialogflow/cx/v3beta1/session.proto | 7 - synth.metadata | 10 +- 5 files changed, 87 insertions(+), 322 deletions(-) diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java index 130016604..6b8650c66 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java @@ -38,7 +38,6 @@ private Match(com.google.protobuf.GeneratedMessageV3.Builder builder) { } private Match() { - event_ = ""; resolvedInput_ = ""; matchType_ = 0; } @@ -122,13 +121,6 @@ private Match( confidence_ = input.readFloat(); break; } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); - - event_ = s; - break; - } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -233,16 +225,6 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum { * NO_INPUT = 5; */ NO_INPUT(5), - /** - * - * - *
-     * The query directly triggered an event.
-     * 
- * - * EVENT = 6; - */ - EVENT(6), UNRECOGNIZED(-1), ; @@ -306,16 +288,6 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum { * NO_INPUT = 5; */ public static final int NO_INPUT_VALUE = 5; - /** - * - * - *
-     * The query directly triggered an event.
-     * 
- * - * EVENT = 6; - */ - public static final int EVENT_VALUE = 6; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -353,8 +325,6 @@ public static MatchType forNumber(int value) { return NO_MATCH; case 5: return NO_INPUT; - case 6: - return EVENT; default: return null; } @@ -462,57 +432,6 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder return getIntent(); } - public static final int EVENT_FIELD_NUMBER = 6; - private volatile java.lang.Object event_; - /** - * - * - *
-   * The event that matched the query. Only filled for
-   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-   * 
- * - * string event = 6; - * - * @return The event. - */ - @java.lang.Override - public java.lang.String getEvent() { - java.lang.Object ref = event_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - event_ = s; - return s; - } - } - /** - * - * - *
-   * The event that matched the query. Only filled for
-   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-   * 
- * - * string event = 6; - * - * @return The bytes for event. - */ - @java.lang.Override - public com.google.protobuf.ByteString getEventBytes() { - java.lang.Object ref = event_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - event_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - public static final int PARAMETERS_FIELD_NUMBER = 2; private com.google.protobuf.Struct parameters_; /** @@ -740,9 +659,6 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (confidence_ != 0F) { output.writeFloat(5, confidence_); } - if (!getEventBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, event_); - } unknownFields.writeTo(output); } @@ -769,9 +685,6 @@ public int getSerializedSize() { if (confidence_ != 0F) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_); } - if (!getEventBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, event_); - } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -792,7 +705,6 @@ public boolean equals(final java.lang.Object obj) { if (hasIntent()) { if (!getIntent().equals(other.getIntent())) return false; } - if (!getEvent().equals(other.getEvent())) return false; if (hasParameters() != other.hasParameters()) return false; if (hasParameters()) { if (!getParameters().equals(other.getParameters())) return false; @@ -816,8 +728,6 @@ public int hashCode() { hash = (37 * hash) + INTENT_FIELD_NUMBER; hash = (53 * hash) + getIntent().hashCode(); } - hash = (37 * hash) + EVENT_FIELD_NUMBER; - hash = (53 * hash) + getEvent().hashCode(); if (hasParameters()) { hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; hash = (53 * hash) + getParameters().hashCode(); @@ -979,8 +889,6 @@ public Builder clear() { intent_ = null; intentBuilder_ = null; } - event_ = ""; - if (parametersBuilder_ == null) { parameters_ = null; } else { @@ -1025,7 +933,6 @@ public com.google.cloud.dialogflow.cx.v3beta1.Match buildPartial() { } else { result.intent_ = intentBuilder_.build(); } - result.event_ = event_; if (parametersBuilder_ == null) { result.parameters_ = parameters_; } else { @@ -1086,10 +993,6 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Match other) { if (other.hasIntent()) { mergeIntent(other.getIntent()); } - if (!other.getEvent().isEmpty()) { - event_ = other.event_; - onChanged(); - } if (other.hasParameters()) { mergeParameters(other.getParameters()); } @@ -1336,117 +1239,6 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder return intentBuilder_; } - private java.lang.Object event_ = ""; - /** - * - * - *
-     * The event that matched the query. Only filled for
-     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-     * 
- * - * string event = 6; - * - * @return The event. - */ - public java.lang.String getEvent() { - java.lang.Object ref = event_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - event_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-     * The event that matched the query. Only filled for
-     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-     * 
- * - * string event = 6; - * - * @return The bytes for event. - */ - public com.google.protobuf.ByteString getEventBytes() { - java.lang.Object ref = event_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - event_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-     * The event that matched the query. Only filled for
-     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-     * 
- * - * string event = 6; - * - * @param value The event to set. - * @return This builder for chaining. - */ - public Builder setEvent(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - event_ = value; - onChanged(); - return this; - } - /** - * - * - *
-     * The event that matched the query. Only filled for
-     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-     * 
- * - * string event = 6; - * - * @return This builder for chaining. - */ - public Builder clearEvent() { - - event_ = getDefaultInstance().getEvent(); - onChanged(); - return this; - } - /** - * - * - *
-     * The event that matched the query. Only filled for
-     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-     * 
- * - * string event = 6; - * - * @param value The bytes for event to set. - * @return This builder for chaining. - */ - public Builder setEventBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - event_ = value; - onChanged(); - return this; - } - private com.google.protobuf.Struct parameters_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Struct, diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java index 0a9eef550..633982743 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java @@ -64,33 +64,6 @@ public interface MatchOrBuilder */ com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder(); - /** - * - * - *
-   * The event that matched the query. Only filled for
-   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-   * 
- * - * string event = 6; - * - * @return The event. - */ - java.lang.String getEvent(); - /** - * - * - *
-   * The event that matched the query. Only filled for
-   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
-   * 
- * - * string event = 6; - * - * @return The bytes for event. - */ - com.google.protobuf.ByteString getEventBytes(); - /** * * diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java index f76943b5f..653b7ab28 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java @@ -208,84 +208,83 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "v3beta1.InputAudioConfigB\003\340A\002\022\r\n\005audio\030\002" + " \001(\014\"\033\n\nEventInput\022\r\n\005event\030\001 \001(\t\"1\n\tDtm" + "fInput\022\016\n\006digits\030\001 \001(\t\022\024\n\014finish_digit\030\002" - + " \001(\t\"\373\002\n\005Match\022:\n\006intent\030\001 \001(\0132*.google." - + "cloud.dialogflow.cx.v3beta1.Intent\022\r\n\005ev" - + "ent\030\006 \001(\t\022+\n\nparameters\030\002 \001(\0132\027.google.p" - + "rotobuf.Struct\022\026\n\016resolved_input\030\003 \001(\t\022G" - + "\n\nmatch_type\030\004 \001(\01623.google.cloud.dialog" - + "flow.cx.v3beta1.Match.MatchType\022\022\n\nconfi" - + "dence\030\005 \001(\002\"\204\001\n\tMatchType\022\032\n\026MATCH_TYPE_" - + "UNSPECIFIED\020\000\022\n\n\006INTENT\020\001\022\021\n\rDIRECT_INTE" - + "NT\020\002\022\025\n\021PARAMETER_FILLING\020\003\022\014\n\010NO_MATCH\020" - + "\004\022\014\n\010NO_INPUT\020\005\022\t\n\005EVENT\020\006\"\345\001\n\022MatchInte" - + "ntRequest\022:\n\007session\030\001 \001(\tB)\340A\002\372A#\n!dial" - + "ogflow.googleapis.com/Session\022I\n\014query_p" - + "arams\030\002 \001(\01323.google.cloud.dialogflow.cx" - + ".v3beta1.QueryParameters\022H\n\013query_input\030" - + "\003 \001(\0132..google.cloud.dialogflow.cx.v3bet" - + "a1.QueryInputB\003\340A\002\"\363\001\n\023MatchIntentRespon" - + "se\022\016\n\004text\030\001 \001(\tH\000\022\030\n\016trigger_intent\030\002 \001" - + "(\tH\000\022\024\n\ntranscript\030\003 \001(\tH\000\022\027\n\rtrigger_ev" - + "ent\030\006 \001(\tH\000\022:\n\007matches\030\004 \003(\0132).google.cl" - + "oud.dialogflow.cx.v3beta1.Match\022>\n\014curre" - + "nt_page\030\005 \001(\0132(.google.cloud.dialogflow." - + "cx.v3beta1.PageB\007\n\005query\"\372\001\n\024FulfillInte" - + "ntRequest\022T\n\024match_intent_request\030\001 \001(\0132" - + "6.google.cloud.dialogflow.cx.v3beta1.Mat" - + "chIntentRequest\0228\n\005match\030\002 \001(\0132).google." - + "cloud.dialogflow.cx.v3beta1.Match\022R\n\023out" - + "put_audio_config\030\003 \001(\01325.google.cloud.di" - + "alogflow.cx.v3beta1.OutputAudioConfig\"\335\001" - + "\n\025FulfillIntentResponse\022\023\n\013response_id\030\001" - + " \001(\t\022E\n\014query_result\030\002 \001(\0132/.google.clou" - + "d.dialogflow.cx.v3beta1.QueryResult\022\024\n\014o" - + "utput_audio\030\003 \001(\014\022R\n\023output_audio_config" - + "\030\004 \001(\01325.google.cloud.dialogflow.cx.v3be" - + "ta1.OutputAudioConfig\";\n\027SentimentAnalys" - + "isResult\022\r\n\005score\030\001 \001(\002\022\021\n\tmagnitude\030\002 \001" - + "(\0022\212\n\n\010Sessions\022\272\002\n\014DetectIntent\0227.googl" - + "e.cloud.dialogflow.cx.v3beta1.DetectInte" - + "ntRequest\0328.google.cloud.dialogflow.cx.v" - + "3beta1.DetectIntentResponse\"\266\001\202\323\344\223\002\257\001\"J/" - + "v3beta1/{session=projects/*/locations/*/" - + "agents/*/sessions/*}:detectIntent:\001*Z^\"Y" - + "/v3beta1/{session=projects/*/locations/*" - + "/agents/*/environments/*/sessions/*}:det" - + "ectIntent:\001*\022\242\001\n\025StreamingDetectIntent\022@" - + ".google.cloud.dialogflow.cx.v3beta1.Stre" - + "amingDetectIntentRequest\032A.google.cloud." - + "dialogflow.cx.v3beta1.StreamingDetectInt" - + "entResponse\"\000(\0010\001\022\265\002\n\013MatchIntent\0226.goog" - + "le.cloud.dialogflow.cx.v3beta1.MatchInte" - + "ntRequest\0327.google.cloud.dialogflow.cx.v" - + "3beta1.MatchIntentResponse\"\264\001\202\323\344\223\002\255\001\"I/v" - + "3beta1/{session=projects/*/locations/*/a" - + "gents/*/sessions/*}:matchIntent:\001*Z]\"X/v" - + "3beta1/{session=projects/*/locations/*/a" - + "gents/*/environments/*/sessions/*}:match" - + "Intent:\001*\022\351\002\n\rFulfillIntent\0228.google.clo" - + "ud.dialogflow.cx.v3beta1.FulfillIntentRe" - + "quest\0329.google.cloud.dialogflow.cx.v3bet" - + "a1.FulfillIntentResponse\"\342\001\202\323\344\223\002\333\001\"`/v3b" - + "eta1/{match_intent_request.session=proje" - + "cts/*/locations/*/agents/*/sessions/*}:f" - + "ulfillIntent:\001*Zt\"o/v3beta1/{match_inten" - + "t_request.session=projects/*/locations/*" - + "/agents/*/environments/*/sessions/*}:ful" - + "fillIntent:\001*\032x\312A\031dialogflow.googleapis." - + "com\322AYhttps://www.googleapis.com/auth/cl" - + "oud-platform,https://www.googleapis.com/" - + "auth/dialogflowB\203\003\n&com.google.cloud.dia" - + "logflow.cx.v3beta1B\014SessionProtoP\001ZDgoog" - + "le.golang.org/genproto/googleapis/cloud/" - + "dialogflow/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Googl" - + "e.Cloud.Dialogflow.Cx.V3Beta1\352A\324\001\n!dialo" - + "gflow.googleapis.com/Session\022Iprojects/{" - + "project}/locations/{location}/agents/{ag" - + "ent}/sessions/{session}\022dprojects/{proje" - + "ct}/locations/{location}/agents/{agent}/" - + "environments/{environment}/sessions/{ses" - + "sion}b\006proto3" + + " \001(\t\"\340\002\n\005Match\022:\n\006intent\030\001 \001(\0132*.google." + + "cloud.dialogflow.cx.v3beta1.Intent\022+\n\npa" + + "rameters\030\002 \001(\0132\027.google.protobuf.Struct\022" + + "\026\n\016resolved_input\030\003 \001(\t\022G\n\nmatch_type\030\004 " + + "\001(\01623.google.cloud.dialogflow.cx.v3beta1" + + ".Match.MatchType\022\022\n\nconfidence\030\005 \001(\002\"y\n\t" + + "MatchType\022\032\n\026MATCH_TYPE_UNSPECIFIED\020\000\022\n\n" + + "\006INTENT\020\001\022\021\n\rDIRECT_INTENT\020\002\022\025\n\021PARAMETE" + + "R_FILLING\020\003\022\014\n\010NO_MATCH\020\004\022\014\n\010NO_INPUT\020\005\"" + + "\345\001\n\022MatchIntentRequest\022:\n\007session\030\001 \001(\tB" + + ")\340A\002\372A#\n!dialogflow.googleapis.com/Sessi" + + "on\022I\n\014query_params\030\002 \001(\01323.google.cloud." + + "dialogflow.cx.v3beta1.QueryParameters\022H\n" + + "\013query_input\030\003 \001(\0132..google.cloud.dialog" + + "flow.cx.v3beta1.QueryInputB\003\340A\002\"\363\001\n\023Matc" + + "hIntentResponse\022\016\n\004text\030\001 \001(\tH\000\022\030\n\016trigg" + + "er_intent\030\002 \001(\tH\000\022\024\n\ntranscript\030\003 \001(\tH\000\022" + + "\027\n\rtrigger_event\030\006 \001(\tH\000\022:\n\007matches\030\004 \003(" + + "\0132).google.cloud.dialogflow.cx.v3beta1.M" + + "atch\022>\n\014current_page\030\005 \001(\0132(.google.clou" + + "d.dialogflow.cx.v3beta1.PageB\007\n\005query\"\372\001" + + "\n\024FulfillIntentRequest\022T\n\024match_intent_r" + + "equest\030\001 \001(\01326.google.cloud.dialogflow.c" + + "x.v3beta1.MatchIntentRequest\0228\n\005match\030\002 " + + "\001(\0132).google.cloud.dialogflow.cx.v3beta1" + + ".Match\022R\n\023output_audio_config\030\003 \001(\01325.go" + + "ogle.cloud.dialogflow.cx.v3beta1.OutputA" + + "udioConfig\"\335\001\n\025FulfillIntentResponse\022\023\n\013" + + "response_id\030\001 \001(\t\022E\n\014query_result\030\002 \001(\0132" + + "/.google.cloud.dialogflow.cx.v3beta1.Que" + + "ryResult\022\024\n\014output_audio\030\003 \001(\014\022R\n\023output" + + "_audio_config\030\004 \001(\01325.google.cloud.dialo" + + "gflow.cx.v3beta1.OutputAudioConfig\";\n\027Se" + + "ntimentAnalysisResult\022\r\n\005score\030\001 \001(\002\022\021\n\t" + + "magnitude\030\002 \001(\0022\212\n\n\010Sessions\022\272\002\n\014DetectI" + + "ntent\0227.google.cloud.dialogflow.cx.v3bet" + + "a1.DetectIntentRequest\0328.google.cloud.di" + + "alogflow.cx.v3beta1.DetectIntentResponse" + + "\"\266\001\202\323\344\223\002\257\001\"J/v3beta1/{session=projects/*" + + "/locations/*/agents/*/sessions/*}:detect" + + "Intent:\001*Z^\"Y/v3beta1/{session=projects/" + + "*/locations/*/agents/*/environments/*/se" + + "ssions/*}:detectIntent:\001*\022\242\001\n\025StreamingD" + + "etectIntent\022@.google.cloud.dialogflow.cx" + + ".v3beta1.StreamingDetectIntentRequest\032A." + + "google.cloud.dialogflow.cx.v3beta1.Strea" + + "mingDetectIntentResponse\"\000(\0010\001\022\265\002\n\013Match" + + "Intent\0226.google.cloud.dialogflow.cx.v3be" + + "ta1.MatchIntentRequest\0327.google.cloud.di" + + "alogflow.cx.v3beta1.MatchIntentResponse\"" + + "\264\001\202\323\344\223\002\255\001\"I/v3beta1/{session=projects/*/" + + "locations/*/agents/*/sessions/*}:matchIn" + + "tent:\001*Z]\"X/v3beta1/{session=projects/*/" + + "locations/*/agents/*/environments/*/sess" + + "ions/*}:matchIntent:\001*\022\351\002\n\rFulfillIntent" + + "\0228.google.cloud.dialogflow.cx.v3beta1.Fu" + + "lfillIntentRequest\0329.google.cloud.dialog" + + "flow.cx.v3beta1.FulfillIntentResponse\"\342\001" + + "\202\323\344\223\002\333\001\"`/v3beta1/{match_intent_request." + + "session=projects/*/locations/*/agents/*/" + + "sessions/*}:fulfillIntent:\001*Zt\"o/v3beta1" + + "/{match_intent_request.session=projects/" + + "*/locations/*/agents/*/environments/*/se" + + "ssions/*}:fulfillIntent:\001*\032x\312A\031dialogflo" + + "w.googleapis.com\322AYhttps://www.googleapi" + + "s.com/auth/cloud-platform,https://www.go" + + "ogleapis.com/auth/dialogflowB\203\003\n&com.goo" + + "gle.cloud.dialogflow.cx.v3beta1B\014Session" + + "ProtoP\001ZDgoogle.golang.org/genproto/goog" + + "leapis/cloud/dialogflow/cx/v3beta1;cx\370\001\001" + + "\242\002\002DF\252\002\"Google.Cloud.Dialogflow.Cx.V3Bet" + + "a1\352A\324\001\n!dialogflow.googleapis.com/Sessio" + + "n\022Iprojects/{project}/locations/{locatio" + + "n}/agents/{agent}/sessions/{session}\022dpr" + + "ojects/{project}/locations/{location}/ag" + + "ents/{agent}/environments/{environment}/" + + "sessions/{session}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -442,7 +441,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor, new java.lang.String[] { - "Intent", "Event", "Parameters", "ResolvedInput", "MatchType", "Confidence", + "Intent", "Parameters", "ResolvedInput", "MatchType", "Confidence", }); internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor = getDescriptor().getMessageTypes().get(14); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto index 9b94a19db..397c20787 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -576,9 +576,6 @@ message Match { // Indicates an empty query. NO_INPUT = 5; - - // The query directly triggered an event. - EVENT = 6; } // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in @@ -586,10 +583,6 @@ message Match { // filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type. Intent intent = 1; - // The event that matched the query. Only filled for - // [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type. - string event = 6; - // The collection of parameters extracted from the query. // // Depending on your protocol or client library language, this is a diff --git a/synth.metadata b/synth.metadata index 321ec7622..e35bed147 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,7 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-dialogflow-cx.git", - "sha": "522605306b3de5af16aec2d786a4b8048cccda11" + "sha": "d5edca3dfa256fabcb10d86bb46ed7ca61ff0872" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "6c0f55f33f882cf97fd3135e93b144ad9c94ebab", + "internalRef": "341478628" } }, { From ace749fae2157205bb5f61575992ade0bad0956a Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:04:29 -0800 Subject: [PATCH 2/9] feat: expose matched event in Sessions API. PiperOrigin-RevId: 342188199 Source-Author: Google APIs Source-Date: Thu Nov 12 20:27:55 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 836f0eaf5f21f300f63ac635e5ef263d183e0cdd Source-Link: https://github.com/googleapis/googleapis/commit/836f0eaf5f21f300f63ac635e5ef263d183e0cdd --- .../cloud/dialogflow/cx/v3beta1/Match.java | 208 ++++++++++++++++++ .../dialogflow/cx/v3beta1/MatchOrBuilder.java | 27 +++ .../dialogflow/cx/v3beta1/SessionProto.java | 157 ++++++------- .../cloud/dialogflow/cx/v3beta1/session.proto | 7 + synth.metadata | 8 +- 5 files changed, 325 insertions(+), 82 deletions(-) diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java index 6b8650c66..130016604 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/Match.java @@ -38,6 +38,7 @@ private Match(com.google.protobuf.GeneratedMessageV3.Builder builder) { } private Match() { + event_ = ""; resolvedInput_ = ""; matchType_ = 0; } @@ -121,6 +122,13 @@ private Match( confidence_ = input.readFloat(); break; } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + event_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -225,6 +233,16 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum { * NO_INPUT = 5; */ NO_INPUT(5), + /** + * + * + *
+     * The query directly triggered an event.
+     * 
+ * + * EVENT = 6; + */ + EVENT(6), UNRECOGNIZED(-1), ; @@ -288,6 +306,16 @@ public enum MatchType implements com.google.protobuf.ProtocolMessageEnum { * NO_INPUT = 5; */ public static final int NO_INPUT_VALUE = 5; + /** + * + * + *
+     * The query directly triggered an event.
+     * 
+ * + * EVENT = 6; + */ + public static final int EVENT_VALUE = 6; public final int getNumber() { if (this == UNRECOGNIZED) { @@ -325,6 +353,8 @@ public static MatchType forNumber(int value) { return NO_MATCH; case 5: return NO_INPUT; + case 6: + return EVENT; default: return null; } @@ -432,6 +462,57 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder return getIntent(); } + public static final int EVENT_FIELD_NUMBER = 6; + private volatile java.lang.Object event_; + /** + * + * + *
+   * The event that matched the query. Only filled for
+   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * string event = 6; + * + * @return The event. + */ + @java.lang.Override + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } + } + /** + * + * + *
+   * The event that matched the query. Only filled for
+   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * string event = 6; + * + * @return The bytes for event. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int PARAMETERS_FIELD_NUMBER = 2; private com.google.protobuf.Struct parameters_; /** @@ -659,6 +740,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (confidence_ != 0F) { output.writeFloat(5, confidence_); } + if (!getEventBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, event_); + } unknownFields.writeTo(output); } @@ -685,6 +769,9 @@ public int getSerializedSize() { if (confidence_ != 0F) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(5, confidence_); } + if (!getEventBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, event_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -705,6 +792,7 @@ public boolean equals(final java.lang.Object obj) { if (hasIntent()) { if (!getIntent().equals(other.getIntent())) return false; } + if (!getEvent().equals(other.getEvent())) return false; if (hasParameters() != other.hasParameters()) return false; if (hasParameters()) { if (!getParameters().equals(other.getParameters())) return false; @@ -728,6 +816,8 @@ public int hashCode() { hash = (37 * hash) + INTENT_FIELD_NUMBER; hash = (53 * hash) + getIntent().hashCode(); } + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); if (hasParameters()) { hash = (37 * hash) + PARAMETERS_FIELD_NUMBER; hash = (53 * hash) + getParameters().hashCode(); @@ -889,6 +979,8 @@ public Builder clear() { intent_ = null; intentBuilder_ = null; } + event_ = ""; + if (parametersBuilder_ == null) { parameters_ = null; } else { @@ -933,6 +1025,7 @@ public com.google.cloud.dialogflow.cx.v3beta1.Match buildPartial() { } else { result.intent_ = intentBuilder_.build(); } + result.event_ = event_; if (parametersBuilder_ == null) { result.parameters_ = parameters_; } else { @@ -993,6 +1086,10 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.Match other) { if (other.hasIntent()) { mergeIntent(other.getIntent()); } + if (!other.getEvent().isEmpty()) { + event_ = other.event_; + onChanged(); + } if (other.hasParameters()) { mergeParameters(other.getParameters()); } @@ -1239,6 +1336,117 @@ public com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder return intentBuilder_; } + private java.lang.Object event_ = ""; + /** + * + * + *
+     * The event that matched the query. Only filled for
+     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * string event = 6; + * + * @return The event. + */ + public java.lang.String getEvent() { + java.lang.Object ref = event_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + event_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The event that matched the query. Only filled for
+     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * string event = 6; + * + * @return The bytes for event. + */ + public com.google.protobuf.ByteString getEventBytes() { + java.lang.Object ref = event_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + event_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The event that matched the query. Only filled for
+     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * string event = 6; + * + * @param value The event to set. + * @return This builder for chaining. + */ + public Builder setEvent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + event_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The event that matched the query. Only filled for
+     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * string event = 6; + * + * @return This builder for chaining. + */ + public Builder clearEvent() { + + event_ = getDefaultInstance().getEvent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The event that matched the query. Only filled for
+     * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+     * 
+ * + * string event = 6; + * + * @param value The bytes for event to set. + * @return This builder for chaining. + */ + public Builder setEventBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + event_ = value; + onChanged(); + return this; + } + private com.google.protobuf.Struct parameters_; private com.google.protobuf.SingleFieldBuilderV3< com.google.protobuf.Struct, diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java index 633982743..0a9eef550 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/MatchOrBuilder.java @@ -64,6 +64,33 @@ public interface MatchOrBuilder */ com.google.cloud.dialogflow.cx.v3beta1.IntentOrBuilder getIntentOrBuilder(); + /** + * + * + *
+   * The event that matched the query. Only filled for
+   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * string event = 6; + * + * @return The event. + */ + java.lang.String getEvent(); + /** + * + * + *
+   * The event that matched the query. Only filled for
+   * [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type.
+   * 
+ * + * string event = 6; + * + * @return The bytes for event. + */ + com.google.protobuf.ByteString getEventBytes(); + /** * * diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java index 653b7ab28..f76943b5f 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java @@ -208,83 +208,84 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "v3beta1.InputAudioConfigB\003\340A\002\022\r\n\005audio\030\002" + " \001(\014\"\033\n\nEventInput\022\r\n\005event\030\001 \001(\t\"1\n\tDtm" + "fInput\022\016\n\006digits\030\001 \001(\t\022\024\n\014finish_digit\030\002" - + " \001(\t\"\340\002\n\005Match\022:\n\006intent\030\001 \001(\0132*.google." - + "cloud.dialogflow.cx.v3beta1.Intent\022+\n\npa" - + "rameters\030\002 \001(\0132\027.google.protobuf.Struct\022" - + "\026\n\016resolved_input\030\003 \001(\t\022G\n\nmatch_type\030\004 " - + "\001(\01623.google.cloud.dialogflow.cx.v3beta1" - + ".Match.MatchType\022\022\n\nconfidence\030\005 \001(\002\"y\n\t" - + "MatchType\022\032\n\026MATCH_TYPE_UNSPECIFIED\020\000\022\n\n" - + "\006INTENT\020\001\022\021\n\rDIRECT_INTENT\020\002\022\025\n\021PARAMETE" - + "R_FILLING\020\003\022\014\n\010NO_MATCH\020\004\022\014\n\010NO_INPUT\020\005\"" - + "\345\001\n\022MatchIntentRequest\022:\n\007session\030\001 \001(\tB" - + ")\340A\002\372A#\n!dialogflow.googleapis.com/Sessi" - + "on\022I\n\014query_params\030\002 \001(\01323.google.cloud." - + "dialogflow.cx.v3beta1.QueryParameters\022H\n" - + "\013query_input\030\003 \001(\0132..google.cloud.dialog" - + "flow.cx.v3beta1.QueryInputB\003\340A\002\"\363\001\n\023Matc" - + "hIntentResponse\022\016\n\004text\030\001 \001(\tH\000\022\030\n\016trigg" - + "er_intent\030\002 \001(\tH\000\022\024\n\ntranscript\030\003 \001(\tH\000\022" - + "\027\n\rtrigger_event\030\006 \001(\tH\000\022:\n\007matches\030\004 \003(" - + "\0132).google.cloud.dialogflow.cx.v3beta1.M" - + "atch\022>\n\014current_page\030\005 \001(\0132(.google.clou" - + "d.dialogflow.cx.v3beta1.PageB\007\n\005query\"\372\001" - + "\n\024FulfillIntentRequest\022T\n\024match_intent_r" - + "equest\030\001 \001(\01326.google.cloud.dialogflow.c" - + "x.v3beta1.MatchIntentRequest\0228\n\005match\030\002 " - + "\001(\0132).google.cloud.dialogflow.cx.v3beta1" - + ".Match\022R\n\023output_audio_config\030\003 \001(\01325.go" - + "ogle.cloud.dialogflow.cx.v3beta1.OutputA" - + "udioConfig\"\335\001\n\025FulfillIntentResponse\022\023\n\013" - + "response_id\030\001 \001(\t\022E\n\014query_result\030\002 \001(\0132" - + "/.google.cloud.dialogflow.cx.v3beta1.Que" - + "ryResult\022\024\n\014output_audio\030\003 \001(\014\022R\n\023output" - + "_audio_config\030\004 \001(\01325.google.cloud.dialo" - + "gflow.cx.v3beta1.OutputAudioConfig\";\n\027Se" - + "ntimentAnalysisResult\022\r\n\005score\030\001 \001(\002\022\021\n\t" - + "magnitude\030\002 \001(\0022\212\n\n\010Sessions\022\272\002\n\014DetectI" - + "ntent\0227.google.cloud.dialogflow.cx.v3bet" - + "a1.DetectIntentRequest\0328.google.cloud.di" - + "alogflow.cx.v3beta1.DetectIntentResponse" - + "\"\266\001\202\323\344\223\002\257\001\"J/v3beta1/{session=projects/*" - + "/locations/*/agents/*/sessions/*}:detect" - + "Intent:\001*Z^\"Y/v3beta1/{session=projects/" - + "*/locations/*/agents/*/environments/*/se" - + "ssions/*}:detectIntent:\001*\022\242\001\n\025StreamingD" - + "etectIntent\022@.google.cloud.dialogflow.cx" - + ".v3beta1.StreamingDetectIntentRequest\032A." - + "google.cloud.dialogflow.cx.v3beta1.Strea" - + "mingDetectIntentResponse\"\000(\0010\001\022\265\002\n\013Match" - + "Intent\0226.google.cloud.dialogflow.cx.v3be" - + "ta1.MatchIntentRequest\0327.google.cloud.di" - + "alogflow.cx.v3beta1.MatchIntentResponse\"" - + "\264\001\202\323\344\223\002\255\001\"I/v3beta1/{session=projects/*/" - + "locations/*/agents/*/sessions/*}:matchIn" - + "tent:\001*Z]\"X/v3beta1/{session=projects/*/" - + "locations/*/agents/*/environments/*/sess" - + "ions/*}:matchIntent:\001*\022\351\002\n\rFulfillIntent" - + "\0228.google.cloud.dialogflow.cx.v3beta1.Fu" - + "lfillIntentRequest\0329.google.cloud.dialog" - + "flow.cx.v3beta1.FulfillIntentResponse\"\342\001" - + "\202\323\344\223\002\333\001\"`/v3beta1/{match_intent_request." - + "session=projects/*/locations/*/agents/*/" - + "sessions/*}:fulfillIntent:\001*Zt\"o/v3beta1" - + "/{match_intent_request.session=projects/" - + "*/locations/*/agents/*/environments/*/se" - + "ssions/*}:fulfillIntent:\001*\032x\312A\031dialogflo" - + "w.googleapis.com\322AYhttps://www.googleapi" - + "s.com/auth/cloud-platform,https://www.go" - + "ogleapis.com/auth/dialogflowB\203\003\n&com.goo" - + "gle.cloud.dialogflow.cx.v3beta1B\014Session" - + "ProtoP\001ZDgoogle.golang.org/genproto/goog" - + "leapis/cloud/dialogflow/cx/v3beta1;cx\370\001\001" - + "\242\002\002DF\252\002\"Google.Cloud.Dialogflow.Cx.V3Bet" - + "a1\352A\324\001\n!dialogflow.googleapis.com/Sessio" - + "n\022Iprojects/{project}/locations/{locatio" - + "n}/agents/{agent}/sessions/{session}\022dpr" - + "ojects/{project}/locations/{location}/ag" - + "ents/{agent}/environments/{environment}/" - + "sessions/{session}b\006proto3" + + " \001(\t\"\373\002\n\005Match\022:\n\006intent\030\001 \001(\0132*.google." + + "cloud.dialogflow.cx.v3beta1.Intent\022\r\n\005ev" + + "ent\030\006 \001(\t\022+\n\nparameters\030\002 \001(\0132\027.google.p" + + "rotobuf.Struct\022\026\n\016resolved_input\030\003 \001(\t\022G" + + "\n\nmatch_type\030\004 \001(\01623.google.cloud.dialog" + + "flow.cx.v3beta1.Match.MatchType\022\022\n\nconfi" + + "dence\030\005 \001(\002\"\204\001\n\tMatchType\022\032\n\026MATCH_TYPE_" + + "UNSPECIFIED\020\000\022\n\n\006INTENT\020\001\022\021\n\rDIRECT_INTE" + + "NT\020\002\022\025\n\021PARAMETER_FILLING\020\003\022\014\n\010NO_MATCH\020" + + "\004\022\014\n\010NO_INPUT\020\005\022\t\n\005EVENT\020\006\"\345\001\n\022MatchInte" + + "ntRequest\022:\n\007session\030\001 \001(\tB)\340A\002\372A#\n!dial" + + "ogflow.googleapis.com/Session\022I\n\014query_p" + + "arams\030\002 \001(\01323.google.cloud.dialogflow.cx" + + ".v3beta1.QueryParameters\022H\n\013query_input\030" + + "\003 \001(\0132..google.cloud.dialogflow.cx.v3bet" + + "a1.QueryInputB\003\340A\002\"\363\001\n\023MatchIntentRespon" + + "se\022\016\n\004text\030\001 \001(\tH\000\022\030\n\016trigger_intent\030\002 \001" + + "(\tH\000\022\024\n\ntranscript\030\003 \001(\tH\000\022\027\n\rtrigger_ev" + + "ent\030\006 \001(\tH\000\022:\n\007matches\030\004 \003(\0132).google.cl" + + "oud.dialogflow.cx.v3beta1.Match\022>\n\014curre" + + "nt_page\030\005 \001(\0132(.google.cloud.dialogflow." + + "cx.v3beta1.PageB\007\n\005query\"\372\001\n\024FulfillInte" + + "ntRequest\022T\n\024match_intent_request\030\001 \001(\0132" + + "6.google.cloud.dialogflow.cx.v3beta1.Mat" + + "chIntentRequest\0228\n\005match\030\002 \001(\0132).google." + + "cloud.dialogflow.cx.v3beta1.Match\022R\n\023out" + + "put_audio_config\030\003 \001(\01325.google.cloud.di" + + "alogflow.cx.v3beta1.OutputAudioConfig\"\335\001" + + "\n\025FulfillIntentResponse\022\023\n\013response_id\030\001" + + " \001(\t\022E\n\014query_result\030\002 \001(\0132/.google.clou" + + "d.dialogflow.cx.v3beta1.QueryResult\022\024\n\014o" + + "utput_audio\030\003 \001(\014\022R\n\023output_audio_config" + + "\030\004 \001(\01325.google.cloud.dialogflow.cx.v3be" + + "ta1.OutputAudioConfig\";\n\027SentimentAnalys" + + "isResult\022\r\n\005score\030\001 \001(\002\022\021\n\tmagnitude\030\002 \001" + + "(\0022\212\n\n\010Sessions\022\272\002\n\014DetectIntent\0227.googl" + + "e.cloud.dialogflow.cx.v3beta1.DetectInte" + + "ntRequest\0328.google.cloud.dialogflow.cx.v" + + "3beta1.DetectIntentResponse\"\266\001\202\323\344\223\002\257\001\"J/" + + "v3beta1/{session=projects/*/locations/*/" + + "agents/*/sessions/*}:detectIntent:\001*Z^\"Y" + + "/v3beta1/{session=projects/*/locations/*" + + "/agents/*/environments/*/sessions/*}:det" + + "ectIntent:\001*\022\242\001\n\025StreamingDetectIntent\022@" + + ".google.cloud.dialogflow.cx.v3beta1.Stre" + + "amingDetectIntentRequest\032A.google.cloud." + + "dialogflow.cx.v3beta1.StreamingDetectInt" + + "entResponse\"\000(\0010\001\022\265\002\n\013MatchIntent\0226.goog" + + "le.cloud.dialogflow.cx.v3beta1.MatchInte" + + "ntRequest\0327.google.cloud.dialogflow.cx.v" + + "3beta1.MatchIntentResponse\"\264\001\202\323\344\223\002\255\001\"I/v" + + "3beta1/{session=projects/*/locations/*/a" + + "gents/*/sessions/*}:matchIntent:\001*Z]\"X/v" + + "3beta1/{session=projects/*/locations/*/a" + + "gents/*/environments/*/sessions/*}:match" + + "Intent:\001*\022\351\002\n\rFulfillIntent\0228.google.clo" + + "ud.dialogflow.cx.v3beta1.FulfillIntentRe" + + "quest\0329.google.cloud.dialogflow.cx.v3bet" + + "a1.FulfillIntentResponse\"\342\001\202\323\344\223\002\333\001\"`/v3b" + + "eta1/{match_intent_request.session=proje" + + "cts/*/locations/*/agents/*/sessions/*}:f" + + "ulfillIntent:\001*Zt\"o/v3beta1/{match_inten" + + "t_request.session=projects/*/locations/*" + + "/agents/*/environments/*/sessions/*}:ful" + + "fillIntent:\001*\032x\312A\031dialogflow.googleapis." + + "com\322AYhttps://www.googleapis.com/auth/cl" + + "oud-platform,https://www.googleapis.com/" + + "auth/dialogflowB\203\003\n&com.google.cloud.dia" + + "logflow.cx.v3beta1B\014SessionProtoP\001ZDgoog" + + "le.golang.org/genproto/googleapis/cloud/" + + "dialogflow/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Googl" + + "e.Cloud.Dialogflow.Cx.V3Beta1\352A\324\001\n!dialo" + + "gflow.googleapis.com/Session\022Iprojects/{" + + "project}/locations/{location}/agents/{ag" + + "ent}/sessions/{session}\022dprojects/{proje" + + "ct}/locations/{location}/agents/{agent}/" + + "environments/{environment}/sessions/{ses" + + "sion}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -441,7 +442,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_cx_v3beta1_Match_descriptor, new java.lang.String[] { - "Intent", "Parameters", "ResolvedInput", "MatchType", "Confidence", + "Intent", "Event", "Parameters", "ResolvedInput", "MatchType", "Confidence", }); internal_static_google_cloud_dialogflow_cx_v3beta1_MatchIntentRequest_descriptor = getDescriptor().getMessageTypes().get(14); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto index 397c20787..9b94a19db 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -576,6 +576,9 @@ message Match { // Indicates an empty query. NO_INPUT = 5; + + // The query directly triggered an event. + EVENT = 6; } // The [Intent][google.cloud.dialogflow.cx.v3beta1.Intent] that matched the query. Some, not all fields are filled in @@ -583,6 +586,10 @@ message Match { // filled for [`INTENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type. Intent intent = 1; + // The event that matched the query. Only filled for + // [`EVENT`][google.cloud.dialogflow.cx.v3beta1.Match.MatchType] match type. + string event = 6; + // The collection of parameters extracted from the query. // // Depending on your protocol or client library language, this is a diff --git a/synth.metadata b/synth.metadata index e35bed147..b74f6eb87 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c0f55f33f882cf97fd3135e93b144ad9c94ebab", - "internalRef": "341478628" + "sha": "836f0eaf5f21f300f63ac635e5ef263d183e0cdd", + "internalRef": "342188199" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c0f55f33f882cf97fd3135e93b144ad9c94ebab", - "internalRef": "341478628" + "sha": "836f0eaf5f21f300f63ac635e5ef263d183e0cdd", + "internalRef": "342188199" } }, { From e9e8184a007571955cfaa2a319247ee38a4af2f3 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:11:59 -0800 Subject: [PATCH 3/9] chore: Remove spurious build warnings by deleting--include_source_info from .bazelrc Committer: @miraleung PiperOrigin-RevId: 344134135 Source-Author: Google APIs Source-Date: Tue Nov 24 14:38:21 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: b11a87f3b54be3a5e42c15020ee1e0781f86da90 Source-Link: https://github.com/googleapis/googleapis/commit/b11a87f3b54be3a5e42c15020ee1e0781f86da90 --- .../cloud/dialogflow/cx/v3/AgentsGrpc.java | 272 +++--------------- .../dialogflow/cx/v3/EntityTypesGrpc.java | 200 ++----------- .../dialogflow/cx/v3/EnvironmentsGrpc.java | 232 ++------------- .../cloud/dialogflow/cx/v3/FlowsGrpc.java | 236 ++------------- .../cloud/dialogflow/cx/v3/IntentsGrpc.java | 200 ++----------- .../cloud/dialogflow/cx/v3/PagesGrpc.java | 200 ++----------- .../cx/v3/SecuritySettingsServiceGrpc.java | 204 ++----------- .../cx/v3/SessionEntityTypesGrpc.java | 208 ++------------ .../cloud/dialogflow/cx/v3/SessionsGrpc.java | 190 ++---------- .../cx/v3/TransitionRouteGroupsGrpc.java | 200 ++----------- .../cloud/dialogflow/cx/v3/VersionsGrpc.java | 232 ++------------- .../cloud/dialogflow/cx/v3/WebhooksGrpc.java | 200 ++----------- .../dialogflow/cx/v3beta1/AgentsGrpc.java | 272 +++--------------- .../cx/v3beta1/EntityTypesGrpc.java | 200 ++----------- .../cx/v3beta1/EnvironmentsGrpc.java | 232 ++------------- .../dialogflow/cx/v3beta1/FlowsGrpc.java | 236 ++------------- .../dialogflow/cx/v3beta1/IntentsGrpc.java | 200 ++----------- .../dialogflow/cx/v3beta1/PagesGrpc.java | 200 ++----------- .../cx/v3beta1/SessionEntityTypesGrpc.java | 208 ++------------ .../dialogflow/cx/v3beta1/SessionsGrpc.java | 190 ++---------- .../cx/v3beta1/TransitionRouteGroupsGrpc.java | 200 ++----------- .../dialogflow/cx/v3beta1/VersionsGrpc.java | 232 ++------------- .../dialogflow/cx/v3beta1/WebhooksGrpc.java | 200 ++----------- synth.metadata | 8 +- 24 files changed, 607 insertions(+), 4345 deletions(-) diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java index 9bbccdfbf..a475f94d4 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/agent.proto") @@ -386,22 +380,10 @@ public AgentsFutureStub newStub( return AgentsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
-   * 
- */ + /** */ public abstract static class AgentsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public void listAgents( com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -409,80 +391,42 @@ public void listAgents( asyncUnimplementedUnaryCall(getListAgentsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public void getAgent( com.google.cloud.dialogflow.cx.v3.GetAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetAgentMethod(), responseObserver); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public void createAgent( com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateAgentMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public void updateAgent( com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateAgentMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteAgentMethod(), responseObserver); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public void exportAgent( com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getExportAgentMethod(), responseObserver); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -539,13 +483,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
-   * 
- */ + /** */ public static final class AgentsStub extends io.grpc.stub.AbstractAsyncStub { private AgentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -556,13 +494,7 @@ protected AgentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpti return new AgentsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public void listAgents( com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -571,13 +503,7 @@ public void listAgents( getChannel().newCall(getListAgentsMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public void getAgent( com.google.cloud.dialogflow.cx.v3.GetAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -585,13 +511,7 @@ public void getAgent( getChannel().newCall(getGetAgentMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public void createAgent( com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -601,13 +521,7 @@ public void createAgent( responseObserver); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public void updateAgent( com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -617,13 +531,7 @@ public void updateAgent( responseObserver); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -633,13 +541,7 @@ public void deleteAgent( responseObserver); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public void exportAgent( com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -649,15 +551,7 @@ public void exportAgent( responseObserver); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -668,13 +562,7 @@ public void restoreAgent( } } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
-   * 
- */ + /** */ public static final class AgentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private AgentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -686,100 +574,50 @@ protected AgentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new AgentsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListAgentsResponse listAgents( com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request) { return blockingUnaryCall(getChannel(), getListAgentsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Agent getAgent( com.google.cloud.dialogflow.cx.v3.GetAgentRequest request) { return blockingUnaryCall(getChannel(), getGetAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Agent createAgent( com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request) { return blockingUnaryCall(getChannel(), getCreateAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Agent updateAgent( com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request) { return blockingUnaryCall(getChannel(), getUpdateAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteAgent( com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request) { return blockingUnaryCall(getChannel(), getDeleteAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public com.google.longrunning.Operation exportAgent( com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request) { return blockingUnaryCall(getChannel(), getExportAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public com.google.longrunning.Operation restoreAgent( com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request) { return blockingUnaryCall(getChannel(), getRestoreAgentMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
-   * 
- */ + /** */ public static final class AgentsFutureStub extends io.grpc.stub.AbstractFutureStub { private AgentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -791,13 +629,7 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new AgentsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListAgentsResponse> listAgents(com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request) { @@ -805,26 +637,14 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getListAgentsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Agent> getAgent(com.google.cloud.dialogflow.cx.v3.GetAgentRequest request) { return futureUnaryCall(getChannel().newCall(getGetAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Agent> createAgent(com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request) { @@ -832,13 +652,7 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getCreateAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Agent> updateAgent(com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request) { @@ -846,41 +660,21 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getUpdateAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteAgent(com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture exportAgent(com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request) { return futureUnaryCall( getChannel().newCall(getExportAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture restoreAgent(com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java index 065a1b795..7325694ca 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/entity_type.proto") @@ -306,22 +300,10 @@ public EntityTypesFutureStub newStub( return EntityTypesFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
-   * 
- */ + /** */ public abstract static class EntityTypesImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -329,13 +311,7 @@ public void listEntityTypes( asyncUnimplementedUnaryCall(getListEntityTypesMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public void getEntityType( com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -343,13 +319,7 @@ public void getEntityType( asyncUnimplementedUnaryCall(getGetEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public void createEntityType( com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -357,13 +327,7 @@ public void createEntityType( asyncUnimplementedUnaryCall(getCreateEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -371,13 +335,7 @@ public void updateEntityType( asyncUnimplementedUnaryCall(getUpdateEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -425,13 +383,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
-   * 
- */ + /** */ public static final class EntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private EntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -443,13 +395,7 @@ protected EntityTypesStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new EntityTypesStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -460,13 +406,7 @@ public void listEntityTypes( responseObserver); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public void getEntityType( com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -477,13 +417,7 @@ public void getEntityType( responseObserver); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public void createEntityType( com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -494,13 +428,7 @@ public void createEntityType( responseObserver); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -511,13 +439,7 @@ public void updateEntityType( responseObserver); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -528,13 +450,7 @@ public void deleteEntityType( } } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
-   * 
- */ + /** */ public static final class EntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EntityTypesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -547,63 +463,33 @@ protected EntityTypesBlockingStub build( return new EntityTypesBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse listEntityTypes( com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request) { return blockingUnaryCall(getChannel(), getListEntityTypesMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.EntityType getEntityType( com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request) { return blockingUnaryCall(getChannel(), getGetEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.EntityType createEntityType( com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.EntityType updateEntityType( com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteEntityType( com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request) { return blockingUnaryCall( @@ -611,13 +497,7 @@ public com.google.protobuf.Empty deleteEntityType( } } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
-   * 
- */ + /** */ public static final class EntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private EntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -630,13 +510,7 @@ protected EntityTypesFutureStub build( return new EntityTypesFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse> listEntityTypes(com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request) { @@ -644,13 +518,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getListEntityTypesMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.EntityType> getEntityType(com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request) { @@ -658,13 +526,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getGetEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.EntityType> createEntityType(com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request) { @@ -672,13 +534,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getCreateEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.EntityType> updateEntityType(com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request) { @@ -686,13 +542,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getUpdateEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteEntityType(com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java index 8c1bd655c..e8daa1d7f 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/environment.proto") @@ -358,22 +352,10 @@ public EnvironmentsFutureStub newStub( return EnvironmentsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
-   * 
- */ + /** */ public abstract static class EnvironmentsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -381,13 +363,7 @@ public void listEnvironments( asyncUnimplementedUnaryCall(getListEnvironmentsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -395,52 +371,28 @@ public void getEnvironment( asyncUnimplementedUnaryCall(getGetEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -495,13 +447,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
-   * 
- */ + /** */ public static final class EnvironmentsStub extends io.grpc.stub.AbstractAsyncStub { private EnvironmentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -513,13 +459,7 @@ protected EnvironmentsStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new EnvironmentsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -530,13 +470,7 @@ public void listEnvironments( responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -547,13 +481,7 @@ public void getEnvironment( responseObserver); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -563,13 +491,7 @@ public void createEnvironment( responseObserver); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -579,13 +501,7 @@ public void updateEnvironment( responseObserver); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -595,13 +511,7 @@ public void deleteEnvironment( responseObserver); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -614,13 +524,7 @@ public void lookupEnvironmentHistory( } } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
-   * 
- */ + /** */ public static final class EnvironmentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EnvironmentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -633,77 +537,41 @@ protected EnvironmentsBlockingStub build( return new EnvironmentsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse listEnvironments( com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request) { return blockingUnaryCall( getChannel(), getListEnvironmentsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Environment getEnvironment( com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request) { return blockingUnaryCall(getChannel(), getGetEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public com.google.longrunning.Operation createEnvironment( com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getCreateEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.longrunning.Operation updateEnvironment( com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getUpdateEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteEnvironment( com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getDeleteEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest request) { @@ -712,13 +580,7 @@ public com.google.protobuf.Empty deleteEnvironment( } } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
-   * 
- */ + /** */ public static final class EnvironmentsFutureStub extends io.grpc.stub.AbstractFutureStub { private EnvironmentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -731,13 +593,7 @@ protected EnvironmentsFutureStub build( return new EnvironmentsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse> listEnvironments(com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request) { @@ -745,13 +601,7 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getListEnvironmentsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Environment> getEnvironment(com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request) { @@ -759,52 +609,28 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture createEnvironment(com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getCreateEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture updateEnvironment(com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getUpdateEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteEnvironment(com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse> lookupEnvironmentHistory( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java index 3ad301886..873e799d7 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/flow.proto") @@ -341,48 +335,24 @@ public FlowsFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return FlowsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
-   * 
- */ + /** */ public abstract static class FlowsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public void createFlow( com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateFlowMethod(), responseObserver); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteFlowMethod(), responseObserver); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public void listFlows( com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -390,40 +360,21 @@ public void listFlows( asyncUnimplementedUnaryCall(getListFlowsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public void getFlow( com.google.cloud.dialogflow.cx.v3.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetFlowMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public void updateFlow( com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateFlowMethod(), responseObserver); } - /** - * - * - *
-     * Trains the specified flow. Note that only the flow in 'draft' environment
-     * is trained.
-     * 
- */ + /** */ public void trainFlow( com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -474,13 +425,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
-   * 
- */ + /** */ public static final class FlowsStub extends io.grpc.stub.AbstractAsyncStub { private FlowsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -491,13 +436,7 @@ protected FlowsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new FlowsStub(channel, callOptions); } - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public void createFlow( com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -505,13 +444,7 @@ public void createFlow( getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -519,13 +452,7 @@ public void deleteFlow( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public void listFlows( com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -534,13 +461,7 @@ public void listFlows( getChannel().newCall(getListFlowsMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public void getFlow( com.google.cloud.dialogflow.cx.v3.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -548,13 +469,7 @@ public void getFlow( getChannel().newCall(getGetFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public void updateFlow( com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -562,14 +477,7 @@ public void updateFlow( getChannel().newCall(getUpdateFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Trains the specified flow. Note that only the flow in 'draft' environment
-     * is trained.
-     * 
- */ + /** */ public void trainFlow( com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -578,13 +486,7 @@ public void trainFlow( } } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
-   * 
- */ + /** */ public static final class FlowsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private FlowsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -596,87 +498,44 @@ protected FlowsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new FlowsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Flow createFlow( com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request) { return blockingUnaryCall(getChannel(), getCreateFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request) { return blockingUnaryCall(getChannel(), getDeleteFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListFlowsResponse listFlows( com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request) { return blockingUnaryCall(getChannel(), getListFlowsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Flow getFlow( com.google.cloud.dialogflow.cx.v3.GetFlowRequest request) { return blockingUnaryCall(getChannel(), getGetFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Flow updateFlow( com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request) { return blockingUnaryCall(getChannel(), getUpdateFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Trains the specified flow. Note that only the flow in 'draft' environment
-     * is trained.
-     * 
- */ + /** */ public com.google.longrunning.Operation trainFlow( com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request) { return blockingUnaryCall(getChannel(), getTrainFlowMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
-   * 
- */ + /** */ public static final class FlowsFutureStub extends io.grpc.stub.AbstractFutureStub { private FlowsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -688,13 +547,7 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new FlowsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Flow> createFlow(com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request) { @@ -702,52 +555,28 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListFlowsResponse> listFlows(com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request) { return futureUnaryCall(getChannel().newCall(getListFlowsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Flow> getFlow(com.google.cloud.dialogflow.cx.v3.GetFlowRequest request) { return futureUnaryCall(getChannel().newCall(getGetFlowMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Flow> updateFlow(com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request) { @@ -755,14 +584,7 @@ public com.google.common.util.concurrent.ListenableFuture - * Trains the specified flow. Note that only the flow in 'draft' environment - * is trained. - * - */ + /** */ public com.google.common.util.concurrent.ListenableFuture trainFlow(com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request) { return futureUnaryCall(getChannel().newCall(getTrainFlowMethod(), getCallOptions()), request); diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java index d9c1243f4..2d63b84b0 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/intent.proto") @@ -302,22 +296,10 @@ public IntentsFutureStub newStub( return IntentsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
-   * 
- */ + /** */ public abstract static class IntentsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public void listIntents( com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -325,52 +307,28 @@ public void listIntents( asyncUnimplementedUnaryCall(getListIntentsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public void getIntent( com.google.cloud.dialogflow.cx.v3.GetIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetIntentMethod(), responseObserver); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public void createIntent( com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateIntentMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public void updateIntent( com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateIntentMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -415,13 +373,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
-   * 
- */ + /** */ public static final class IntentsStub extends io.grpc.stub.AbstractAsyncStub { private IntentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -432,13 +384,7 @@ protected IntentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpt return new IntentsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public void listIntents( com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -449,13 +395,7 @@ public void listIntents( responseObserver); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public void getIntent( com.google.cloud.dialogflow.cx.v3.GetIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -463,13 +403,7 @@ public void getIntent( getChannel().newCall(getGetIntentMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public void createIntent( com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -479,13 +413,7 @@ public void createIntent( responseObserver); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public void updateIntent( com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -495,13 +423,7 @@ public void updateIntent( responseObserver); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -512,13 +434,7 @@ public void deleteIntent( } } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
-   * 
- */ + /** */ public static final class IntentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private IntentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -530,74 +446,38 @@ protected IntentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new IntentsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListIntentsResponse listIntents( com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request) { return blockingUnaryCall(getChannel(), getListIntentsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Intent getIntent( com.google.cloud.dialogflow.cx.v3.GetIntentRequest request) { return blockingUnaryCall(getChannel(), getGetIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Intent createIntent( com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request) { return blockingUnaryCall(getChannel(), getCreateIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Intent updateIntent( com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request) { return blockingUnaryCall(getChannel(), getUpdateIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteIntent( com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request) { return blockingUnaryCall(getChannel(), getDeleteIntentMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
-   * 
- */ + /** */ public static final class IntentsFutureStub extends io.grpc.stub.AbstractFutureStub { private IntentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -609,13 +489,7 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new IntentsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListIntentsResponse> listIntents(com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request) { @@ -623,26 +497,14 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getListIntentsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Intent> getIntent(com.google.cloud.dialogflow.cx.v3.GetIntentRequest request) { return futureUnaryCall(getChannel().newCall(getGetIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Intent> createIntent(com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request) { @@ -650,13 +512,7 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getCreateIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Intent> updateIntent(com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request) { @@ -664,13 +520,7 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getUpdateIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteIntent(com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java index e0ee89e3e..e54027443 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/page.proto") @@ -299,22 +293,10 @@ public PagesFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return PagesFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
-   * 
- */ + /** */ public abstract static class PagesImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public void listPages( com.google.cloud.dialogflow.cx.v3.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -322,52 +304,28 @@ public void listPages( asyncUnimplementedUnaryCall(getListPagesMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public void getPage( com.google.cloud.dialogflow.cx.v3.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetPageMethod(), responseObserver); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public void createPage( com.google.cloud.dialogflow.cx.v3.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreatePageMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public void updatePage( com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdatePageMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public void deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -412,13 +370,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
-   * 
- */ + /** */ public static final class PagesStub extends io.grpc.stub.AbstractAsyncStub { private PagesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -429,13 +381,7 @@ protected PagesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new PagesStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public void listPages( com.google.cloud.dialogflow.cx.v3.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -444,13 +390,7 @@ public void listPages( getChannel().newCall(getListPagesMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public void getPage( com.google.cloud.dialogflow.cx.v3.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -458,13 +398,7 @@ public void getPage( getChannel().newCall(getGetPageMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public void createPage( com.google.cloud.dialogflow.cx.v3.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -472,13 +406,7 @@ public void createPage( getChannel().newCall(getCreatePageMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public void updatePage( com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -486,13 +414,7 @@ public void updatePage( getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public void deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -501,13 +423,7 @@ public void deletePage( } } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
-   * 
- */ + /** */ public static final class PagesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private PagesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -519,74 +435,38 @@ protected PagesBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new PagesBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListPagesResponse listPages( com.google.cloud.dialogflow.cx.v3.ListPagesRequest request) { return blockingUnaryCall(getChannel(), getListPagesMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Page getPage( com.google.cloud.dialogflow.cx.v3.GetPageRequest request) { return blockingUnaryCall(getChannel(), getGetPageMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Page createPage( com.google.cloud.dialogflow.cx.v3.CreatePageRequest request) { return blockingUnaryCall(getChannel(), getCreatePageMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Page updatePage( com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request) { return blockingUnaryCall(getChannel(), getUpdatePageMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public com.google.protobuf.Empty deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request) { return blockingUnaryCall(getChannel(), getDeletePageMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
-   * 
- */ + /** */ public static final class PagesFutureStub extends io.grpc.stub.AbstractFutureStub { private PagesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -598,39 +478,21 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new PagesFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListPagesResponse> listPages(com.google.cloud.dialogflow.cx.v3.ListPagesRequest request) { return futureUnaryCall(getChannel().newCall(getListPagesMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Page> getPage(com.google.cloud.dialogflow.cx.v3.GetPageRequest request) { return futureUnaryCall(getChannel().newCall(getGetPageMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Page> createPage(com.google.cloud.dialogflow.cx.v3.CreatePageRequest request) { @@ -638,13 +500,7 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreatePageMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Page> updatePage(com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request) { @@ -652,13 +508,7 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java index 03d712761..1c6809236 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing security settings for Dialogflow.
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/security_settings.proto") @@ -342,22 +336,10 @@ public SecuritySettingsServiceFutureStub newStub( return SecuritySettingsServiceFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing security settings for Dialogflow.
-   * 
- */ + /** */ public abstract static class SecuritySettingsServiceImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Create security settings in the specified location.
-     * 
- */ + /** */ public void createSecuritySettings( com.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -365,14 +347,7 @@ public void createSecuritySettings( asyncUnimplementedUnaryCall(getCreateSecuritySettingsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * The returned settings may be stale by up to 1 minute.
-     * 
- */ + /** */ public void getSecuritySettings( com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -380,13 +355,7 @@ public void getSecuritySettings( asyncUnimplementedUnaryCall(getGetSecuritySettingsMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public void updateSecuritySettings( com.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -394,13 +363,7 @@ public void updateSecuritySettings( asyncUnimplementedUnaryCall(getUpdateSecuritySettingsMethod(), responseObserver); } - /** - * - * - *
-     * Returns the list of all security settings in the specified location.
-     * 
- */ + /** */ public void listSecuritySettings( com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -408,13 +371,7 @@ public void listSecuritySettings( asyncUnimplementedUnaryCall(getListSecuritySettingsMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public void deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -462,13 +419,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing security settings for Dialogflow.
-   * 
- */ + /** */ public static final class SecuritySettingsServiceStub extends io.grpc.stub.AbstractAsyncStub { private SecuritySettingsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -481,13 +432,7 @@ protected SecuritySettingsServiceStub build( return new SecuritySettingsServiceStub(channel, callOptions); } - /** - * - * - *
-     * Create security settings in the specified location.
-     * 
- */ + /** */ public void createSecuritySettings( com.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -498,14 +443,7 @@ public void createSecuritySettings( responseObserver); } - /** - * - * - *
-     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * The returned settings may be stale by up to 1 minute.
-     * 
- */ + /** */ public void getSecuritySettings( com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -516,13 +454,7 @@ public void getSecuritySettings( responseObserver); } - /** - * - * - *
-     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public void updateSecuritySettings( com.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -533,13 +465,7 @@ public void updateSecuritySettings( responseObserver); } - /** - * - * - *
-     * Returns the list of all security settings in the specified location.
-     * 
- */ + /** */ public void listSecuritySettings( com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -550,13 +476,7 @@ public void listSecuritySettings( responseObserver); } - /** - * - * - *
-     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public void deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -567,13 +487,7 @@ public void deleteSecuritySettings( } } - /** - * - * - *
-   * Service for managing security settings for Dialogflow.
-   * 
- */ + /** */ public static final class SecuritySettingsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SecuritySettingsServiceBlockingStub( @@ -587,66 +501,35 @@ protected SecuritySettingsServiceBlockingStub build( return new SecuritySettingsServiceBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Create security settings in the specified location.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.SecuritySettings createSecuritySettings( com.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getCreateSecuritySettingsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * The returned settings may be stale by up to 1 minute.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.SecuritySettings getSecuritySettings( com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getGetSecuritySettingsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.SecuritySettings updateSecuritySettings( com.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getUpdateSecuritySettingsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Returns the list of all security settings in the specified location.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse listSecuritySettings( com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getListSecuritySettingsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request) { return blockingUnaryCall( @@ -654,13 +537,7 @@ public com.google.protobuf.Empty deleteSecuritySettings( } } - /** - * - * - *
-   * Service for managing security settings for Dialogflow.
-   * 
- */ + /** */ public static final class SecuritySettingsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { private SecuritySettingsServiceFutureStub( @@ -674,13 +551,7 @@ protected SecuritySettingsServiceFutureStub build( return new SecuritySettingsServiceFutureStub(channel, callOptions); } - /** - * - * - *
-     * Create security settings in the specified location.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SecuritySettings> createSecuritySettings( @@ -689,14 +560,7 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getCreateSecuritySettingsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * The returned settings may be stale by up to 1 minute.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SecuritySettings> getSecuritySettings(com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request) { @@ -704,13 +568,7 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getGetSecuritySettingsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SecuritySettings> updateSecuritySettings( @@ -719,13 +577,7 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getUpdateSecuritySettingsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Returns the list of all security settings in the specified location.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse> listSecuritySettings( @@ -734,13 +586,7 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getListSecuritySettingsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java index edb667bdf..883de3134 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/session_entity_type.proto") @@ -333,22 +327,10 @@ public SessionEntityTypesFutureStub newStub( return SessionEntityTypesFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
-   * 
- */ + /** */ public abstract static class SessionEntityTypesImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -357,13 +339,7 @@ public void listSessionEntityTypes( asyncUnimplementedUnaryCall(getListSessionEntityTypesMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -371,15 +347,7 @@ public void getSessionEntityType( asyncUnimplementedUnaryCall(getGetSessionEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -387,13 +355,7 @@ public void createSessionEntityType( asyncUnimplementedUnaryCall(getCreateSessionEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -401,13 +363,7 @@ public void updateSessionEntityType( asyncUnimplementedUnaryCall(getUpdateSessionEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -455,13 +411,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
-   * 
- */ + /** */ public static final class SessionEntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private SessionEntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -474,13 +424,7 @@ protected SessionEntityTypesStub build( return new SessionEntityTypesStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -492,13 +436,7 @@ public void listSessionEntityTypes( responseObserver); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -509,15 +447,7 @@ public void getSessionEntityType( responseObserver); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -528,13 +458,7 @@ public void createSessionEntityType( responseObserver); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -545,13 +469,7 @@ public void updateSessionEntityType( responseObserver); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -562,13 +480,7 @@ public void deleteSessionEntityType( } } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
-   * 
- */ + /** */ public static final class SessionEntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionEntityTypesBlockingStub( @@ -582,67 +494,35 @@ protected SessionEntityTypesBlockingStub build( return new SessionEntityTypesBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest request) { return blockingUnaryCall( getChannel(), getListSessionEntityTypesMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.SessionEntityType getSessionEntityType( com.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getGetSessionEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.SessionEntityType createSessionEntityType( com.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateSessionEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.SessionEntityType updateSessionEntityType( com.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateSessionEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request) { return blockingUnaryCall( @@ -650,13 +530,7 @@ public com.google.protobuf.Empty deleteSessionEntityType( } } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
-   * 
- */ + /** */ public static final class SessionEntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionEntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -669,13 +543,7 @@ protected SessionEntityTypesFutureStub build( return new SessionEntityTypesFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse> listSessionEntityTypes( @@ -684,13 +552,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getListSessionEntityTypesMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SessionEntityType> getSessionEntityType( @@ -699,15 +561,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getGetSessionEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SessionEntityType> createSessionEntityType( @@ -716,13 +570,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getCreateSessionEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SessionEntityType> updateSessionEntityType( @@ -731,13 +579,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getUpdateSessionEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java index dacd62eeb..17c1c3c52 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java @@ -25,15 +25,7 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * A session represents an interaction with a user. You retrieve user input
- * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
- * user intent and respond.
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/session.proto") @@ -271,27 +263,10 @@ public SessionsFutureStub newStub( return SessionsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public abstract static class SessionsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public void detectIntent( com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -299,15 +274,7 @@ public void detectIntent( asyncUnimplementedUnaryCall(getDetectIntentMethod(), responseObserver); } - /** - * - * - *
-     * Processes a natural language query in audio format in a streaming fashion
-     * and returns structured, actionable data as a result. This method is only
-     * available via the gRPC API (not REST).
-     * 
- */ + /** */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest> streamingDetectIntent( @@ -317,14 +284,7 @@ public void detectIntent( return asyncUnimplementedStreamingCall(getStreamingDetectIntentMethod(), responseObserver); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public void matchIntent( com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -332,15 +292,7 @@ public void matchIntent( asyncUnimplementedUnaryCall(getMatchIntentMethod(), responseObserver); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -383,15 +335,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public static final class SessionsStub extends io.grpc.stub.AbstractAsyncStub { private SessionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -402,16 +346,7 @@ protected SessionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new SessionsStub(channel, callOptions); } - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public void detectIntent( com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -422,15 +357,7 @@ public void detectIntent( responseObserver); } - /** - * - * - *
-     * Processes a natural language query in audio format in a streaming fashion
-     * and returns structured, actionable data as a result. This method is only
-     * available via the gRPC API (not REST).
-     * 
- */ + /** */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest> streamingDetectIntent( @@ -442,14 +369,7 @@ public void detectIntent( responseObserver); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public void matchIntent( com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -460,15 +380,7 @@ public void matchIntent( responseObserver); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -480,15 +392,7 @@ public void fulfillIntent( } } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public static final class SessionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -500,58 +404,26 @@ protected SessionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new SessionsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse detectIntent( com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request) { return blockingUnaryCall(getChannel(), getDetectIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.MatchIntentResponse matchIntent( com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request) { return blockingUnaryCall(getChannel(), getMatchIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.FulfillIntentResponse fulfillIntent( com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request) { return blockingUnaryCall(getChannel(), getFulfillIntentMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public static final class SessionsFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -563,16 +435,7 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new SessionsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.DetectIntentResponse> detectIntent(com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request) { @@ -580,14 +443,7 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getDetectIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.MatchIntentResponse> matchIntent(com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request) { @@ -595,15 +451,7 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getMatchIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.FulfillIntentResponse> fulfillIntent(com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java index 8ade4caaf..3345e9194 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/transition_route_group.proto") @@ -344,22 +338,10 @@ public TransitionRouteGroupsFutureStub newStub( return TransitionRouteGroupsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-   * 
- */ + /** */ public abstract static class TransitionRouteGroupsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -368,13 +350,7 @@ public void listTransitionRouteGroups( asyncUnimplementedUnaryCall(getListTransitionRouteGroupsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -382,13 +358,7 @@ public void getTransitionRouteGroup( asyncUnimplementedUnaryCall(getGetTransitionRouteGroupMethod(), responseObserver); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -396,13 +366,7 @@ public void createTransitionRouteGroup( asyncUnimplementedUnaryCall(getCreateTransitionRouteGroupMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -410,13 +374,7 @@ public void updateTransitionRouteGroup( asyncUnimplementedUnaryCall(getUpdateTransitionRouteGroupMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -464,13 +422,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-   * 
- */ + /** */ public static final class TransitionRouteGroupsStub extends io.grpc.stub.AbstractAsyncStub { private TransitionRouteGroupsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -483,13 +435,7 @@ protected TransitionRouteGroupsStub build( return new TransitionRouteGroupsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -501,13 +447,7 @@ public void listTransitionRouteGroups( responseObserver); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -518,13 +458,7 @@ public void getTransitionRouteGroup( responseObserver); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -535,13 +469,7 @@ public void createTransitionRouteGroup( responseObserver); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -552,13 +480,7 @@ public void updateTransitionRouteGroup( responseObserver); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -569,13 +491,7 @@ public void deleteTransitionRouteGroup( } } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-   * 
- */ + /** */ public static final class TransitionRouteGroupsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private TransitionRouteGroupsBlockingStub( @@ -589,13 +505,7 @@ protected TransitionRouteGroupsBlockingStub build( return new TransitionRouteGroupsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest request) { @@ -603,52 +513,28 @@ protected TransitionRouteGroupsBlockingStub build( getChannel(), getListTransitionRouteGroupsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getGetTransitionRouteGroupMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getCreateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getUpdateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request) { return blockingUnaryCall( @@ -656,13 +542,7 @@ public com.google.protobuf.Empty deleteTransitionRouteGroup( } } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-   * 
- */ + /** */ public static final class TransitionRouteGroupsFutureStub extends io.grpc.stub.AbstractFutureStub { private TransitionRouteGroupsFutureStub( @@ -676,13 +556,7 @@ protected TransitionRouteGroupsFutureStub build( return new TransitionRouteGroupsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse> listTransitionRouteGroups( @@ -691,13 +565,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getListTransitionRouteGroupsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup> getTransitionRouteGroup( @@ -706,13 +574,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getGetTransitionRouteGroupMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup> createTransitionRouteGroup( @@ -721,13 +583,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getCreateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup> updateTransitionRouteGroup( @@ -736,13 +592,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getUpdateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java index 08f150886..04ba069f8 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/version.proto") @@ -342,22 +336,10 @@ public VersionsFutureStub newStub( return VersionsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
-   * 
- */ + /** */ public abstract static class VersionsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public void listVersions( com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -365,65 +347,35 @@ public void listVersions( asyncUnimplementedUnaryCall(getListVersionsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public void getVersion( com.google.cloud.dialogflow.cx.v3.GetVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetVersionMethod(), responseObserver); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public void createVersion( com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateVersionMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public void updateVersion( com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateVersionMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteVersionMethod(), responseObserver); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public void loadVersion( com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -474,13 +426,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
-   * 
- */ + /** */ public static final class VersionsStub extends io.grpc.stub.AbstractAsyncStub { private VersionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -491,13 +437,7 @@ protected VersionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new VersionsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public void listVersions( com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -508,13 +448,7 @@ public void listVersions( responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public void getVersion( com.google.cloud.dialogflow.cx.v3.GetVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -522,13 +456,7 @@ public void getVersion( getChannel().newCall(getGetVersionMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public void createVersion( com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -538,13 +466,7 @@ public void createVersion( responseObserver); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public void updateVersion( com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -554,13 +476,7 @@ public void updateVersion( responseObserver); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -570,13 +486,7 @@ public void deleteVersion( responseObserver); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public void loadVersion( com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -587,13 +497,7 @@ public void loadVersion( } } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
-   * 
- */ + /** */ public static final class VersionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private VersionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -605,86 +509,44 @@ protected VersionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new VersionsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListVersionsResponse listVersions( com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request) { return blockingUnaryCall(getChannel(), getListVersionsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Version getVersion( com.google.cloud.dialogflow.cx.v3.GetVersionRequest request) { return blockingUnaryCall(getChannel(), getGetVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public com.google.longrunning.Operation createVersion( com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request) { return blockingUnaryCall(getChannel(), getCreateVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Version updateVersion( com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request) { return blockingUnaryCall(getChannel(), getUpdateVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteVersion( com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request) { return blockingUnaryCall(getChannel(), getDeleteVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public com.google.longrunning.Operation loadVersion( com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request) { return blockingUnaryCall(getChannel(), getLoadVersionMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
-   * 
- */ + /** */ public static final class VersionsFutureStub extends io.grpc.stub.AbstractFutureStub { private VersionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -696,13 +558,7 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new VersionsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListVersionsResponse> listVersions(com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request) { @@ -710,13 +566,7 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListVersionsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Version> getVersion(com.google.cloud.dialogflow.cx.v3.GetVersionRequest request) { @@ -724,26 +574,14 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture createVersion(com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request) { return futureUnaryCall( getChannel().newCall(getCreateVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Version> updateVersion(com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request) { @@ -751,26 +589,14 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteVersion(com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture loadVersion(com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java index 4561e9ce5..0848af0b8 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/webhook.proto") @@ -302,22 +296,10 @@ public WebhooksFutureStub newStub( return WebhooksFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
-   * 
- */ + /** */ public abstract static class WebhooksImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -325,52 +307,28 @@ public void listWebhooks( asyncUnimplementedUnaryCall(getListWebhooksMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public void getWebhook( com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetWebhookMethod(), responseObserver); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public void createWebhook( com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateWebhookMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateWebhookMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -415,13 +373,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
-   * 
- */ + /** */ public static final class WebhooksStub extends io.grpc.stub.AbstractAsyncStub { private WebhooksStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -432,13 +384,7 @@ protected WebhooksStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new WebhooksStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -449,13 +395,7 @@ public void listWebhooks( responseObserver); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public void getWebhook( com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -463,13 +403,7 @@ public void getWebhook( getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public void createWebhook( com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -479,13 +413,7 @@ public void createWebhook( responseObserver); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -495,13 +423,7 @@ public void updateWebhook( responseObserver); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -512,13 +434,7 @@ public void deleteWebhook( } } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
-   * 
- */ + /** */ public static final class WebhooksBlockingStub extends io.grpc.stub.AbstractBlockingStub { private WebhooksBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -530,74 +446,38 @@ protected WebhooksBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new WebhooksBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.ListWebhooksResponse listWebhooks( com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request) { return blockingUnaryCall(getChannel(), getListWebhooksMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Webhook getWebhook( com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request) { return blockingUnaryCall(getChannel(), getGetWebhookMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Webhook createWebhook( com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request) { return blockingUnaryCall(getChannel(), getCreateWebhookMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3.Webhook updateWebhook( com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request) { return blockingUnaryCall(getChannel(), getUpdateWebhookMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteWebhook( com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request) { return blockingUnaryCall(getChannel(), getDeleteWebhookMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
-   * 
- */ + /** */ public static final class WebhooksFutureStub extends io.grpc.stub.AbstractFutureStub { private WebhooksFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -609,13 +489,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new WebhooksFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListWebhooksResponse> listWebhooks(com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request) { @@ -623,13 +497,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListWebhooksMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Webhook> getWebhook(com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request) { @@ -637,13 +505,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Webhook> createWebhook(com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request) { @@ -651,13 +513,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getCreateWebhookMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Webhook> updateWebhook(com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request) { @@ -665,13 +521,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateWebhookMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteWebhook(com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java index b1ed19b8f..22bf15373 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/agent.proto") @@ -392,22 +386,10 @@ public AgentsFutureStub newStub( return AgentsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
-   * 
- */ + /** */ public abstract static class AgentsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public void listAgents( com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -415,13 +397,7 @@ public void listAgents( asyncUnimplementedUnaryCall(getListAgentsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public void getAgent( com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request, io.grpc.stub.StreamObserver @@ -429,13 +405,7 @@ public void getAgent( asyncUnimplementedUnaryCall(getGetAgentMethod(), responseObserver); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public void createAgent( com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request, io.grpc.stub.StreamObserver @@ -443,13 +413,7 @@ public void createAgent( asyncUnimplementedUnaryCall(getCreateAgentMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public void updateAgent( com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request, io.grpc.stub.StreamObserver @@ -457,41 +421,21 @@ public void updateAgent( asyncUnimplementedUnaryCall(getUpdateAgentMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteAgentMethod(), responseObserver); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public void exportAgent( com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getExportAgentMethod(), responseObserver); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -548,13 +492,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
-   * 
- */ + /** */ public static final class AgentsStub extends io.grpc.stub.AbstractAsyncStub { private AgentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -565,13 +503,7 @@ protected AgentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpti return new AgentsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public void listAgents( com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -580,13 +512,7 @@ public void listAgents( getChannel().newCall(getListAgentsMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public void getAgent( com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request, io.grpc.stub.StreamObserver @@ -595,13 +521,7 @@ public void getAgent( getChannel().newCall(getGetAgentMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public void createAgent( com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request, io.grpc.stub.StreamObserver @@ -612,13 +532,7 @@ public void createAgent( responseObserver); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public void updateAgent( com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request, io.grpc.stub.StreamObserver @@ -629,13 +543,7 @@ public void updateAgent( responseObserver); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -645,13 +553,7 @@ public void deleteAgent( responseObserver); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public void exportAgent( com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -661,15 +563,7 @@ public void exportAgent( responseObserver); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -680,13 +574,7 @@ public void restoreAgent( } } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
-   * 
- */ + /** */ public static final class AgentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private AgentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -698,100 +586,50 @@ protected AgentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new AgentsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse listAgents( com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request) { return blockingUnaryCall(getChannel(), getListAgentsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent( com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request) { return blockingUnaryCall(getChannel(), getGetAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Agent createAgent( com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request) { return blockingUnaryCall(getChannel(), getCreateAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Agent updateAgent( com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request) { return blockingUnaryCall(getChannel(), getUpdateAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteAgent( com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request) { return blockingUnaryCall(getChannel(), getDeleteAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public com.google.longrunning.Operation exportAgent( com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request) { return blockingUnaryCall(getChannel(), getExportAgentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public com.google.longrunning.Operation restoreAgent( com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request) { return blockingUnaryCall(getChannel(), getRestoreAgentMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
-   * 
- */ + /** */ public static final class AgentsFutureStub extends io.grpc.stub.AbstractFutureStub { private AgentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -803,13 +641,7 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new AgentsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all agents in the specified location.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse> listAgents(com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request) { @@ -817,26 +649,14 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getListAgentsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Agent> getAgent(com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request) { return futureUnaryCall(getChannel().newCall(getGetAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an agent in the specified location.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Agent> createAgent(com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request) { @@ -844,13 +664,7 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getCreateAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Agent> updateAgent(com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request) { @@ -858,41 +672,21 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getUpdateAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteAgent(com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Exports the specified agent to a binary file.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture exportAgent(com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request) { return futureUnaryCall( getChannel().newCall(getExportAgentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Restores the specified agent from a binary file.
-     * Replaces the current agent with a new one. Note that all existing resources
-     * in agent (e.g. intents, entity types, flows) will be removed.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture restoreAgent(com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java index d31f19492..2bbee4fbe 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/entity_type.proto") @@ -310,22 +304,10 @@ public EntityTypesFutureStub newStub( return EntityTypesFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
-   * 
- */ + /** */ public abstract static class EntityTypesImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -333,13 +315,7 @@ public void listEntityTypes( asyncUnimplementedUnaryCall(getListEntityTypesMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public void getEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -347,13 +323,7 @@ public void getEntityType( asyncUnimplementedUnaryCall(getGetEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public void createEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -361,13 +331,7 @@ public void createEntityType( asyncUnimplementedUnaryCall(getCreateEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -375,13 +339,7 @@ public void updateEntityType( asyncUnimplementedUnaryCall(getUpdateEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -429,13 +387,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
-   * 
- */ + /** */ public static final class EntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private EntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -447,13 +399,7 @@ protected EntityTypesStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new EntityTypesStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -464,13 +410,7 @@ public void listEntityTypes( responseObserver); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public void getEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -481,13 +421,7 @@ public void getEntityType( responseObserver); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public void createEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -498,13 +432,7 @@ public void createEntityType( responseObserver); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -515,13 +443,7 @@ public void updateEntityType( responseObserver); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -532,13 +454,7 @@ public void deleteEntityType( } } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
-   * 
- */ + /** */ public static final class EntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EntityTypesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -551,63 +467,33 @@ protected EntityTypesBlockingStub build( return new EntityTypesBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse listEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request) { return blockingUnaryCall(getChannel(), getListEntityTypesMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request) { return blockingUnaryCall(getChannel(), getGetEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.EntityType createEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.EntityType updateEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request) { return blockingUnaryCall( @@ -615,13 +501,7 @@ public com.google.protobuf.Empty deleteEntityType( } } - /** - * - * - *
-   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
-   * 
- */ + /** */ public static final class EntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private EntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -634,13 +514,7 @@ protected EntityTypesFutureStub build( return new EntityTypesFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all entity types in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse> listEntityTypes(com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request) { @@ -648,13 +522,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getListEntityTypesMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.EntityType> getEntityType(com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request) { @@ -662,13 +530,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getGetEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an entity type in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.EntityType> createEntityType(com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request) { @@ -676,13 +538,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getCreateEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.EntityType> updateEntityType(com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request) { @@ -690,13 +546,7 @@ protected EntityTypesFutureStub build( getChannel().newCall(getUpdateEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteEntityType(com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java index 8b917626f..970ae710a 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/environment.proto") @@ -362,22 +356,10 @@ public EnvironmentsFutureStub newStub( return EnvironmentsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
-   * 
- */ + /** */ public abstract static class EnvironmentsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -385,13 +367,7 @@ public void listEnvironments( asyncUnimplementedUnaryCall(getListEnvironmentsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -399,52 +375,28 @@ public void getEnvironment( asyncUnimplementedUnaryCall(getGetEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteEnvironmentMethod(), responseObserver); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -499,13 +451,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
-   * 
- */ + /** */ public static final class EnvironmentsStub extends io.grpc.stub.AbstractAsyncStub { private EnvironmentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -517,13 +463,7 @@ protected EnvironmentsStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new EnvironmentsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -534,13 +474,7 @@ public void listEnvironments( responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -551,13 +485,7 @@ public void getEnvironment( responseObserver); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -567,13 +495,7 @@ public void createEnvironment( responseObserver); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -583,13 +505,7 @@ public void updateEnvironment( responseObserver); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -599,13 +515,7 @@ public void deleteEnvironment( responseObserver); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -618,13 +528,7 @@ public void lookupEnvironmentHistory( } } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
-   * 
- */ + /** */ public static final class EnvironmentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EnvironmentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -637,77 +541,41 @@ protected EnvironmentsBlockingStub build( return new EnvironmentsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse listEnvironments( com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request) { return blockingUnaryCall( getChannel(), getListEnvironmentsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment( com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request) { return blockingUnaryCall(getChannel(), getGetEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public com.google.longrunning.Operation createEnvironment( com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getCreateEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.longrunning.Operation updateEnvironment( com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getUpdateEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteEnvironment( com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getDeleteEnvironmentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request) { @@ -716,13 +584,7 @@ public com.google.protobuf.Empty deleteEnvironment( } } - /** - * - * - *
-   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
-   * 
- */ + /** */ public static final class EnvironmentsFutureStub extends io.grpc.stub.AbstractFutureStub { private EnvironmentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -735,13 +597,7 @@ protected EnvironmentsFutureStub build( return new EnvironmentsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse> listEnvironments(com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request) { @@ -749,13 +605,7 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getListEnvironmentsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Environment> getEnvironment(com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request) { @@ -763,52 +613,28 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture createEnvironment(com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getCreateEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture updateEnvironment(com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getUpdateEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteEnvironment(com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteEnvironmentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> lookupEnvironmentHistory( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java index 02652bcb6..dc32c1aa0 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/flow.proto") @@ -344,48 +338,24 @@ public FlowsFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return FlowsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
-   * 
- */ + /** */ public abstract static class FlowsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public void createFlow( com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateFlowMethod(), responseObserver); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteFlowMethod(), responseObserver); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public void listFlows( com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -393,40 +363,21 @@ public void listFlows( asyncUnimplementedUnaryCall(getListFlowsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public void getFlow( com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetFlowMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public void updateFlow( com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateFlowMethod(), responseObserver); } - /** - * - * - *
-     * Trains the specified flow. Note that only the flow in 'draft' environment
-     * is trained.
-     * 
- */ + /** */ public void trainFlow( com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -477,13 +428,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
-   * 
- */ + /** */ public static final class FlowsStub extends io.grpc.stub.AbstractAsyncStub { private FlowsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -494,13 +439,7 @@ protected FlowsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new FlowsStub(channel, callOptions); } - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public void createFlow( com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -508,13 +447,7 @@ public void createFlow( getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -522,13 +455,7 @@ public void deleteFlow( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public void listFlows( com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -537,13 +464,7 @@ public void listFlows( getChannel().newCall(getListFlowsMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public void getFlow( com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -551,13 +472,7 @@ public void getFlow( getChannel().newCall(getGetFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public void updateFlow( com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -565,14 +480,7 @@ public void updateFlow( getChannel().newCall(getUpdateFlowMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Trains the specified flow. Note that only the flow in 'draft' environment
-     * is trained.
-     * 
- */ + /** */ public void trainFlow( com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -581,13 +489,7 @@ public void trainFlow( } } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
-   * 
- */ + /** */ public static final class FlowsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private FlowsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -599,87 +501,44 @@ protected FlowsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new FlowsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Flow createFlow( com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request) { return blockingUnaryCall(getChannel(), getCreateFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request) { return blockingUnaryCall(getChannel(), getDeleteFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse listFlows( com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request) { return blockingUnaryCall(getChannel(), getListFlowsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow( com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request) { return blockingUnaryCall(getChannel(), getGetFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Flow updateFlow( com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request) { return blockingUnaryCall(getChannel(), getUpdateFlowMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Trains the specified flow. Note that only the flow in 'draft' environment
-     * is trained.
-     * 
- */ + /** */ public com.google.longrunning.Operation trainFlow( com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request) { return blockingUnaryCall(getChannel(), getTrainFlowMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
-   * 
- */ + /** */ public static final class FlowsFutureStub extends io.grpc.stub.AbstractFutureStub { private FlowsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -691,13 +550,7 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new FlowsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Creates a flow in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Flow> createFlow(com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request) { @@ -705,52 +558,28 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes a specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Returns the list of all flows in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse> listFlows(com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request) { return futureUnaryCall(getChannel().newCall(getListFlowsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Flow> getFlow(com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request) { return futureUnaryCall(getChannel().newCall(getGetFlowMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Flow> updateFlow(com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request) { @@ -758,14 +587,7 @@ public com.google.common.util.concurrent.ListenableFuture - * Trains the specified flow. Note that only the flow in 'draft' environment - * is trained. - * - */ + /** */ public com.google.common.util.concurrent.ListenableFuture trainFlow(com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request) { return futureUnaryCall(getChannel().newCall(getTrainFlowMethod(), getCallOptions()), request); diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java index 8d49ad05b..aa5ce6010 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/intent.proto") @@ -302,22 +296,10 @@ public IntentsFutureStub newStub( return IntentsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
-   * 
- */ + /** */ public abstract static class IntentsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public void listIntents( com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -325,13 +307,7 @@ public void listIntents( asyncUnimplementedUnaryCall(getListIntentsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public void getIntent( com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request, io.grpc.stub.StreamObserver @@ -339,13 +315,7 @@ public void getIntent( asyncUnimplementedUnaryCall(getGetIntentMethod(), responseObserver); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public void createIntent( com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request, io.grpc.stub.StreamObserver @@ -353,13 +323,7 @@ public void createIntent( asyncUnimplementedUnaryCall(getCreateIntentMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public void updateIntent( com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request, io.grpc.stub.StreamObserver @@ -367,13 +331,7 @@ public void updateIntent( asyncUnimplementedUnaryCall(getUpdateIntentMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -418,13 +376,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
-   * 
- */ + /** */ public static final class IntentsStub extends io.grpc.stub.AbstractAsyncStub { private IntentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -435,13 +387,7 @@ protected IntentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpt return new IntentsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public void listIntents( com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -452,13 +398,7 @@ public void listIntents( responseObserver); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public void getIntent( com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request, io.grpc.stub.StreamObserver @@ -467,13 +407,7 @@ public void getIntent( getChannel().newCall(getGetIntentMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public void createIntent( com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request, io.grpc.stub.StreamObserver @@ -484,13 +418,7 @@ public void createIntent( responseObserver); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public void updateIntent( com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request, io.grpc.stub.StreamObserver @@ -501,13 +429,7 @@ public void updateIntent( responseObserver); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -518,13 +440,7 @@ public void deleteIntent( } } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
-   * 
- */ + /** */ public static final class IntentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private IntentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -536,74 +452,38 @@ protected IntentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new IntentsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse listIntents( com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request) { return blockingUnaryCall(getChannel(), getListIntentsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent( com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request) { return blockingUnaryCall(getChannel(), getGetIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Intent createIntent( com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request) { return blockingUnaryCall(getChannel(), getCreateIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Intent updateIntent( com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request) { return blockingUnaryCall(getChannel(), getUpdateIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteIntent( com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request) { return blockingUnaryCall(getChannel(), getDeleteIntentMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
-   * 
- */ + /** */ public static final class IntentsFutureStub extends io.grpc.stub.AbstractFutureStub { private IntentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -615,13 +495,7 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new IntentsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all intents in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse> listIntents(com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request) { @@ -629,26 +503,14 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getListIntentsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified intent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Intent> getIntent(com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request) { return futureUnaryCall(getChannel().newCall(getGetIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an intent in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Intent> createIntent(com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request) { @@ -656,13 +518,7 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getCreateIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified intent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Intent> updateIntent(com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request) { @@ -670,13 +526,7 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getUpdateIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified intent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteIntent(com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java index c96f2ce69..d6cd0a42b 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/page.proto") @@ -301,22 +295,10 @@ public PagesFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return PagesFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
-   * 
- */ + /** */ public abstract static class PagesImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public void listPages( com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -324,52 +306,28 @@ public void listPages( asyncUnimplementedUnaryCall(getListPagesMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public void getPage( com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetPageMethod(), responseObserver); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public void createPage( com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreatePageMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public void updatePage( com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdatePageMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public void deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -414,13 +372,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
-   * 
- */ + /** */ public static final class PagesStub extends io.grpc.stub.AbstractAsyncStub { private PagesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -431,13 +383,7 @@ protected PagesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new PagesStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public void listPages( com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -446,13 +392,7 @@ public void listPages( getChannel().newCall(getListPagesMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public void getPage( com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -460,13 +400,7 @@ public void getPage( getChannel().newCall(getGetPageMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public void createPage( com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -474,13 +408,7 @@ public void createPage( getChannel().newCall(getCreatePageMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public void updatePage( com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -488,13 +416,7 @@ public void updatePage( getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public void deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -503,13 +425,7 @@ public void deletePage( } } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
-   * 
- */ + /** */ public static final class PagesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private PagesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -521,74 +437,38 @@ protected PagesBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new PagesBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse listPages( com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request) { return blockingUnaryCall(getChannel(), getListPagesMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Page getPage( com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request) { return blockingUnaryCall(getChannel(), getGetPageMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Page createPage( com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request) { return blockingUnaryCall(getChannel(), getCreatePageMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Page updatePage( com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request) { return blockingUnaryCall(getChannel(), getUpdatePageMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public com.google.protobuf.Empty deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request) { return blockingUnaryCall(getChannel(), getDeletePageMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
-   * 
- */ + /** */ public static final class PagesFutureStub extends io.grpc.stub.AbstractFutureStub { private PagesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -600,39 +480,21 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new PagesFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all pages in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse> listPages(com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request) { return futureUnaryCall(getChannel().newCall(getListPagesMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified page.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Page> getPage(com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request) { return futureUnaryCall(getChannel().newCall(getGetPageMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a page in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Page> createPage(com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request) { @@ -640,13 +502,7 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreatePageMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified page.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Page> updatePage(com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request) { @@ -654,13 +510,7 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified page.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java index 7ebafc045..fa28e15c0 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto") @@ -333,22 +327,10 @@ public SessionEntityTypesFutureStub newStub( return SessionEntityTypesFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
-   * 
- */ + /** */ public abstract static class SessionEntityTypesImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -357,13 +339,7 @@ public void listSessionEntityTypes( asyncUnimplementedUnaryCall(getListSessionEntityTypesMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -371,15 +347,7 @@ public void getSessionEntityType( asyncUnimplementedUnaryCall(getGetSessionEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -387,13 +355,7 @@ public void createSessionEntityType( asyncUnimplementedUnaryCall(getCreateSessionEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -401,13 +363,7 @@ public void updateSessionEntityType( asyncUnimplementedUnaryCall(getUpdateSessionEntityTypeMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -455,13 +411,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
-   * 
- */ + /** */ public static final class SessionEntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private SessionEntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -474,13 +424,7 @@ protected SessionEntityTypesStub build( return new SessionEntityTypesStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -492,13 +436,7 @@ public void listSessionEntityTypes( responseObserver); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -509,15 +447,7 @@ public void getSessionEntityType( responseObserver); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -528,13 +458,7 @@ public void createSessionEntityType( responseObserver); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -545,13 +469,7 @@ public void updateSessionEntityType( responseObserver); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -562,13 +480,7 @@ public void deleteSessionEntityType( } } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
-   * 
- */ + /** */ public static final class SessionEntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionEntityTypesBlockingStub( @@ -582,13 +494,7 @@ protected SessionEntityTypesBlockingStub build( return new SessionEntityTypesBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request) { @@ -596,54 +502,28 @@ protected SessionEntityTypesBlockingStub build( getChannel(), getListSessionEntityTypesMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getGetSessionEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType createSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateSessionEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType updateSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateSessionEntityTypeMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request) { return blockingUnaryCall( @@ -651,13 +531,7 @@ public com.google.protobuf.Empty deleteSessionEntityType( } } - /** - * - * - *
-   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
-   * 
- */ + /** */ public static final class SessionEntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionEntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -670,13 +544,7 @@ protected SessionEntityTypesFutureStub build( return new SessionEntityTypesFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all session entity types in the specified session.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> listSessionEntityTypes( @@ -685,13 +553,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getListSessionEntityTypesMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> getSessionEntityType( @@ -700,15 +562,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getGetSessionEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a session entity type.
-     * If the specified session entity type already exists, overrides the
-     * session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> createSessionEntityType( @@ -717,13 +571,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getCreateSessionEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> updateSessionEntityType( @@ -732,13 +580,7 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getUpdateSessionEntityTypeMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified session entity type.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java index ad3ac2aac..c7e0a98df 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java @@ -25,15 +25,7 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * A session represents an interaction with a user. You retrieve user input
- * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
- * user intent and respond.
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/session.proto") @@ -271,27 +263,10 @@ public SessionsFutureStub newStub( return SessionsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public abstract static class SessionsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public void detectIntent( com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -299,15 +274,7 @@ public void detectIntent( asyncUnimplementedUnaryCall(getDetectIntentMethod(), responseObserver); } - /** - * - * - *
-     * Processes a natural language query in audio format in a streaming fashion
-     * and returns structured, actionable data as a result. This method is only
-     * available via the gRPC API (not REST).
-     * 
- */ + /** */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest> streamingDetectIntent( @@ -317,14 +284,7 @@ public void detectIntent( return asyncUnimplementedStreamingCall(getStreamingDetectIntentMethod(), responseObserver); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public void matchIntent( com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -332,15 +292,7 @@ public void matchIntent( asyncUnimplementedUnaryCall(getMatchIntentMethod(), responseObserver); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -383,15 +335,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public static final class SessionsStub extends io.grpc.stub.AbstractAsyncStub { private SessionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -402,16 +346,7 @@ protected SessionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new SessionsStub(channel, callOptions); } - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public void detectIntent( com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -422,15 +357,7 @@ public void detectIntent( responseObserver); } - /** - * - * - *
-     * Processes a natural language query in audio format in a streaming fashion
-     * and returns structured, actionable data as a result. This method is only
-     * available via the gRPC API (not REST).
-     * 
- */ + /** */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest> streamingDetectIntent( @@ -442,14 +369,7 @@ public void detectIntent( responseObserver); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public void matchIntent( com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -460,15 +380,7 @@ public void matchIntent( responseObserver); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -480,15 +392,7 @@ public void fulfillIntent( } } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public static final class SessionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -500,58 +404,26 @@ protected SessionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new SessionsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detectIntent( com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request) { return blockingUnaryCall(getChannel(), getDetectIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse matchIntent( com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request) { return blockingUnaryCall(getChannel(), getMatchIntentMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse fulfillIntent( com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request) { return blockingUnaryCall(getChannel(), getFulfillIntentMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * A session represents an interaction with a user. You retrieve user input
-   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
-   * user intent and respond.
-   * 
- */ + /** */ public static final class SessionsFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -563,16 +435,7 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new SessionsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Processes a natural language query and returns structured, actionable data
-     * as a result. This method is not idempotent, because it may cause session
-     * entity types to be updated, which in turn might affect results of future
-     * queries.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse> detectIntent(com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request) { @@ -580,14 +443,7 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getDetectIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Returns preliminary intent match results, doesn't change the session
-     * status.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse> matchIntent(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request) { @@ -595,15 +451,7 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getMatchIntentMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
-     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
-     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse> fulfillIntent(com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java index d78032c42..750119af9 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto") @@ -345,22 +339,10 @@ public TransitionRouteGroupsFutureStub newStub( return TransitionRouteGroupsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-   * 
- */ + /** */ public abstract static class TransitionRouteGroupsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -369,13 +351,7 @@ public void listTransitionRouteGroups( asyncUnimplementedUnaryCall(getListTransitionRouteGroupsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -383,13 +359,7 @@ public void getTransitionRouteGroup( asyncUnimplementedUnaryCall(getGetTransitionRouteGroupMethod(), responseObserver); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -397,13 +367,7 @@ public void createTransitionRouteGroup( asyncUnimplementedUnaryCall(getCreateTransitionRouteGroupMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -411,13 +375,7 @@ public void updateTransitionRouteGroup( asyncUnimplementedUnaryCall(getUpdateTransitionRouteGroupMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -465,13 +423,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-   * 
- */ + /** */ public static final class TransitionRouteGroupsStub extends io.grpc.stub.AbstractAsyncStub { private TransitionRouteGroupsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -484,13 +436,7 @@ protected TransitionRouteGroupsStub build( return new TransitionRouteGroupsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -502,13 +448,7 @@ public void listTransitionRouteGroups( responseObserver); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -519,13 +459,7 @@ public void getTransitionRouteGroup( responseObserver); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -536,13 +470,7 @@ public void createTransitionRouteGroup( responseObserver); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -553,13 +481,7 @@ public void updateTransitionRouteGroup( responseObserver); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -570,13 +492,7 @@ public void deleteTransitionRouteGroup( } } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-   * 
- */ + /** */ public static final class TransitionRouteGroupsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private TransitionRouteGroupsBlockingStub( @@ -590,13 +506,7 @@ protected TransitionRouteGroupsBlockingStub build( return new TransitionRouteGroupsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request) { @@ -604,52 +514,28 @@ protected TransitionRouteGroupsBlockingStub build( getChannel(), getListTransitionRouteGroupsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getGetTransitionRouteGroupMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getCreateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getUpdateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request) { return blockingUnaryCall( @@ -657,13 +543,7 @@ public com.google.protobuf.Empty deleteTransitionRouteGroup( } } - /** - * - * - *
-   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-   * 
- */ + /** */ public static final class TransitionRouteGroupsFutureStub extends io.grpc.stub.AbstractFutureStub { private TransitionRouteGroupsFutureStub( @@ -677,13 +557,7 @@ protected TransitionRouteGroupsFutureStub build( return new TransitionRouteGroupsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all transition route groups in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> listTransitionRouteGroups( @@ -692,13 +566,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getListTransitionRouteGroupsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> getTransitionRouteGroup( @@ -707,13 +575,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getGetTransitionRouteGroupMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> createTransitionRouteGroup( @@ -722,13 +584,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getCreateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> updateTransitionRouteGroup( @@ -737,13 +593,7 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getUpdateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java index 66cebc75c..20f990ccf 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/version.proto") @@ -347,22 +341,10 @@ public VersionsFutureStub newStub( return VersionsFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
-   * 
- */ + /** */ public abstract static class VersionsImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public void listVersions( com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -370,13 +352,7 @@ public void listVersions( asyncUnimplementedUnaryCall(getListVersionsMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public void getVersion( com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request, io.grpc.stub.StreamObserver @@ -384,26 +360,14 @@ public void getVersion( asyncUnimplementedUnaryCall(getGetVersionMethod(), responseObserver); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public void createVersion( com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateVersionMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public void updateVersion( com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request, io.grpc.stub.StreamObserver @@ -411,26 +375,14 @@ public void updateVersion( asyncUnimplementedUnaryCall(getUpdateVersionMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteVersionMethod(), responseObserver); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public void loadVersion( com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -482,13 +434,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
-   * 
- */ + /** */ public static final class VersionsStub extends io.grpc.stub.AbstractAsyncStub { private VersionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -499,13 +445,7 @@ protected VersionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new VersionsStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public void listVersions( com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -516,13 +456,7 @@ public void listVersions( responseObserver); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public void getVersion( com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request, io.grpc.stub.StreamObserver @@ -531,13 +465,7 @@ public void getVersion( getChannel().newCall(getGetVersionMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public void createVersion( com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -547,13 +475,7 @@ public void createVersion( responseObserver); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public void updateVersion( com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request, io.grpc.stub.StreamObserver @@ -564,13 +486,7 @@ public void updateVersion( responseObserver); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -580,13 +496,7 @@ public void deleteVersion( responseObserver); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public void loadVersion( com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -597,13 +507,7 @@ public void loadVersion( } } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
-   * 
- */ + /** */ public static final class VersionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private VersionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -615,86 +519,44 @@ protected VersionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new VersionsBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse listVersions( com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request) { return blockingUnaryCall(getChannel(), getListVersionsMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Version getVersion( com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request) { return blockingUnaryCall(getChannel(), getGetVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public com.google.longrunning.Operation createVersion( com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request) { return blockingUnaryCall(getChannel(), getCreateVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Version updateVersion( com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request) { return blockingUnaryCall(getChannel(), getUpdateVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteVersion( com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request) { return blockingUnaryCall(getChannel(), getDeleteVersionMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public com.google.longrunning.Operation loadVersion( com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request) { return blockingUnaryCall(getChannel(), getLoadVersionMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
-   * 
- */ + /** */ public static final class VersionsFutureStub extends io.grpc.stub.AbstractFutureStub { private VersionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -706,13 +568,7 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new VersionsFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse> listVersions(com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request) { @@ -720,13 +576,7 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListVersionsMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Version> getVersion(com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request) { @@ -734,26 +584,14 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture createVersion(com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request) { return futureUnaryCall( getChannel().newCall(getCreateVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Version> updateVersion(com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request) { @@ -761,26 +599,14 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteVersion(com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Loads a specified version to draft version.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture loadVersion(com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java index 7dacfd048..fa381f35f 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java @@ -22,13 +22,7 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** - * - * - *
- * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
- * 
- */ +/** */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/webhook.proto") @@ -302,22 +296,10 @@ public WebhooksFutureStub newStub( return WebhooksFutureStub.newStub(factory, channel); } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
-   * 
- */ + /** */ public abstract static class WebhooksImplBase implements io.grpc.BindableService { - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -325,13 +307,7 @@ public void listWebhooks( asyncUnimplementedUnaryCall(getListWebhooksMethod(), responseObserver); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public void getWebhook( com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request, io.grpc.stub.StreamObserver @@ -339,13 +315,7 @@ public void getWebhook( asyncUnimplementedUnaryCall(getGetWebhookMethod(), responseObserver); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public void createWebhook( com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request, io.grpc.stub.StreamObserver @@ -353,13 +323,7 @@ public void createWebhook( asyncUnimplementedUnaryCall(getCreateWebhookMethod(), responseObserver); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request, io.grpc.stub.StreamObserver @@ -367,13 +331,7 @@ public void updateWebhook( asyncUnimplementedUnaryCall(getUpdateWebhookMethod(), responseObserver); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -420,13 +378,7 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
-   * 
- */ + /** */ public static final class WebhooksStub extends io.grpc.stub.AbstractAsyncStub { private WebhooksStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -437,13 +389,7 @@ protected WebhooksStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new WebhooksStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -454,13 +400,7 @@ public void listWebhooks( responseObserver); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public void getWebhook( com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request, io.grpc.stub.StreamObserver @@ -469,13 +409,7 @@ public void getWebhook( getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request, responseObserver); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public void createWebhook( com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request, io.grpc.stub.StreamObserver @@ -486,13 +420,7 @@ public void createWebhook( responseObserver); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request, io.grpc.stub.StreamObserver @@ -503,13 +431,7 @@ public void updateWebhook( responseObserver); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -520,13 +442,7 @@ public void deleteWebhook( } } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
-   * 
- */ + /** */ public static final class WebhooksBlockingStub extends io.grpc.stub.AbstractBlockingStub { private WebhooksBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -538,74 +454,38 @@ protected WebhooksBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new WebhooksBlockingStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse listWebhooks( com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request) { return blockingUnaryCall(getChannel(), getListWebhooksMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook( com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request) { return blockingUnaryCall(getChannel(), getGetWebhookMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Webhook createWebhook( com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request) { return blockingUnaryCall(getChannel(), getCreateWebhookMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public com.google.cloud.dialogflow.cx.v3beta1.Webhook updateWebhook( com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request) { return blockingUnaryCall(getChannel(), getUpdateWebhookMethod(), getCallOptions(), request); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public com.google.protobuf.Empty deleteWebhook( com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request) { return blockingUnaryCall(getChannel(), getDeleteWebhookMethod(), getCallOptions(), request); } } - /** - * - * - *
-   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
-   * 
- */ + /** */ public static final class WebhooksFutureStub extends io.grpc.stub.AbstractFutureStub { private WebhooksFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -617,13 +497,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new WebhooksFutureStub(channel, callOptions); } - /** - * - * - *
-     * Returns the list of all webhooks in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse> listWebhooks(com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request) { @@ -631,13 +505,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListWebhooksMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Retrieves the specified webhook.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Webhook> getWebhook(com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request) { @@ -645,13 +513,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Creates a webhook in the specified agent.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Webhook> createWebhook(com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request) { @@ -659,13 +521,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getCreateWebhookMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Updates the specified webhook.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Webhook> updateWebhook(com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request) { @@ -673,13 +529,7 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateWebhookMethod(), getCallOptions()), request); } - /** - * - * - *
-     * Deletes the specified webhook.
-     * 
- */ + /** */ public com.google.common.util.concurrent.ListenableFuture deleteWebhook(com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request) { return futureUnaryCall( diff --git a/synth.metadata b/synth.metadata index b74f6eb87..abc698622 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "836f0eaf5f21f300f63ac635e5ef263d183e0cdd", - "internalRef": "342188199" + "sha": "b11a87f3b54be3a5e42c15020ee1e0781f86da90", + "internalRef": "344134135" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "836f0eaf5f21f300f63ac635e5ef263d183e0cdd", - "internalRef": "342188199" + "sha": "b11a87f3b54be3a5e42c15020ee1e0781f86da90", + "internalRef": "344134135" } }, { From 3f9f7f31e004992566fb2d6cdbeafad9818598ab Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:19:25 -0800 Subject: [PATCH 4/9] chore: migrate dialogflow-cx to the Java microgenerator Committer: @miraleung PiperOrigin-RevId: 345049577 Source-Author: Google APIs Source-Date: Tue Dec 1 10:30:10 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: ca7389d35c91ba8aae893fbafd68127d1ff535d2 Source-Link: https://github.com/googleapis/googleapis/commit/ca7389d35c91ba8aae893fbafd68127d1ff535d2 --- .../cloud/dialogflow/cx/v3/AgentsClient.java | 430 ++-------------- .../dialogflow/cx/v3/AgentsSettings.java | 43 +- .../dialogflow/cx/v3/EntityTypesClient.java | 339 ++----------- .../dialogflow/cx/v3/EntityTypesSettings.java | 35 +- .../dialogflow/cx/v3/EnvironmentsClient.java | 464 ++--------------- .../cx/v3/EnvironmentsSettings.java | 43 +- .../cloud/dialogflow/cx/v3/FlowsClient.java | 418 ++-------------- .../cloud/dialogflow/cx/v3/FlowsSettings.java | 39 +- .../cloud/dialogflow/cx/v3/IntentsClient.java | 338 ++----------- .../dialogflow/cx/v3/IntentsSettings.java | 35 +- .../cloud/dialogflow/cx/v3/PagesClient.java | 338 ++----------- .../cloud/dialogflow/cx/v3/PagesSettings.java | 35 +- .../cx/v3/SecuritySettingsServiceClient.java | 334 ++----------- .../v3/SecuritySettingsServiceSettings.java | 35 +- .../cx/v3/SessionEntityTypesClient.java | 329 ++----------- .../cx/v3/SessionEntityTypesSettings.java | 35 +- .../dialogflow/cx/v3/SessionsClient.java | 150 +----- .../dialogflow/cx/v3/SessionsSettings.java | 35 +- .../cx/v3/TransitionRouteGroupsClient.java | 329 ++----------- .../cx/v3/TransitionRouteGroupsSettings.java | 35 +- .../dialogflow/cx/v3/VersionsClient.java | 437 ++-------------- .../dialogflow/cx/v3/VersionsSettings.java | 43 +- .../dialogflow/cx/v3/WebhooksClient.java | 335 ++----------- .../dialogflow/cx/v3/WebhooksSettings.java | 35 +- .../cloud/dialogflow/cx/v3/package-info.java | 175 ++----- .../dialogflow/cx/v3/stub/AgentsStub.java | 12 +- .../cx/v3/stub/AgentsStubSettings.java | 294 +++++------ .../cx/v3/stub/EntityTypesStub.java | 9 +- .../cx/v3/stub/EntityTypesStubSettings.java | 241 ++++----- .../cx/v3/stub/EnvironmentsStub.java | 12 +- .../cx/v3/stub/EnvironmentsStubSettings.java | 438 ++++++++--------- .../dialogflow/cx/v3/stub/FlowsStub.java | 11 +- .../cx/v3/stub/FlowsStubSettings.java | 266 +++++----- .../cx/v3/stub/GrpcAgentsCallableFactory.java | 40 +- .../dialogflow/cx/v3/stub/GrpcAgentsStub.java | 61 +-- .../stub/GrpcEntityTypesCallableFactory.java | 40 +- .../cx/v3/stub/GrpcEntityTypesStub.java | 45 +- .../stub/GrpcEnvironmentsCallableFactory.java | 40 +- .../cx/v3/stub/GrpcEnvironmentsStub.java | 74 ++- .../cx/v3/stub/GrpcFlowsCallableFactory.java | 40 +- .../dialogflow/cx/v3/stub/GrpcFlowsStub.java | 53 +- .../v3/stub/GrpcIntentsCallableFactory.java | 40 +- .../cx/v3/stub/GrpcIntentsStub.java | 41 +- .../cx/v3/stub/GrpcPagesCallableFactory.java | 40 +- .../dialogflow/cx/v3/stub/GrpcPagesStub.java | 41 +- ...ecuritySettingsServiceCallableFactory.java | 40 +- .../stub/GrpcSecuritySettingsServiceStub.java | 49 +- ...GrpcSessionEntityTypesCallableFactory.java | 40 +- .../v3/stub/GrpcSessionEntityTypesStub.java | 45 +- .../v3/stub/GrpcSessionsCallableFactory.java | 40 +- .../cx/v3/stub/GrpcSessionsStub.java | 36 +- ...cTransitionRouteGroupsCallableFactory.java | 40 +- .../stub/GrpcTransitionRouteGroupsStub.java | 45 +- .../v3/stub/GrpcVersionsCallableFactory.java | 40 +- .../cx/v3/stub/GrpcVersionsStub.java | 64 ++- .../v3/stub/GrpcWebhooksCallableFactory.java | 40 +- .../cx/v3/stub/GrpcWebhooksStub.java | 41 +- .../dialogflow/cx/v3/stub/IntentsStub.java | 9 +- .../cx/v3/stub/IntentsStubSettings.java | 238 ++++----- .../dialogflow/cx/v3/stub/PagesStub.java | 9 +- .../cx/v3/stub/PagesStubSettings.java | 238 ++++----- .../v3/stub/SecuritySettingsServiceStub.java | 9 +- .../SecuritySettingsServiceStubSettings.java | 262 +++++----- .../cx/v3/stub/SessionEntityTypesStub.java | 9 +- .../stub/SessionEntityTypesStubSettings.java | 272 +++++----- .../dialogflow/cx/v3/stub/SessionsStub.java | 9 +- .../cx/v3/stub/SessionsStubSettings.java | 112 ++--- .../cx/v3/stub/TransitionRouteGroupsStub.java | 9 +- .../TransitionRouteGroupsStubSettings.java | 282 +++++------ .../dialogflow/cx/v3/stub/VersionsStub.java | 12 +- .../cx/v3/stub/VersionsStubSettings.java | 285 +++++------ .../dialogflow/cx/v3/stub/WebhooksStub.java | 9 +- .../cx/v3/stub/WebhooksStubSettings.java | 238 ++++----- .../dialogflow/cx/v3beta1/AgentsClient.java | 431 ++-------------- .../dialogflow/cx/v3beta1/AgentsSettings.java | 44 +- .../cx/v3beta1/EntityTypesClient.java | 340 ++----------- .../cx/v3beta1/EntityTypesSettings.java | 36 +- .../cx/v3beta1/EnvironmentsClient.java | 465 ++---------------- .../cx/v3beta1/EnvironmentsSettings.java | 44 +- .../dialogflow/cx/v3beta1/FlowsClient.java | 419 ++-------------- .../dialogflow/cx/v3beta1/FlowsSettings.java | 40 +- .../dialogflow/cx/v3beta1/IntentsClient.java | 339 ++----------- .../cx/v3beta1/IntentsSettings.java | 36 +- .../dialogflow/cx/v3beta1/PagesClient.java | 339 ++----------- .../dialogflow/cx/v3beta1/PagesSettings.java | 36 +- .../cx/v3beta1/SessionEntityTypesClient.java | 330 ++----------- .../v3beta1/SessionEntityTypesSettings.java | 36 +- .../dialogflow/cx/v3beta1/SessionsClient.java | 151 +----- .../cx/v3beta1/SessionsSettings.java | 36 +- .../v3beta1/TransitionRouteGroupsClient.java | 330 ++----------- .../TransitionRouteGroupsSettings.java | 36 +- .../dialogflow/cx/v3beta1/VersionsClient.java | 438 ++--------------- .../cx/v3beta1/VersionsSettings.java | 44 +- .../dialogflow/cx/v3beta1/WebhooksClient.java | 336 ++----------- .../cx/v3beta1/WebhooksSettings.java | 36 +- .../dialogflow/cx/v3beta1/package-info.java | 159 +----- .../cx/v3beta1/stub/AgentsStub.java | 12 +- .../cx/v3beta1/stub/AgentsStubSettings.java | 293 +++++------ .../cx/v3beta1/stub/EntityTypesStub.java | 9 +- .../v3beta1/stub/EntityTypesStubSettings.java | 240 ++++----- .../cx/v3beta1/stub/EnvironmentsStub.java | 12 +- .../stub/EnvironmentsStubSettings.java | 437 ++++++++-------- .../dialogflow/cx/v3beta1/stub/FlowsStub.java | 11 +- .../cx/v3beta1/stub/FlowsStubSettings.java | 265 +++++----- .../stub/GrpcAgentsCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcAgentsStub.java | 61 +-- .../stub/GrpcEntityTypesCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcEntityTypesStub.java | 45 +- .../stub/GrpcEnvironmentsCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcEnvironmentsStub.java | 74 ++- .../stub/GrpcFlowsCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcFlowsStub.java | 53 +- .../stub/GrpcIntentsCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcIntentsStub.java | 41 +- .../stub/GrpcPagesCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcPagesStub.java | 41 +- ...GrpcSessionEntityTypesCallableFactory.java | 40 +- .../stub/GrpcSessionEntityTypesStub.java | 45 +- .../stub/GrpcSessionsCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcSessionsStub.java | 36 +- ...cTransitionRouteGroupsCallableFactory.java | 40 +- .../stub/GrpcTransitionRouteGroupsStub.java | 45 +- .../stub/GrpcVersionsCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcVersionsStub.java | 64 ++- .../stub/GrpcWebhooksCallableFactory.java | 40 +- .../cx/v3beta1/stub/GrpcWebhooksStub.java | 41 +- .../cx/v3beta1/stub/IntentsStub.java | 9 +- .../cx/v3beta1/stub/IntentsStubSettings.java | 237 ++++----- .../dialogflow/cx/v3beta1/stub/PagesStub.java | 9 +- .../cx/v3beta1/stub/PagesStubSettings.java | 237 ++++----- .../v3beta1/stub/SessionEntityTypesStub.java | 9 +- .../stub/SessionEntityTypesStubSettings.java | 271 +++++----- .../cx/v3beta1/stub/SessionsStub.java | 9 +- .../cx/v3beta1/stub/SessionsStubSettings.java | 111 ++--- .../stub/TransitionRouteGroupsStub.java | 9 +- .../TransitionRouteGroupsStubSettings.java | 281 +++++------ .../cx/v3beta1/stub/VersionsStub.java | 12 +- .../cx/v3beta1/stub/VersionsStubSettings.java | 284 +++++------ .../cx/v3beta1/stub/WebhooksStub.java | 9 +- .../cx/v3beta1/stub/WebhooksStubSettings.java | 237 ++++----- .../dialogflow/cx/v3/AgentsClientTest.java | 438 ++++++++++------- .../cx/v3/EntityTypesClientTest.java | 324 ++++++++---- .../cx/v3/EnvironmentsClientTest.java | 404 ++++++++++----- .../dialogflow/cx/v3/FlowsClientTest.java | 379 +++++++++----- .../dialogflow/cx/v3/IntentsClientTest.java | 347 ++++++++----- .../cloud/dialogflow/cx/v3/MockAgents.java | 6 +- .../dialogflow/cx/v3/MockAgentsImpl.java | 34 +- .../dialogflow/cx/v3/MockEntityTypes.java | 6 +- .../dialogflow/cx/v3/MockEntityTypesImpl.java | 26 +- .../dialogflow/cx/v3/MockEnvironments.java | 6 +- .../cx/v3/MockEnvironmentsImpl.java | 30 +- .../cloud/dialogflow/cx/v3/MockFlows.java | 6 +- .../cloud/dialogflow/cx/v3/MockFlowsImpl.java | 30 +- .../cloud/dialogflow/cx/v3/MockIntents.java | 6 +- .../dialogflow/cx/v3/MockIntentsImpl.java | 26 +- .../cloud/dialogflow/cx/v3/MockPages.java | 6 +- .../cloud/dialogflow/cx/v3/MockPagesImpl.java | 26 +- .../cx/v3/MockSecuritySettingsService.java | 6 +- .../v3/MockSecuritySettingsServiceImpl.java | 26 +- .../cx/v3/MockSessionEntityTypes.java | 6 +- .../cx/v3/MockSessionEntityTypesImpl.java | 26 +- .../cloud/dialogflow/cx/v3/MockSessions.java | 6 +- .../dialogflow/cx/v3/MockSessionsImpl.java | 22 +- .../cx/v3/MockTransitionRouteGroups.java | 6 +- .../cx/v3/MockTransitionRouteGroupsImpl.java | 26 +- .../cloud/dialogflow/cx/v3/MockVersions.java | 6 +- .../dialogflow/cx/v3/MockVersionsImpl.java | 30 +- .../cloud/dialogflow/cx/v3/MockWebhooks.java | 6 +- .../dialogflow/cx/v3/MockWebhooksImpl.java | 26 +- .../dialogflow/cx/v3/PagesClientTest.java | 332 +++++++++---- .../v3/SecuritySettingsServiceClientTest.java | 338 ++++++++----- .../cx/v3/SessionEntityTypesClientTest.java | 324 ++++++++---- .../dialogflow/cx/v3/SessionsClientTest.java | 221 ++++----- .../v3/TransitionRouteGroupsClientTest.java | 329 +++++++++---- .../dialogflow/cx/v3/VersionsClientTest.java | 389 ++++++++++----- .../dialogflow/cx/v3/WebhooksClientTest.java | 314 ++++++++---- .../cx/v3beta1/AgentsClientTest.java | 435 ++++++++++------ .../cx/v3beta1/EntityTypesClientTest.java | 321 ++++++++---- .../cx/v3beta1/EnvironmentsClientTest.java | 401 ++++++++++----- .../cx/v3beta1/FlowsClientTest.java | 376 ++++++++++---- .../cx/v3beta1/IntentsClientTest.java | 344 ++++++++----- .../dialogflow/cx/v3beta1/MockAgents.java | 6 +- .../dialogflow/cx/v3beta1/MockAgentsImpl.java | 34 +- .../cx/v3beta1/MockEntityTypes.java | 6 +- .../cx/v3beta1/MockEntityTypesImpl.java | 26 +- .../cx/v3beta1/MockEnvironments.java | 6 +- .../cx/v3beta1/MockEnvironmentsImpl.java | 30 +- .../dialogflow/cx/v3beta1/MockFlows.java | 6 +- .../dialogflow/cx/v3beta1/MockFlowsImpl.java | 30 +- .../dialogflow/cx/v3beta1/MockIntents.java | 6 +- .../cx/v3beta1/MockIntentsImpl.java | 26 +- .../dialogflow/cx/v3beta1/MockPages.java | 6 +- .../dialogflow/cx/v3beta1/MockPagesImpl.java | 26 +- .../cx/v3beta1/MockSessionEntityTypes.java | 6 +- .../v3beta1/MockSessionEntityTypesImpl.java | 26 +- .../dialogflow/cx/v3beta1/MockSessions.java | 6 +- .../cx/v3beta1/MockSessionsImpl.java | 22 +- .../cx/v3beta1/MockTransitionRouteGroups.java | 6 +- .../MockTransitionRouteGroupsImpl.java | 26 +- .../dialogflow/cx/v3beta1/MockVersions.java | 6 +- .../cx/v3beta1/MockVersionsImpl.java | 30 +- .../dialogflow/cx/v3beta1/MockWebhooks.java | 6 +- .../cx/v3beta1/MockWebhooksImpl.java | 26 +- .../cx/v3beta1/PagesClientTest.java | 329 +++++++++---- .../v3beta1/SessionEntityTypesClientTest.java | 321 ++++++++---- .../cx/v3beta1/SessionsClientTest.java | 218 ++++---- .../TransitionRouteGroupsClientTest.java | 326 ++++++++---- .../cx/v3beta1/VersionsClientTest.java | 386 +++++++++++---- .../cx/v3beta1/WebhooksClientTest.java | 311 ++++++++---- .../cloud/dialogflow/cx/v3/AgentName.java | 119 +++-- .../dialogflow/cx/v3/EntityTypeName.java | 133 ++--- .../dialogflow/cx/v3/EnvironmentName.java | 133 ++--- .../cloud/dialogflow/cx/v3/FlowName.java | 131 ++--- .../cloud/dialogflow/cx/v3/IntentName.java | 131 ++--- .../cloud/dialogflow/cx/v3/LocationName.java | 104 ++-- .../cloud/dialogflow/cx/v3/PageName.java | 146 +++--- .../cx/v3/SecuritySettingsName.java | 118 +++-- .../cx/v3/SessionEntityTypeName.java | 208 ++++---- .../cloud/dialogflow/cx/v3/SessionName.java | 183 +++---- .../cx/v3/TransitionRouteGroupName.java | 147 +++--- .../cloud/dialogflow/cx/v3/VersionName.java | 147 +++--- .../cloud/dialogflow/cx/v3/WebhookName.java | 131 ++--- .../dialogflow/cx/v3beta1/AgentName.java | 119 +++-- .../dialogflow/cx/v3beta1/EntityTypeName.java | 133 ++--- .../cx/v3beta1/EnvironmentName.java | 133 ++--- .../cloud/dialogflow/cx/v3beta1/FlowName.java | 131 ++--- .../dialogflow/cx/v3beta1/IntentName.java | 131 ++--- .../dialogflow/cx/v3beta1/LocationName.java | 104 ++-- .../cloud/dialogflow/cx/v3beta1/PageName.java | 146 +++--- .../cx/v3beta1/SessionEntityTypeName.java | 208 ++++---- .../dialogflow/cx/v3beta1/SessionName.java | 183 +++---- .../cx/v3beta1/TransitionRouteGroupName.java | 147 +++--- .../dialogflow/cx/v3beta1/VersionName.java | 147 +++--- .../dialogflow/cx/v3beta1/WebhookName.java | 131 ++--- synth.metadata | 8 +- 235 files changed, 13057 insertions(+), 16884 deletions(-) diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java index d9a48bfed..ddc46b8fc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -37,26 +38,18 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Agent response = agentsClient.getAgent(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the agentsClient object to clean up resources such as + *

Note: close() needs to be called on the AgentsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -84,28 +77,24 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * AgentsSettings agentsSettings =
  *     AgentsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * AgentsClient agentsClient =
- *     AgentsClient.create(agentsSettings);
- * 
- * 
+ * AgentsClient agentsClient = AgentsClient.create(agentsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * AgentsSettings agentsSettings =
- *     AgentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AgentsClient agentsClient =
- *     AgentsClient.create(agentsSettings);
- * 
- * 
+ *
{@code
+ * AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AgentsClient agentsClient = AgentsClient.create(agentsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class AgentsClient implements BackgroundResource { private final AgentsSettings settings; @@ -127,7 +116,7 @@ public static final AgentsClient create(AgentsSettings settings) throws IOExcept /** * Constructs an instance of AgentsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use AgentsSettings}. + * advanced usage - prefer using create(AgentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AgentsClient create(AgentsStub stub) { @@ -164,52 +153,30 @@ public AgentsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Agent element : agentsClient.listAgents(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The location to list all agents for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAgentsPagedResponse listAgents(LocationName parent) { ListAgentsRequest request = - ListAgentsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListAgentsRequest.newBuilder() + .setParent(Objects.isNull(parent) ? null : parent.toString()) + .build(); return listAgents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Agent element : agentsClient.listAgents(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The location to list all agents for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -219,24 +186,10 @@ public final ListAgentsPagedResponse listAgents(String parent) { return listAgents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Agent element : agentsClient.listAgents(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -244,97 +197,44 @@ public final ListAgentsPagedResponse listAgents(ListAgentsRequest request) { return listAgentsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListAgentsPagedResponse> future = agentsClient.listAgentsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Agent element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listAgentsPagedCallable() { return stub.listAgentsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListAgentsResponse response = agentsClient.listAgentsCallable().call(request);
-   *     for (Agent element : response.getAgentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listAgentsCallable() { return stub.listAgentsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Agent response = agentsClient.getAgent(name);
-   * }
-   * 
- * * @param name Required. The name of the agent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Agent getAgent(AgentName name) { GetAgentRequest request = - GetAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetAgentRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); return getAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Agent response = agentsClient.getAgent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the agent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -344,22 +244,10 @@ public final Agent getAgent(String name) { return getAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   GetAgentRequest request = GetAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Agent response = agentsClient.getAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -367,42 +255,20 @@ public final Agent getAgent(GetAgentRequest request) { return getAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   GetAgentRequest request = GetAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Agent> future = agentsClient.getAgentCallable().futureCall(request);
-   *   // Do something
-   *   Agent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getAgentCallable() { return stub.getAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   Agent response = agentsClient.createAgent(parent, agent);
-   * }
-   * 
- * * @param parent Required. The location to create a agent for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @param agent Required. The agent to create. @@ -411,26 +277,16 @@ public final UnaryCallable getAgentCallable() { public final Agent createAgent(LocationName parent, Agent agent) { CreateAgentRequest request = CreateAgentRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setAgent(agent) .build(); return createAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   Agent response = agentsClient.createAgent(parent.toString(), agent);
-   * }
-   * 
- * * @param parent Required. The location to create a agent for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @param agent Required. The agent to create. @@ -442,24 +298,10 @@ public final Agent createAgent(String parent, Agent agent) { return createAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   CreateAgentRequest request = CreateAgentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setAgent(agent)
-   *     .build();
-   *   Agent response = agentsClient.createAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -467,47 +309,23 @@ public final Agent createAgent(CreateAgentRequest request) { return createAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   CreateAgentRequest request = CreateAgentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setAgent(agent)
-   *     .build();
-   *   ApiFuture<Agent> future = agentsClient.createAgentCallable().futureCall(request);
-   *   // Do something
-   *   Agent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createAgentCallable() { return stub.createAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   Agent agent = Agent.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Agent response = agentsClient.updateAgent(agent, updateMask);
-   * }
-   * 
- * * @param agent Required. The agent to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Agent updateAgent(Agent agent, FieldMask updateMask) { @@ -516,22 +334,10 @@ public final Agent updateAgent(Agent agent, FieldMask updateMask) { return updateAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   Agent agent = Agent.newBuilder().build();
-   *   UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
-   *     .setAgent(agent)
-   *     .build();
-   *   Agent response = agentsClient.updateAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -539,64 +345,36 @@ public final Agent updateAgent(UpdateAgentRequest request) { return updateAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified agent. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   Agent agent = Agent.newBuilder().build();
-   *   UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
-   *     .setAgent(agent)
-   *     .build();
-   *   ApiFuture<Agent> future = agentsClient.updateAgentCallable().futureCall(request);
-   *   // Do something
-   *   Agent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateAgentCallable() { return stub.updateAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   agentsClient.deleteAgent(name);
-   * }
-   * 
- * * @param name Required. The name of the agent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteAgent(AgentName name) { DeleteAgentRequest request = - DeleteAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteAgentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   agentsClient.deleteAgent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the agent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -606,22 +384,10 @@ public final void deleteAgent(String name) { deleteAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   agentsClient.deleteAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -629,129 +395,64 @@ public final void deleteAgent(DeleteAgentRequest request) { deleteAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = agentsClient.deleteAgentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteAgentCallable() { return stub.deleteAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports the specified agent to a binary file. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ExportAgentResponse response = agentsClient.exportAgentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture exportAgentAsync( ExportAgentRequest request) { return exportAgentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports the specified agent to a binary file. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<ExportAgentResponse, Struct> future = agentsClient.exportAgentOperationCallable().futureCall(request);
-   *   // Do something
-   *   ExportAgentResponse response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable exportAgentOperationCallable() { return stub.exportAgentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports the specified agent to a binary file. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = agentsClient.exportAgentCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable exportAgentCallable() { return stub.exportAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restores the specified agent from a binary file. * *

Replaces the current agent with a new one. Note that all existing resources in agent (e.g. * intents, entity types, flows) will be removed. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   agentsClient.restoreAgentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture restoreAgentAsync(RestoreAgentRequest request) { return restoreAgentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restores the specified agent from a binary file. * @@ -759,26 +460,13 @@ public final OperationFuture restoreAgentAsync(RestoreAgentReques * intents, entity types, flows) will be removed. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, Struct> future = agentsClient.restoreAgentOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable restoreAgentOperationCallable() { return stub.restoreAgentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restores the specified agent from a binary file. * @@ -786,18 +474,6 @@ public final OperationFuture restoreAgentAsync(RestoreAgentReques * intents, entity types, flows) will be removed. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = agentsClient.restoreAgentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable restoreAgentCallable() { return stub.restoreAgentCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsSettings.java index 498c92438..c620b8163 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.AgentsClient.ListAgentsPagedResponse; @@ -37,7 +38,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AgentsClient}. * @@ -54,22 +55,23 @@ * *

For example, to set the total timeout of getAgent to 30 seconds: * - *

- * 
- * AgentsSettings.Builder agentsSettingsBuilder =
- *     AgentsSettings.newBuilder();
+ * 
{@code
+ * AgentsSettings.Builder agentsSettingsBuilder = AgentsSettings.newBuilder();
  * agentsSettingsBuilder
  *     .getAgentSettings()
  *     .setRetrySettings(
- *         agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ *         agentsSettingsBuilder
+ *             .getAgentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AgentsSettings agentsSettings = agentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class AgentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listAgents. */ public PagedCallSettings listAgentsSettings() { @@ -102,8 +104,6 @@ public UnaryCallSettings exportAgentSettings() { } /** Returns the object with the settings used for calls to exportAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings exportAgentOperationSettings() { return ((AgentsStubSettings) getStubSettings()).exportAgentOperationSettings(); @@ -115,8 +115,6 @@ public UnaryCallSettings restoreAgentSettings() } /** Returns the object with the settings used for calls to restoreAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings restoreAgentOperationSettings() { return ((AgentsStubSettings) getStubSettings()).restoreAgentOperationSettings(); } @@ -180,18 +178,15 @@ protected AgentsSettings(Builder settingsBuilder) throws IOException { /** Builder for AgentsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(AgentsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(AgentsStubSettings.newBuilder()); - } - protected Builder(AgentsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -200,11 +195,15 @@ protected Builder(AgentsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(AgentsStubSettings.newBuilder()); + } + public AgentsStubSettings.Builder getStubSettingsBuilder() { return ((AgentsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -249,8 +248,6 @@ public UnaryCallSettings.Builder exportAgentSetti } /** Returns the builder for the settings used for calls to exportAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder exportAgentOperationSettings() { return getStubSettingsBuilder().exportAgentOperationSettings(); @@ -262,8 +259,6 @@ public UnaryCallSettings.Builder restoreAgentSet } /** Returns the builder for the settings used for calls to restoreAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder restoreAgentOperationSettings() { return getStubSettingsBuilder().restoreAgentOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java index 9e196ab74..2bd7d5fcc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -32,10 +33,11 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType]. @@ -43,16 +45,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- *   EntityType response = entityTypesClient.getEntityType(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the entityTypesClient object to clean up resources such as + *

Note: close() needs to be called on the EntityTypesClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -80,28 +73,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * EntityTypesSettings entityTypesSettings =
  *     EntityTypesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * EntityTypesClient entityTypesClient =
- *     EntityTypesClient.create(entityTypesSettings);
- * 
- * 
+ * EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * EntityTypesSettings entityTypesSettings =
  *     EntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
- * EntityTypesClient entityTypesClient =
- *     EntityTypesClient.create(entityTypesSettings);
- * 
- * 
+ * EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class EntityTypesClient implements BackgroundResource { private final EntityTypesSettings settings; @@ -122,7 +112,7 @@ public static final EntityTypesClient create(EntityTypesSettings settings) throw /** * Constructs an instance of EntityTypesClient, using the given stub for making calls. This is for - * advanced usage - prefer to use EntityTypesSettings}. + * advanced usage - prefer using create(EntityTypesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EntityTypesClient create(EntityTypesStub stub) { @@ -154,21 +144,10 @@ public EntityTypesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all entity types for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -176,26 +155,15 @@ public EntityTypesStub getStub() { public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) { ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (EntityType element : entityTypesClient.listEntityTypes(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all entity types for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -205,24 +173,10 @@ public final ListEntityTypesPagedResponse listEntityTypes(String parent) { return listEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (EntityType element : entityTypesClient.listEntityTypes(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -230,76 +184,32 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest return listEntityTypesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListEntityTypesPagedResponse> future = entityTypesClient.listEntityTypesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (EntityType element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEntityTypesPagedCallable() { return stub.listEntityTypesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListEntityTypesResponse response = entityTypesClient.listEntityTypesCallable().call(request);
-   *     for (EntityType element : response.getEntityTypesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEntityTypesCallable() { return stub.listEntityTypesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   EntityType response = entityTypesClient.getEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -307,23 +217,16 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest */ public final EntityType getEntityType(EntityTypeName name) { GetEntityTypeRequest request = - GetEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetEntityTypeRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   EntityType response = entityTypesClient.getEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -334,22 +237,10 @@ public final EntityType getEntityType(String name) { return getEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   EntityType response = entityTypesClient.getEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -357,73 +248,41 @@ public final EntityType getEntityType(GetEntityTypeRequest request) { return getEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<EntityType> future = entityTypesClient.getEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   EntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getEntityTypeCallable() { return stub.getEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   EntityType response = entityTypesClient.createEntityType(parent, entityType);
-   * }
-   * 
- * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entityType Required. The entity type to create. + * @param entity_type Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(AgentName parent, EntityType entityType) { CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setEntityType(entityType) .build(); return createEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType);
-   * }
-   * 
- * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entityType Required. The entity type to create. + * @param entity_type Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(String parent, EntityType entityType) { @@ -432,24 +291,10 @@ public final EntityType createEntityType(String parent, EntityType entityType) { return createEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEntityType(entityType)
-   *     .build();
-   *   EntityType response = entityTypesClient.createEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -457,46 +302,22 @@ public final EntityType createEntityType(CreateEntityTypeRequest request) { return createEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEntityType(entityType)
-   *     .build();
-   *   ApiFuture<EntityType> future = entityTypesClient.createEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   EntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createEntityTypeCallable() { return stub.createEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   EntityType response = entityTypesClient.updateEntityType(entityType, updateMask);
-   * }
-   * 
- * - * @param entityType Required. The entity type to update. - * @param updateMask The mask to control which fields get updated. + * @param entity_type Required. The entity type to update. + * @param update_mask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType updateEntityType(EntityType entityType, FieldMask updateMask) { @@ -508,22 +329,10 @@ public final EntityType updateEntityType(EntityType entityType, FieldMask update return updateEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
-   *     .setEntityType(entityType)
-   *     .build();
-   *   EntityType response = entityTypesClient.updateEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -531,41 +340,20 @@ public final EntityType updateEntityType(UpdateEntityTypeRequest request) { return updateEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified entity type. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
-   *     .setEntityType(entityType)
-   *     .build();
-   *   ApiFuture<EntityType> future = entityTypesClient.updateEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   EntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateEntityTypeCallable() { return stub.updateEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   entityTypesClient.deleteEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the entity type to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -573,23 +361,16 @@ public final UnaryCallable updateEntityType */ public final void deleteEntityType(EntityTypeName name) { DeleteEntityTypeRequest request = - DeleteEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteEntityTypeRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   entityTypesClient.deleteEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the entity type to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -600,22 +381,10 @@ public final void deleteEntityType(String name) { deleteEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   entityTypesClient.deleteEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -623,23 +392,11 @@ public final void deleteEntityType(DeleteEntityTypeRequest request) { deleteEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteEntityTypeCallable() { return stub.deleteEntityTypeCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesSettings.java index 4659b4275..f3810cf23 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.EntityTypesClient.ListEntityTypesPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EntityTypesClient}. * @@ -51,22 +52,23 @@ * *

For example, to set the total timeout of getEntityType to 30 seconds: * - *

- * 
- * EntityTypesSettings.Builder entityTypesSettingsBuilder =
- *     EntityTypesSettings.newBuilder();
+ * 
{@code
+ * EntityTypesSettings.Builder entityTypesSettingsBuilder = EntityTypesSettings.newBuilder();
  * entityTypesSettingsBuilder
  *     .getEntityTypeSettings()
  *     .setRetrySettings(
- *         entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ *         entityTypesSettingsBuilder
+ *             .getEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EntityTypesSettings entityTypesSettings = entityTypesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class EntityTypesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listEntityTypes. */ public PagedCallSettings< ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> @@ -153,18 +155,15 @@ protected EntityTypesSettings(Builder settingsBuilder) throws IOException { /** Builder for EntityTypesSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(EntityTypesStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(EntityTypesStubSettings.newBuilder()); - } - protected Builder(EntityTypesSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -173,11 +172,15 @@ protected Builder(EntityTypesStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(EntityTypesStubSettings.newBuilder()); + } + public EntityTypesStubSettings.Builder getStubSettingsBuilder() { return ((EntityTypesStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java index d596f6d1b..018f38810 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -37,10 +38,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [Environments][google.cloud.dialogflow.cx.v3.Environment]. @@ -48,16 +50,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- *   Environment response = environmentsClient.getEnvironment(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the environmentsClient object to clean up resources such + *

Note: close() needs to be called on the EnvironmentsClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -85,28 +78,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * EnvironmentsSettings environmentsSettings =
  *     EnvironmentsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * EnvironmentsClient environmentsClient =
- *     EnvironmentsClient.create(environmentsSettings);
- * 
- * 
+ * EnvironmentsClient environmentsClient = EnvironmentsClient.create(environmentsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * EnvironmentsSettings environmentsSettings =
  *     EnvironmentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * EnvironmentsClient environmentsClient =
- *     EnvironmentsClient.create(environmentsSettings);
- * 
- * 
+ * EnvironmentsClient environmentsClient = EnvironmentsClient.create(environmentsSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class EnvironmentsClient implements BackgroundResource { private final EnvironmentsSettings settings; @@ -128,7 +118,7 @@ public static final EnvironmentsClient create(EnvironmentsSettings settings) thr /** * Constructs an instance of EnvironmentsClient, using the given stub for making calls. This is - * for advanced usage - prefer to use EnvironmentsSettings}. + * for advanced usage - prefer using create(EnvironmentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EnvironmentsClient create(EnvironmentsStub stub) { @@ -166,28 +156,15 @@ public EnvironmentsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Environment element : environmentsClient.listEnvironments(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all * environments for. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>`. @@ -196,27 +173,16 @@ public final OperationsClient getOperationsClient() { public final ListEnvironmentsPagedResponse listEnvironments(AgentName parent) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listEnvironments(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Environment element : environmentsClient.listEnvironments(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to list all * environments for. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>`. @@ -228,25 +194,11 @@ public final ListEnvironmentsPagedResponse listEnvironments(String parent) { return listEnvironments(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Environment element : environmentsClient.listEnvironments(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -254,78 +206,34 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ return listEnvironmentsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListEnvironmentsPagedResponse> future = environmentsClient.listEnvironmentsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Environment element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEnvironmentsPagedCallable() { return stub.listEnvironmentsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListEnvironmentsResponse response = environmentsClient.listEnvironmentsCallable().call(request);
-   *     for (Environment element : response.getEnvironmentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEnvironmentsCallable() { return stub.listEnvironmentsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   Environment response = environmentsClient.getEnvironment(name);
-   * }
-   * 
- * * @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment]. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>`. @@ -333,23 +241,16 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ */ public final Environment getEnvironment(EnvironmentName name) { GetEnvironmentRequest request = - GetEnvironmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetEnvironmentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   Environment response = environmentsClient.getEnvironment(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment]. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>`. @@ -360,22 +261,10 @@ public final Environment getEnvironment(String name) { return getEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Environment response = environmentsClient.getEnvironment(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -383,84 +272,48 @@ public final Environment getEnvironment(GetEnvironmentRequest request) { return getEnvironmentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Environment> future = environmentsClient.getEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   Environment response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getEnvironmentCallable() { return stub.getEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   Environment response = environmentsClient.createEnvironmentAsync(parent, environment).get();
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an * [Environment][google.cloud.dialogflow.cx.v3.Environment] for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param environment Required. The environment to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createEnvironmentAsync( AgentName parent, Environment environment) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setEnvironment(environment) .build(); return createEnvironmentAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   Environment response = environmentsClient.createEnvironmentAsync(parent.toString(), environment).get();
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3.Agent] to create an * [Environment][google.cloud.dialogflow.cx.v3.Environment] for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param environment Required. The environment to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createEnvironmentAsync( String parent, Environment environment) { CreateEnvironmentRequest request = @@ -468,107 +321,50 @@ public final OperationFuture createEnvironmentAsync( return createEnvironmentAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEnvironment(environment)
-   *     .build();
-   *   Environment response = environmentsClient.createEnvironmentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createEnvironmentAsync( CreateEnvironmentRequest request) { return createEnvironmentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEnvironment(environment)
-   *     .build();
-   *   OperationFuture<Environment, Struct> future = environmentsClient.createEnvironmentOperationCallable().futureCall(request);
-   *   // Do something
-   *   Environment response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable createEnvironmentOperationCallable() { return stub.createEnvironmentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEnvironment(environment)
-   *     .build();
-   *   ApiFuture<Operation> future = environmentsClient.createEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createEnvironmentCallable() { return stub.createEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Environment response = environmentsClient.updateEnvironmentAsync(environment, updateMask).get();
-   * }
-   * 
- * * @param environment Required. The environment to update. - * @param updateMask Required. The mask to control which fields get updated. + * @param update_mask Required. The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture updateEnvironmentAsync( Environment environment, FieldMask updateMask) { UpdateEnvironmentRequest request = @@ -579,97 +375,43 @@ public final OperationFuture updateEnvironmentAsync( return updateEnvironmentAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
-   *     .setEnvironment(environment)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Environment response = environmentsClient.updateEnvironmentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture updateEnvironmentAsync( UpdateEnvironmentRequest request) { return updateEnvironmentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
-   *     .setEnvironment(environment)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   OperationFuture<Environment, Struct> future = environmentsClient.updateEnvironmentOperationCallable().futureCall(request);
-   *   // Do something
-   *   Environment response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable updateEnvironmentOperationCallable() { return stub.updateEnvironmentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
-   *     .setEnvironment(environment)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Operation> future = environmentsClient.updateEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateEnvironmentCallable() { return stub.updateEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   environmentsClient.deleteEnvironment(name);
-   * }
-   * 
- * * @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment] * to delete. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>`. @@ -678,24 +420,15 @@ public final UnaryCallable updateEnvironmen public final void deleteEnvironment(EnvironmentName name) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); deleteEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   environmentsClient.deleteEnvironment(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the [Environment][google.cloud.dialogflow.cx.v3.Environment] * to delete. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>`. @@ -706,22 +439,10 @@ public final void deleteEnvironment(String name) { deleteEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   environmentsClient.deleteEnvironment(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -729,43 +450,20 @@ public final void deleteEnvironment(DeleteEnvironmentRequest request) { deleteEnvironmentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = environmentsClient.deleteEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteEnvironmentCallable() { return stub.deleteEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param name Required. Resource name of the environment to look up the history for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>`. @@ -775,26 +473,15 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( EnvironmentName name) { LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); return lookupEnvironmentHistory(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param name Required. Resource name of the environment to look up the history for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>`. @@ -806,24 +493,10 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory(Stri return lookupEnvironmentHistory(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -832,57 +505,22 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( return lookupEnvironmentHistoryPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<LookupEnvironmentHistoryPagedResponse> future = environmentsClient.lookupEnvironmentHistoryPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Environment element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable lookupEnvironmentHistoryPagedCallable() { return stub.lookupEnvironmentHistoryPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   while (true) {
-   *     LookupEnvironmentHistoryResponse response = environmentsClient.lookupEnvironmentHistoryCallable().call(request);
-   *     for (Environment element : response.getEnvironmentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable lookupEnvironmentHistoryCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java index fed683871..c366e8e36 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.EnvironmentsClient.ListEnvironmentsPagedResponse; @@ -38,7 +39,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EnvironmentsClient}. * @@ -55,22 +56,23 @@ * *

For example, to set the total timeout of getEnvironment to 30 seconds: * - *

- * 
- * EnvironmentsSettings.Builder environmentsSettingsBuilder =
- *     EnvironmentsSettings.newBuilder();
+ * 
{@code
+ * EnvironmentsSettings.Builder environmentsSettingsBuilder = EnvironmentsSettings.newBuilder();
  * environmentsSettingsBuilder
  *     .getEnvironmentSettings()
  *     .setRetrySettings(
- *         environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ *         environmentsSettingsBuilder
+ *             .getEnvironmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EnvironmentsSettings environmentsSettings = environmentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class EnvironmentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listEnvironments. */ public PagedCallSettings< ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> @@ -89,8 +91,6 @@ public UnaryCallSettings createEnvironmentS } /** Returns the object with the settings used for calls to createEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings createEnvironmentOperationSettings() { return ((EnvironmentsStubSettings) getStubSettings()).createEnvironmentOperationSettings(); @@ -102,8 +102,6 @@ public UnaryCallSettings updateEnvironmentS } /** Returns the object with the settings used for calls to updateEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings updateEnvironmentOperationSettings() { return ((EnvironmentsStubSettings) getStubSettings()).updateEnvironmentOperationSettings(); @@ -183,18 +181,15 @@ protected EnvironmentsSettings(Builder settingsBuilder) throws IOException { /** Builder for EnvironmentsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(EnvironmentsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(EnvironmentsStubSettings.newBuilder()); - } - protected Builder(EnvironmentsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -203,11 +198,15 @@ protected Builder(EnvironmentsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(EnvironmentsStubSettings.newBuilder()); + } + public EnvironmentsStubSettings.Builder getStubSettingsBuilder() { return ((EnvironmentsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -239,8 +238,6 @@ public UnaryCallSettings.Builder getEnvironm } /** Returns the builder for the settings used for calls to createEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder createEnvironmentOperationSettings() { return getStubSettingsBuilder().createEnvironmentOperationSettings(); @@ -253,8 +250,6 @@ public UnaryCallSettings.Builder getEnvironm } /** Returns the builder for the settings used for calls to updateEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder updateEnvironmentOperationSettings() { return getStubSettingsBuilder().updateEnvironmentOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java index 234d5a6f0..7137c7557 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -37,27 +38,18 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Flow flow = Flow.newBuilder().build();
- *   Flow response = flowsClient.createFlow(parent, flow);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the flowsClient object to clean up resources such as + *

Note: close() needs to be called on the FlowsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -85,28 +77,24 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * FlowsSettings flowsSettings =
  *     FlowsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * FlowsClient flowsClient =
- *     FlowsClient.create(flowsSettings);
- * 
- * 
+ * FlowsClient flowsClient = FlowsClient.create(flowsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * FlowsSettings flowsSettings =
- *     FlowsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * FlowsClient flowsClient =
- *     FlowsClient.create(flowsSettings);
- * 
- * 
+ *
{@code
+ * FlowsSettings flowsSettings = FlowsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FlowsClient flowsClient = FlowsClient.create(flowsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class FlowsClient implements BackgroundResource { private final FlowsSettings settings; @@ -128,7 +116,7 @@ public static final FlowsClient create(FlowsSettings settings) throws IOExceptio /** * Constructs an instance of FlowsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use FlowsSettings}. + * advanced usage - prefer using create(FlowsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final FlowsClient create(FlowsStub stub) { @@ -165,26 +153,14 @@ public FlowsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   Flow response = flowsClient.createFlow(parent, flow);
-   * }
-   * 
- * * @param parent Required. The agent to create a flow for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param flow Required. The flow to create. @@ -193,26 +169,16 @@ public final OperationsClient getOperationsClient() { public final Flow createFlow(AgentName parent, Flow flow) { CreateFlowRequest request = CreateFlowRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setFlow(flow) .build(); return createFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   Flow response = flowsClient.createFlow(parent.toString(), flow);
-   * }
-   * 
- * * @param parent Required. The agent to create a flow for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param flow Required. The flow to create. @@ -224,24 +190,10 @@ public final Flow createFlow(String parent, Flow flow) { return createFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   CreateFlowRequest request = CreateFlowRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setFlow(flow)
-   *     .build();
-   *   Flow response = flowsClient.createFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -249,66 +201,36 @@ public final Flow createFlow(CreateFlowRequest request) { return createFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   CreateFlowRequest request = CreateFlowRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setFlow(flow)
-   *     .build();
-   *   ApiFuture<Flow> future = flowsClient.createFlowCallable().futureCall(request);
-   *   // Do something
-   *   Flow response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createFlowCallable() { return stub.createFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.deleteFlow(name);
-   * }
-   * 
- * * @param name Required. The name of the flow to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteFlow(FlowName name) { DeleteFlowRequest request = - DeleteFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteFlowRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.deleteFlow(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the flow to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -318,22 +240,10 @@ public final void deleteFlow(String name) { deleteFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   flowsClient.deleteFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -341,68 +251,36 @@ public final void deleteFlow(DeleteFlowRequest request) { deleteFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = flowsClient.deleteFlowCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteFlowCallable() { return stub.deleteFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Flow element : flowsClient.listFlows(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent containing the flows. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListFlowsPagedResponse listFlows(AgentName parent) { ListFlowsRequest request = - ListFlowsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListFlowsRequest.newBuilder() + .setParent(Objects.isNull(parent) ? null : parent.toString()) + .build(); return listFlows(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Flow element : flowsClient.listFlows(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent containing the flows. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -412,24 +290,10 @@ public final ListFlowsPagedResponse listFlows(String parent) { return listFlows(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Flow element : flowsClient.listFlows(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -437,97 +301,44 @@ public final ListFlowsPagedResponse listFlows(ListFlowsRequest request) { return listFlowsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListFlowsPagedResponse> future = flowsClient.listFlowsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Flow element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listFlowsPagedCallable() { return stub.listFlowsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListFlowsResponse response = flowsClient.listFlowsCallable().call(request);
-   *     for (Flow element : response.getFlowsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listFlowsCallable() { return stub.listFlowsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Flow response = flowsClient.getFlow(name);
-   * }
-   * 
- * * @param name Required. The name of the flow to get. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Flow getFlow(FlowName name) { GetFlowRequest request = - GetFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetFlowRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); return getFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Flow response = flowsClient.getFlow(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the flow to get. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -537,22 +348,10 @@ public final Flow getFlow(String name) { return getFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   GetFlowRequest request = GetFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Flow response = flowsClient.getFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -560,44 +359,22 @@ public final Flow getFlow(GetFlowRequest request) { return getFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   GetFlowRequest request = GetFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Flow> future = flowsClient.getFlowCallable().futureCall(request);
-   *   // Do something
-   *   Flow response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getFlowCallable() { return stub.getFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   Flow flow = Flow.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Flow response = flowsClient.updateFlow(flow, updateMask);
-   * }
-   * 
- * * @param flow Required. The flow to update. - * @param updateMask Required. The mask to control which fields get updated. If `update_mask` is + * @param update_mask Required. The mask to control which fields get updated. If `update_mask` is * not specified, an error will be returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -607,24 +384,10 @@ public final Flow updateFlow(Flow flow, FieldMask updateMask) { return updateFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   Flow flow = Flow.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
-   *     .setFlow(flow)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Flow response = flowsClient.updateFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -632,144 +395,71 @@ public final Flow updateFlow(UpdateFlowRequest request) { return updateFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified flow. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   Flow flow = Flow.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
-   *     .setFlow(flow)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Flow> future = flowsClient.updateFlowCallable().futureCall(request);
-   *   // Do something
-   *   Flow response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateFlowCallable() { return stub.updateFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.trainFlowAsync(name).get();
-   * }
-   * 
- * * @param name Required. The flow to train. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture trainFlowAsync(FlowName name) { TrainFlowRequest request = - TrainFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + TrainFlowRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return trainFlowAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.trainFlowAsync(name.toString()).get();
-   * }
-   * 
- * * @param name Required. The flow to train. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture trainFlowAsync(String name) { TrainFlowRequest request = TrainFlowRequest.newBuilder().setName(name).build(); return trainFlowAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   flowsClient.trainFlowAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture trainFlowAsync(TrainFlowRequest request) { return trainFlowOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, Struct> future = flowsClient.trainFlowOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable trainFlowOperationCallable() { return stub.trainFlowOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = flowsClient.trainFlowCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable trainFlowCallable() { return stub.trainFlowCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsSettings.java index b9d19894c..1d282cd1e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.FlowsClient.ListFlowsPagedResponse; @@ -37,7 +38,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link FlowsClient}. * @@ -54,22 +55,23 @@ * *

For example, to set the total timeout of createFlow to 30 seconds: * - *

- * 
- * FlowsSettings.Builder flowsSettingsBuilder =
- *     FlowsSettings.newBuilder();
+ * 
{@code
+ * FlowsSettings.Builder flowsSettingsBuilder = FlowsSettings.newBuilder();
  * flowsSettingsBuilder
  *     .createFlowSettings()
  *     .setRetrySettings(
- *         flowsSettingsBuilder.createFlowSettings().getRetrySettings().toBuilder()
+ *         flowsSettingsBuilder
+ *             .createFlowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * FlowsSettings flowsSettings = flowsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class FlowsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createFlow. */ public UnaryCallSettings createFlowSettings() { return ((FlowsStubSettings) getStubSettings()).createFlowSettings(); @@ -102,8 +104,6 @@ public UnaryCallSettings trainFlowSettings() { } /** Returns the object with the settings used for calls to trainFlow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings trainFlowOperationSettings() { return ((FlowsStubSettings) getStubSettings()).trainFlowOperationSettings(); } @@ -167,18 +167,15 @@ protected FlowsSettings(Builder settingsBuilder) throws IOException { /** Builder for FlowsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(FlowsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(FlowsStubSettings.newBuilder()); - } - protected Builder(FlowsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -187,11 +184,15 @@ protected Builder(FlowsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(FlowsStubSettings.newBuilder()); + } + public FlowsStubSettings.Builder getStubSettingsBuilder() { return ((FlowsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -236,8 +237,6 @@ public UnaryCallSettings.Builder trainFlowSettings( } /** Returns the builder for the settings used for calls to trainFlow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder trainFlowOperationSettings() { return getStubSettingsBuilder().trainFlowOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java index b2c613cd6..486e8f4b4 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -32,26 +33,18 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- *   Intent response = intentsClient.getIntent(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the intentsClient object to clean up resources such as + *

Note: close() needs to be called on the IntentsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -79,28 +72,24 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * IntentsSettings intentsSettings =
  *     IntentsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * IntentsClient intentsClient =
- *     IntentsClient.create(intentsSettings);
- * 
- * 
+ * IntentsClient intentsClient = IntentsClient.create(intentsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * IntentsSettings intentsSettings =
- *     IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * IntentsClient intentsClient =
- *     IntentsClient.create(intentsSettings);
- * 
- * 
+ *
{@code
+ * IntentsSettings intentsSettings = IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * IntentsClient intentsClient = IntentsClient.create(intentsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class IntentsClient implements BackgroundResource { private final IntentsSettings settings; @@ -121,7 +110,7 @@ public static final IntentsClient create(IntentsSettings settings) throws IOExce /** * Constructs an instance of IntentsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use IntentsSettings}. + * advanced usage - prefer using create(IntentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final IntentsClient create(IntentsStub stub) { @@ -152,21 +141,10 @@ public IntentsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all intents for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -174,26 +152,15 @@ public IntentsStub getStub() { public final ListIntentsPagedResponse listIntents(AgentName parent) { ListIntentsRequest request = ListIntentsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listIntents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Intent element : intentsClient.listIntents(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all intents for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -203,24 +170,10 @@ public final ListIntentsPagedResponse listIntents(String parent) { return listIntents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Intent element : intentsClient.listIntents(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -228,98 +181,47 @@ public final ListIntentsPagedResponse listIntents(ListIntentsRequest request) { return listIntentsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListIntentsPagedResponse> future = intentsClient.listIntentsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Intent element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listIntentsPagedCallable() { return stub.listIntentsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListIntentsResponse response = intentsClient.listIntentsCallable().call(request);
-   *     for (Intent element : response.getIntentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listIntentsCallable() { return stub.listIntentsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   Intent response = intentsClient.getIntent(name);
-   * }
-   * 
- * * @param name Required. The name of the intent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Intent getIntent(IntentName name) { GetIntentRequest request = - GetIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetIntentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   Intent response = intentsClient.getIntent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the intent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -329,22 +231,10 @@ public final Intent getIntent(String name) { return getIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   GetIntentRequest request = GetIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Intent response = intentsClient.getIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -352,42 +242,20 @@ public final Intent getIntent(GetIntentRequest request) { return getIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   GetIntentRequest request = GetIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Intent> future = intentsClient.getIntentCallable().futureCall(request);
-   *   // Do something
-   *   Intent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getIntentCallable() { return stub.getIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   Intent response = intentsClient.createIntent(parent, intent);
-   * }
-   * 
- * * @param parent Required. The agent to create an intent for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param intent Required. The intent to create. @@ -396,26 +264,16 @@ public final UnaryCallable getIntentCallable() { public final Intent createIntent(AgentName parent, Intent intent) { CreateIntentRequest request = CreateIntentRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setIntent(intent) .build(); return createIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   Intent response = intentsClient.createIntent(parent.toString(), intent);
-   * }
-   * 
- * * @param parent Required. The agent to create an intent for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param intent Required. The intent to create. @@ -427,24 +285,10 @@ public final Intent createIntent(String parent, Intent intent) { return createIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   CreateIntentRequest request = CreateIntentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setIntent(intent)
-   *     .build();
-   *   Intent response = intentsClient.createIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -452,47 +296,23 @@ public final Intent createIntent(CreateIntentRequest request) { return createIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   CreateIntentRequest request = CreateIntentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setIntent(intent)
-   *     .build();
-   *   ApiFuture<Intent> future = intentsClient.createIntentCallable().futureCall(request);
-   *   // Do something
-   *   Intent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createIntentCallable() { return stub.createIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   Intent intent = Intent.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Intent response = intentsClient.updateIntent(intent, updateMask);
-   * }
-   * 
- * * @param intent Required. The intent to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Intent updateIntent(Intent intent, FieldMask updateMask) { @@ -501,22 +321,10 @@ public final Intent updateIntent(Intent intent, FieldMask updateMask) { return updateIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   Intent intent = Intent.newBuilder().build();
-   *   UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
-   *     .setIntent(intent)
-   *     .build();
-   *   Intent response = intentsClient.updateIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -524,64 +332,36 @@ public final Intent updateIntent(UpdateIntentRequest request) { return updateIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified intent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   Intent intent = Intent.newBuilder().build();
-   *   UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
-   *     .setIntent(intent)
-   *     .build();
-   *   ApiFuture<Intent> future = intentsClient.updateIntentCallable().futureCall(request);
-   *   // Do something
-   *   Intent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateIntentCallable() { return stub.updateIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   intentsClient.deleteIntent(name);
-   * }
-   * 
- * * @param name Required. The name of the intent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteIntent(IntentName name) { DeleteIntentRequest request = - DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteIntentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   intentsClient.deleteIntent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the intent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -591,22 +371,10 @@ public final void deleteIntent(String name) { deleteIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   intentsClient.deleteIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -614,23 +382,11 @@ public final void deleteIntent(DeleteIntentRequest request) { deleteIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = intentsClient.deleteIntentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteIntentCallable() { return stub.deleteIntentCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsSettings.java index 630b35bc6..48a85742d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.IntentsClient.ListIntentsPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link IntentsClient}. * @@ -51,22 +52,23 @@ * *

For example, to set the total timeout of getIntent to 30 seconds: * - *

- * 
- * IntentsSettings.Builder intentsSettingsBuilder =
- *     IntentsSettings.newBuilder();
+ * 
{@code
+ * IntentsSettings.Builder intentsSettingsBuilder = IntentsSettings.newBuilder();
  * intentsSettingsBuilder
  *     .getIntentSettings()
  *     .setRetrySettings(
- *         intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ *         intentsSettingsBuilder
+ *             .getIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * IntentsSettings intentsSettings = intentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class IntentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listIntents. */ public PagedCallSettings listIntentsSettings() { @@ -152,18 +154,15 @@ protected IntentsSettings(Builder settingsBuilder) throws IOException { /** Builder for IntentsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(IntentsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(IntentsStubSettings.newBuilder()); - } - protected Builder(IntentsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -172,11 +171,15 @@ protected Builder(IntentsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(IntentsStubSettings.newBuilder()); + } + public IntentsStubSettings.Builder getStubSettingsBuilder() { return ((IntentsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java index 0849d9edf..a81e49b7e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -32,26 +33,18 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (PagesClient pagesClient = PagesClient.create()) {
- *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- *   Page response = pagesClient.getPage(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the pagesClient object to clean up resources such as + *

Note: close() needs to be called on the PagesClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -79,28 +72,24 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * PagesSettings pagesSettings =
  *     PagesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * PagesClient pagesClient =
- *     PagesClient.create(pagesSettings);
- * 
- * 
+ * PagesClient pagesClient = PagesClient.create(pagesSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * PagesSettings pagesSettings =
- *     PagesSettings.newBuilder().setEndpoint(myEndpoint).build();
- * PagesClient pagesClient =
- *     PagesClient.create(pagesSettings);
- * 
- * 
+ *
{@code
+ * PagesSettings pagesSettings = PagesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PagesClient pagesClient = PagesClient.create(pagesSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class PagesClient implements BackgroundResource { private final PagesSettings settings; @@ -121,7 +110,7 @@ public static final PagesClient create(PagesSettings settings) throws IOExceptio /** * Constructs an instance of PagesClient, using the given stub for making calls. This is for - * advanced usage - prefer to use PagesSettings}. + * advanced usage - prefer using create(PagesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final PagesClient create(PagesStub stub) { @@ -152,46 +141,26 @@ public PagesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Page element : pagesClient.listPages(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all pages for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListPagesPagedResponse listPages(FlowName parent) { ListPagesRequest request = - ListPagesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListPagesRequest.newBuilder() + .setParent(Objects.isNull(parent) ? null : parent.toString()) + .build(); return listPages(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Page element : pagesClient.listPages(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all pages for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -201,24 +170,10 @@ public final ListPagesPagedResponse listPages(String parent) { return listPages(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListPagesRequest request = ListPagesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Page element : pagesClient.listPages(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -226,74 +181,30 @@ public final ListPagesPagedResponse listPages(ListPagesRequest request) { return listPagesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListPagesRequest request = ListPagesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListPagesPagedResponse> future = pagesClient.listPagesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Page element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listPagesPagedCallable() { return stub.listPagesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListPagesRequest request = ListPagesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListPagesResponse response = pagesClient.listPagesCallable().call(request);
-   *     for (Page element : response.getPagesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listPagesCallable() { return stub.listPagesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   Page response = pagesClient.getPage(name);
-   * }
-   * 
- * * @param name Required. The name of the page. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow * ID>/pages/<Page ID>`. @@ -301,23 +212,14 @@ public final UnaryCallable listPagesCallabl */ public final Page getPage(PageName name) { GetPageRequest request = - GetPageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetPageRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); return getPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   Page response = pagesClient.getPage(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the page. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow * ID>/pages/<Page ID>`. @@ -328,22 +230,10 @@ public final Page getPage(String name) { return getPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   GetPageRequest request = GetPageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Page response = pagesClient.getPage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -351,42 +241,20 @@ public final Page getPage(GetPageRequest request) { return getPageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   GetPageRequest request = GetPageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Page> future = pagesClient.getPageCallable().futureCall(request);
-   *   // Do something
-   *   Page response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getPageCallable() { return stub.getPageCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   Page response = pagesClient.createPage(parent, page);
-   * }
-   * 
- * * @param parent Required. The flow to create a page for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param page Required. The page to create. @@ -395,26 +263,16 @@ public final UnaryCallable getPageCallable() { public final Page createPage(FlowName parent, Page page) { CreatePageRequest request = CreatePageRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setPage(page) .build(); return createPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   Page response = pagesClient.createPage(parent.toString(), page);
-   * }
-   * 
- * * @param parent Required. The flow to create a page for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param page Required. The page to create. @@ -426,24 +284,10 @@ public final Page createPage(String parent, Page page) { return createPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   CreatePageRequest request = CreatePageRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setPage(page)
-   *     .build();
-   *   Page response = pagesClient.createPage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -451,47 +295,23 @@ public final Page createPage(CreatePageRequest request) { return createPageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   CreatePageRequest request = CreatePageRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setPage(page)
-   *     .build();
-   *   ApiFuture<Page> future = pagesClient.createPageCallable().futureCall(request);
-   *   // Do something
-   *   Page response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createPageCallable() { return stub.createPageCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   Page page = Page.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Page response = pagesClient.updatePage(page, updateMask);
-   * }
-   * 
- * * @param page Required. The page to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Page updatePage(Page page, FieldMask updateMask) { @@ -500,22 +320,10 @@ public final Page updatePage(Page page, FieldMask updateMask) { return updatePage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   Page page = Page.newBuilder().build();
-   *   UpdatePageRequest request = UpdatePageRequest.newBuilder()
-   *     .setPage(page)
-   *     .build();
-   *   Page response = pagesClient.updatePage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -523,41 +331,20 @@ public final Page updatePage(UpdatePageRequest request) { return updatePageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified page. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   Page page = Page.newBuilder().build();
-   *   UpdatePageRequest request = UpdatePageRequest.newBuilder()
-   *     .setPage(page)
-   *     .build();
-   *   ApiFuture<Page> future = pagesClient.updatePageCallable().futureCall(request);
-   *   // Do something
-   *   Page response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updatePageCallable() { return stub.updatePageCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   pagesClient.deletePage(name);
-   * }
-   * 
- * * @param name Required. The name of the page to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow * ID>/pages/<Page ID>`. @@ -565,23 +352,16 @@ public final UnaryCallable updatePageCallable() { */ public final void deletePage(PageName name) { DeletePageRequest request = - DeletePageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeletePageRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deletePage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   pagesClient.deletePage(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the page to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow * ID>/pages/<Page ID>`. @@ -592,22 +372,10 @@ public final void deletePage(String name) { deletePage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   DeletePageRequest request = DeletePageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   pagesClient.deletePage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -615,23 +383,11 @@ public final void deletePage(DeletePageRequest request) { deletePageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   DeletePageRequest request = DeletePageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = pagesClient.deletePageCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deletePageCallable() { return stub.deletePageCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesSettings.java index 78a34fb13..077dc1610 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.PagesClient.ListPagesPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link PagesClient}. * @@ -51,22 +52,23 @@ * *

For example, to set the total timeout of getPage to 30 seconds: * - *

- * 
- * PagesSettings.Builder pagesSettingsBuilder =
- *     PagesSettings.newBuilder();
+ * 
{@code
+ * PagesSettings.Builder pagesSettingsBuilder = PagesSettings.newBuilder();
  * pagesSettingsBuilder
  *     .getPageSettings()
  *     .setRetrySettings(
- *         pagesSettingsBuilder.getPageSettings().getRetrySettings().toBuilder()
+ *         pagesSettingsBuilder
+ *             .getPageSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PagesSettings pagesSettings = pagesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class PagesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listPages. */ public PagedCallSettings listPagesSettings() { @@ -152,18 +154,15 @@ protected PagesSettings(Builder settingsBuilder) throws IOException { /** Builder for PagesSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(PagesStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(PagesStubSettings.newBuilder()); - } - protected Builder(PagesSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -172,11 +171,15 @@ protected Builder(PagesStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(PagesStubSettings.newBuilder()); + } + public PagesStubSettings.Builder getStubSettingsBuilder() { return ((PagesStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java index a45824df0..1363dd168 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -32,27 +33,18 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing security settings for Dialogflow. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- *   SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the securitySettingsServiceClient object to clean up + *

Note: close() needs to be called on the SecuritySettingsServiceClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). * @@ -81,28 +73,27 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * SecuritySettingsServiceSettings securitySettingsServiceSettings =
  *     SecuritySettingsServiceSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
  * SecuritySettingsServiceClient securitySettingsServiceClient =
  *     SecuritySettingsServiceClient.create(securitySettingsServiceSettings);
- * 
- * 
+ * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * SecuritySettingsServiceSettings securitySettingsServiceSettings =
  *     SecuritySettingsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
  * SecuritySettingsServiceClient securitySettingsServiceClient =
  *     SecuritySettingsServiceClient.create(securitySettingsServiceSettings);
- * 
- * 
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class SecuritySettingsServiceClient implements BackgroundResource { private final SecuritySettingsServiceSettings settings; @@ -124,7 +115,7 @@ public static final SecuritySettingsServiceClient create(SecuritySettingsService /** * Constructs an instance of SecuritySettingsServiceClient, using the given stub for making calls. - * This is for advanced usage - prefer to use SecuritySettingsServiceSettings}. + * This is for advanced usage - prefer using create(SecuritySettingsServiceSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SecuritySettingsServiceClient create(SecuritySettingsServiceStub stub) { @@ -157,54 +148,34 @@ public SecuritySettingsServiceStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create security settings in the specified location. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
-   *   SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
-   * }
-   * 
- * * @param parent Required. The location to create an * [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. Format: * `projects/<Project ID>/locations/<Location ID>`. - * @param securitySettings Required. The security settings to create. + * @param security_settings Required. The security settings to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SecuritySettings createSecuritySettings( LocationName parent, SecuritySettings securitySettings) { CreateSecuritySettingsRequest request = CreateSecuritySettingsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setSecuritySettings(securitySettings) .build(); return createSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create security settings in the specified location. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
-   *   SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent.toString(), securitySettings);
-   * }
-   * 
- * * @param parent Required. The location to create an * [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. Format: * `projects/<Project ID>/locations/<Location ID>`. - * @param securitySettings Required. The security settings to create. + * @param security_settings Required. The security settings to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SecuritySettings createSecuritySettings( @@ -217,24 +188,10 @@ public final SecuritySettings createSecuritySettings( return createSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create security settings in the specified location. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
-   *   CreateSecuritySettingsRequest request = CreateSecuritySettingsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setSecuritySettings(securitySettings)
-   *     .build();
-   *   SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -242,45 +199,22 @@ public final SecuritySettings createSecuritySettings(CreateSecuritySettingsReque return createSecuritySettingsCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Create security settings in the specified location. * *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
-   *   CreateSecuritySettingsRequest request = CreateSecuritySettingsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setSecuritySettings(securitySettings)
-   *     .build();
-   *   ApiFuture<SecuritySettings> future = securitySettingsServiceClient.createSecuritySettingsCallable().futureCall(request);
-   *   // Do something
-   *   SecuritySettings response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createSecuritySettingsCallable() { return stub.createSecuritySettingsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The * returned settings may be stale by up to 1 minute. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   SecuritySettings response = securitySettingsServiceClient.getSecuritySettings(name);
-   * }
-   * 
- * * @param name Required. Resource name of the settings. Format: `projects/<Project * ID>/locations/<Location ID>/securitySettings/<security settings ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -288,25 +222,16 @@ public final SecuritySettings createSecuritySettings(CreateSecuritySettingsReque public final SecuritySettings getSecuritySettings(SecuritySettingsName name) { GetSecuritySettingsRequest request = GetSecuritySettingsRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); return getSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The * returned settings may be stale by up to 1 minute. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   SecuritySettings response = securitySettingsServiceClient.getSecuritySettings(name.toString());
-   * }
-   * 
- * * @param name Required. Resource name of the settings. Format: `projects/<Project * ID>/locations/<Location ID>/securitySettings/<security settings ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -317,23 +242,11 @@ public final SecuritySettings getSecuritySettings(String name) { return getSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The * returned settings may be stale by up to 1 minute. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   GetSecuritySettingsRequest request = GetSecuritySettingsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   SecuritySettings response = securitySettingsServiceClient.getSecuritySettings(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -341,47 +254,25 @@ public final SecuritySettings getSecuritySettings(GetSecuritySettingsRequest req return getSecuritySettingsCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. The * returned settings may be stale by up to 1 minute. * *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   GetSecuritySettingsRequest request = GetSecuritySettingsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<SecuritySettings> future = securitySettingsServiceClient.getSecuritySettingsCallable().futureCall(request);
-   *   // Do something
-   *   SecuritySettings response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getSecuritySettingsCallable() { return stub.getSecuritySettingsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   SecuritySettings response = securitySettingsServiceClient.updateSecuritySettings(securitySettings, updateMask);
-   * }
-   * 
- * - * @param securitySettings Required. [SecuritySettings] object that contains values for each of + * @param security_settings Required. [SecuritySettings] object that contains values for each of * the fields to update. - * @param updateMask Required. The mask to control which fields get updated. If the mask is not + * @param update_mask Required. The mask to control which fields get updated. If the mask is not * present, all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -395,24 +286,10 @@ public final SecuritySettings updateSecuritySettings( return updateSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateSecuritySettingsRequest request = UpdateSecuritySettingsRequest.newBuilder()
-   *     .setSecuritySettings(securitySettings)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   SecuritySettings response = securitySettingsServiceClient.updateSecuritySettings(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -420,46 +297,21 @@ public final SecuritySettings updateSecuritySettings(UpdateSecuritySettingsReque return updateSecuritySettingsCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateSecuritySettingsRequest request = UpdateSecuritySettingsRequest.newBuilder()
-   *     .setSecuritySettings(securitySettings)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<SecuritySettings> future = securitySettingsServiceClient.updateSecuritySettingsCallable().futureCall(request);
-   *   // Do something
-   *   SecuritySettings response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateSecuritySettingsCallable() { return stub.updateSecuritySettingsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all security settings in the specified location. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (SecuritySettings element : securitySettingsServiceClient.listSecuritySettings(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The location to list all security settings for. Format: * `projects/<Project ID>/locations/<Location ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -467,26 +319,15 @@ public final SecuritySettings updateSecuritySettings(UpdateSecuritySettingsReque public final ListSecuritySettingsPagedResponse listSecuritySettings(LocationName parent) { ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all security settings in the specified location. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (SecuritySettings element : securitySettingsServiceClient.listSecuritySettings(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The location to list all security settings for. Format: * `projects/<Project ID>/locations/<Location ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -497,24 +338,10 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings(String paren return listSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all security settings in the specified location. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (SecuritySettings element : securitySettingsServiceClient.listSecuritySettings(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -523,76 +350,32 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings( return listSecuritySettingsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all security settings in the specified location. * *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListSecuritySettingsPagedResponse> future = securitySettingsServiceClient.listSecuritySettingsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (SecuritySettings element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listSecuritySettingsPagedCallable() { return stub.listSecuritySettingsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all security settings in the specified location. * *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListSecuritySettingsResponse response = securitySettingsServiceClient.listSecuritySettingsCallable().call(request);
-   *     for (SecuritySettings element : response.getSecuritySettingsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listSecuritySettingsCallable() { return stub.listSecuritySettingsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   securitySettingsServiceClient.deleteSecuritySettings(name);
-   * }
-   * 
- * * @param name Required. The name of the * [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] to delete. Format: * `projects/<Project ID>/locations/<Location ID>/securitySettings/<Security @@ -602,24 +385,15 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings( public final void deleteSecuritySettings(SecuritySettingsName name) { DeleteSecuritySettingsRequest request = DeleteSecuritySettingsRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); deleteSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   securitySettingsServiceClient.deleteSecuritySettings(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the * [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] to delete. Format: * `projects/<Project ID>/locations/<Location ID>/securitySettings/<Security @@ -632,22 +406,10 @@ public final void deleteSecuritySettings(String name) { deleteSecuritySettings(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * - *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   DeleteSecuritySettingsRequest request = DeleteSecuritySettingsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   securitySettingsServiceClient.deleteSecuritySettings(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -655,23 +417,11 @@ public final void deleteSecuritySettings(DeleteSecuritySettingsRequest request) deleteSecuritySettingsCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * *

Sample code: - * - *


-   * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
-   *   SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]");
-   *   DeleteSecuritySettingsRequest request = DeleteSecuritySettingsRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = securitySettingsServiceClient.deleteSecuritySettingsCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteSecuritySettingsCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceSettings.java index 5750825f8..41140c007 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.SecuritySettingsServiceClient.ListSecuritySettingsPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SecuritySettingsServiceClient}. * @@ -51,23 +52,26 @@ * *

For example, to set the total timeout of createSecuritySettings to 30 seconds: * - *

- * 
+ * 
{@code
  * SecuritySettingsServiceSettings.Builder securitySettingsServiceSettingsBuilder =
  *     SecuritySettingsServiceSettings.newBuilder();
  * securitySettingsServiceSettingsBuilder
  *     .createSecuritySettingsSettings()
  *     .setRetrySettings(
- *         securitySettingsServiceSettingsBuilder.createSecuritySettingsSettings().getRetrySettings().toBuilder()
+ *         securitySettingsServiceSettingsBuilder
+ *             .createSecuritySettingsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * SecuritySettingsServiceSettings securitySettingsServiceSettings = securitySettingsServiceSettingsBuilder.build();
- * 
- * 
+ * SecuritySettingsServiceSettings securitySettingsServiceSettings = + * securitySettingsServiceSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class SecuritySettingsServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createSecuritySettings. */ public UnaryCallSettings createSecuritySettingsSettings() { @@ -164,18 +168,15 @@ protected SecuritySettingsServiceSettings(Builder settingsBuilder) throws IOExce /** Builder for SecuritySettingsServiceSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(SecuritySettingsServiceStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(SecuritySettingsServiceStubSettings.newBuilder()); - } - protected Builder(SecuritySettingsServiceSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -184,11 +185,15 @@ protected Builder(SecuritySettingsServiceStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(SecuritySettingsServiceStubSettings.newBuilder()); + } + public SecuritySettingsServiceStubSettings.Builder getStubSettingsBuilder() { return ((SecuritySettingsServiceStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java index a3a362ef4..256578c63 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -32,10 +33,11 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. @@ -43,16 +45,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the sessionEntityTypesClient object to clean up resources + *

Note: close() needs to be called on the SessionEntityTypesClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * @@ -81,28 +74,27 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * SessionEntityTypesSettings sessionEntityTypesSettings =
  *     SessionEntityTypesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
  * SessionEntityTypesClient sessionEntityTypesClient =
  *     SessionEntityTypesClient.create(sessionEntityTypesSettings);
- * 
- * 
+ * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * SessionEntityTypesSettings sessionEntityTypesSettings =
  *     SessionEntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
  * SessionEntityTypesClient sessionEntityTypesClient =
  *     SessionEntityTypesClient.create(sessionEntityTypesSettings);
- * 
- * 
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class SessionEntityTypesClient implements BackgroundResource { private final SessionEntityTypesSettings settings; @@ -124,7 +116,7 @@ public static final SessionEntityTypesClient create(SessionEntityTypesSettings s /** * Constructs an instance of SessionEntityTypesClient, using the given stub for making calls. This - * is for advanced usage - prefer to use SessionEntityTypesSettings}. + * is for advanced usage - prefer using create(SessionEntityTypesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SessionEntityTypesClient create(SessionEntityTypesStub stub) { @@ -156,21 +148,10 @@ public SessionEntityTypesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The session to list all session entity types from. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location @@ -181,26 +162,15 @@ public SessionEntityTypesStub getStub() { public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionName parent) { ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listSessionEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The session to list all session entity types from. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location @@ -214,24 +184,10 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(String p return listSessionEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -240,76 +196,32 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( return listSessionEntityTypesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListSessionEntityTypesPagedResponse> future = sessionEntityTypesClient.listSessionEntityTypesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (SessionEntityType element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listSessionEntityTypesPagedCallable() { return stub.listSessionEntityTypesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListSessionEntityTypesResponse response = sessionEntityTypesClient.listSessionEntityTypesCallable().call(request);
-   *     for (SessionEntityType element : response.getSessionEntityTypesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listSessionEntityTypesCallable() { return stub.listSessionEntityTypesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the session entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>` or `projects/<Project @@ -321,24 +233,15 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( public final SessionEntityType getSessionEntityType(SessionEntityTypeName name) { GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); return getSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the session entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>` or `projects/<Project @@ -353,22 +256,10 @@ public final SessionEntityType getSessionEntityType(String name) { return getSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -376,85 +267,53 @@ public final SessionEntityType getSessionEntityType(GetSessionEntityTypeRequest return getSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.getSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   SessionEntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getSessionEntityTypeCallable() { return stub.getSessionEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent, sessionEntityType);
-   * }
-   * 
- * * @param parent Required. The session to create a session entity type for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param sessionEntityType Required. The session entity type to create. + * @param session_entity_type Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( SessionName parent, SessionEntityType sessionEntityType) { CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setSessionEntityType(sessionEntityType) .build(); return createSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent.toString(), sessionEntityType);
-   * }
-   * 
- * * @param parent Required. The session to create a session entity type for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param sessionEntityType Required. The session entity type to create. + * @param session_entity_type Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( @@ -467,26 +326,12 @@ public final SessionEntityType createSessionEntityType( return createSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -494,55 +339,31 @@ public final SessionEntityType createSessionEntityType(CreateSessionEntityTypeRe return createSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.createSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   SessionEntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createSessionEntityTypeCallable() { return stub.createSessionEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(sessionEntityType, updateMask);
-   * }
-   * 
- * - * @param sessionEntityType Required. The session entity type to update. Format: + * @param session_entity_type Required. The session entity type to update. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>`. If `Environment ID` is not specified, we assume * default 'draft' environment. - * @param updateMask The mask to control which fields get updated. + * @param update_mask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType updateSessionEntityType( @@ -555,22 +376,10 @@ public final SessionEntityType updateSessionEntityType( return updateSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -578,42 +387,21 @@ public final SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRe return updateSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.updateSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   SessionEntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateSessionEntityTypeCallable() { return stub.updateSessionEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   sessionEntityTypesClient.deleteSessionEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the session entity type to delete. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or @@ -626,24 +414,15 @@ public final SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRe public final void deleteSessionEntityType(SessionEntityTypeName name) { DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); deleteSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   sessionEntityTypesClient.deleteSessionEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the session entity type to delete. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or @@ -659,22 +438,10 @@ public final void deleteSessionEntityType(String name) { deleteSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   sessionEntityTypesClient.deleteSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -682,23 +449,11 @@ public final void deleteSessionEntityType(DeleteSessionEntityTypeRequest request deleteSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = sessionEntityTypesClient.deleteSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteSessionEntityTypeCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesSettings.java index c786a941a..a068a3d5f 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionEntityTypesClient}. * @@ -51,22 +52,25 @@ * *

For example, to set the total timeout of getSessionEntityType to 30 seconds: * - *

- * 
+ * 
{@code
  * SessionEntityTypesSettings.Builder sessionEntityTypesSettingsBuilder =
  *     SessionEntityTypesSettings.newBuilder();
  * sessionEntityTypesSettingsBuilder
  *     .getSessionEntityTypeSettings()
  *     .setRetrySettings(
- *         sessionEntityTypesSettingsBuilder.getSessionEntityTypeSettings().getRetrySettings().toBuilder()
+ *         sessionEntityTypesSettingsBuilder
+ *             .getSessionEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * SessionEntityTypesSettings sessionEntityTypesSettings = sessionEntityTypesSettingsBuilder.build();
- * 
- * 
+ * SessionEntityTypesSettings sessionEntityTypesSettings = + * sessionEntityTypesSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class SessionEntityTypesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listSessionEntityTypes. */ public PagedCallSettings< ListSessionEntityTypesRequest, @@ -160,18 +164,15 @@ protected SessionEntityTypesSettings(Builder settingsBuilder) throws IOException /** Builder for SessionEntityTypesSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(SessionEntityTypesStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(SessionEntityTypesStubSettings.newBuilder()); - } - protected Builder(SessionEntityTypesSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -180,11 +181,15 @@ protected Builder(SessionEntityTypesStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(SessionEntityTypesStubSettings.newBuilder()); + } + public SessionEntityTypesStubSettings.Builder getStubSettingsBuilder() { return ((SessionEntityTypesStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsClient.java index eca06e291..89a6f26cd 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -25,7 +26,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: A session represents an interaction with a user. You retrieve user input and * pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to @@ -34,21 +35,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- *   QueryInput queryInput = QueryInput.newBuilder().build();
- *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
- *     .setSession(session.toString())
- *     .setQueryInput(queryInput)
- *     .build();
- *   DetectIntentResponse response = sessionsClient.detectIntent(request);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the sessionsClient object to clean up resources such as + *

Note: close() needs to be called on the SessionsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -76,28 +63,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * SessionsSettings sessionsSettings =
  *     SessionsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * SessionsClient sessionsClient =
- *     SessionsClient.create(sessionsSettings);
- * 
- * 
+ * SessionsClient sessionsClient = SessionsClient.create(sessionsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * SessionsSettings sessionsSettings =
  *     SessionsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SessionsClient sessionsClient =
- *     SessionsClient.create(sessionsSettings);
- * 
- * 
+ * SessionsClient sessionsClient = SessionsClient.create(sessionsSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class SessionsClient implements BackgroundResource { private final SessionsSettings settings; @@ -118,7 +102,7 @@ public static final SessionsClient create(SessionsSettings settings) throws IOEx /** * Constructs an instance of SessionsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use SessionsSettings}. + * advanced usage - prefer using create(SessionsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SessionsClient create(SessionsStub stub) { @@ -149,26 +133,12 @@ public SessionsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Processes a natural language query and returns structured, actionable data as a result. This * method is not idempotent, because it may cause session entity types to be updated, which in * turn might affect results of future queries. * - *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   DetectIntentResponse response = sessionsClient.detectIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -176,79 +146,35 @@ public final DetectIntentResponse detectIntent(DetectIntentRequest request) { return detectIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Processes a natural language query and returns structured, actionable data as a result. This * method is not idempotent, because it may cause session entity types to be updated, which in * turn might affect results of future queries. * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   ApiFuture<DetectIntentResponse> future = sessionsClient.detectIntentCallable().futureCall(request);
-   *   // Do something
-   *   DetectIntentResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable detectIntentCallable() { return stub.detectIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Processes a natural language query in audio format in a streaming fashion and returns * structured, actionable data as a result. This method is only available via the gRPC API (not * REST). * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   BidiStream<StreamingDetectIntentRequest, StreamingDetectIntentResponse> bidiStream =
-   *       sessionsClient.streamingDetectIntentCallable().call();
-   *
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   StreamingDetectIntentRequest request = StreamingDetectIntentRequest.newBuilder()
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   bidiStream.send(request);
-   *   for (StreamingDetectIntentResponse response : bidiStream) {
-   *     // Do something when receive a response
-   *   }
-   * }
-   * 
*/ public final BidiStreamingCallable streamingDetectIntentCallable() { return stub.streamingDetectIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns preliminary intent match results, doesn't change the session status. * - *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   MatchIntentRequest request = MatchIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   MatchIntentResponse response = sessionsClient.matchIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -256,31 +182,17 @@ public final MatchIntentResponse matchIntent(MatchIntentRequest request) { return matchIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns preliminary intent match results, doesn't change the session status. * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   MatchIntentRequest request = MatchIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   ApiFuture<MatchIntentResponse> future = sessionsClient.matchIntentCallable().futureCall(request);
-   *   // Do something
-   *   MatchIntentResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable matchIntentCallable() { return stub.matchIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Fulfills a matched intent returned by * [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be called after @@ -288,15 +200,6 @@ public final UnaryCallable matchIntentC * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the * behavior is undefined. * - *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
-   *   FulfillIntentResponse response = sessionsClient.fulfillIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -304,7 +207,7 @@ public final FulfillIntentResponse fulfillIntent(FulfillIntentRequest request) { return fulfillIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Fulfills a matched intent returned by * [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. Must be called after @@ -313,15 +216,6 @@ public final FulfillIntentResponse fulfillIntent(FulfillIntentRequest request) { * behavior is undefined. * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
-   *   ApiFuture<FulfillIntentResponse> future = sessionsClient.fulfillIntentCallable().futureCall(request);
-   *   // Do something
-   *   FulfillIntentResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable fulfillIntentCallable() { return stub.fulfillIntentCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsSettings.java index 1f5dea115..a5d835c6c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -31,7 +32,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionsClient}. * @@ -48,22 +49,23 @@ * *

For example, to set the total timeout of detectIntent to 30 seconds: * - *

- * 
- * SessionsSettings.Builder sessionsSettingsBuilder =
- *     SessionsSettings.newBuilder();
+ * 
{@code
+ * SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder();
  * sessionsSettingsBuilder
  *     .detectIntentSettings()
  *     .setRetrySettings(
- *         sessionsSettingsBuilder.detectIntentSettings().getRetrySettings().toBuilder()
+ *         sessionsSettingsBuilder
+ *             .detectIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * SessionsSettings sessionsSettings = sessionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class SessionsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to detectIntent. */ public UnaryCallSettings detectIntentSettings() { return ((SessionsStubSettings) getStubSettings()).detectIntentSettings(); @@ -144,18 +146,15 @@ protected SessionsSettings(Builder settingsBuilder) throws IOException { /** Builder for SessionsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(SessionsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(SessionsStubSettings.newBuilder()); - } - protected Builder(SessionsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -164,11 +163,15 @@ protected Builder(SessionsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(SessionsStubSettings.newBuilder()); + } + public SessionsStubSettings.Builder getStubSettingsBuilder() { return ((SessionsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java index bedb1d20d..aca1b06c5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -32,10 +33,11 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. @@ -43,16 +45,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the transitionRouteGroupsClient object to clean up + *

Note: close() needs to be called on the TransitionRouteGroupsClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). * @@ -81,28 +74,27 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsSettings transitionRouteGroupsSettings =
  *     TransitionRouteGroupsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
  * TransitionRouteGroupsClient transitionRouteGroupsClient =
  *     TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
- * 
- * 
+ * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsSettings transitionRouteGroupsSettings =
  *     TransitionRouteGroupsSettings.newBuilder().setEndpoint(myEndpoint).build();
  * TransitionRouteGroupsClient transitionRouteGroupsClient =
  *     TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
- * 
- * 
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class TransitionRouteGroupsClient implements BackgroundResource { private final TransitionRouteGroupsSettings settings; @@ -124,7 +116,7 @@ public static final TransitionRouteGroupsClient create(TransitionRouteGroupsSett /** * Constructs an instance of TransitionRouteGroupsClient, using the given stub for making calls. - * This is for advanced usage - prefer to use TransitionRouteGroupsSettings}. + * This is for advanced usage - prefer using create(TransitionRouteGroupsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final TransitionRouteGroupsClient create(TransitionRouteGroupsStub stub) { @@ -156,21 +148,10 @@ public TransitionRouteGroupsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all transition route groups for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. @@ -179,26 +160,15 @@ public TransitionRouteGroupsStub getStub() { public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(FlowName parent) { ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listTransitionRouteGroups(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all transition route groups for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. @@ -210,24 +180,10 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(St return listTransitionRouteGroups(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -236,25 +192,11 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( return listTransitionRouteGroupsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListTransitionRouteGroupsPagedResponse> future = transitionRouteGroupsClient.listTransitionRouteGroupsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (TransitionRouteGroup element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable< ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsPagedResponse> @@ -262,52 +204,22 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( return stub.listTransitionRouteGroupsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListTransitionRouteGroupsResponse response = transitionRouteGroupsClient.listTransitionRouteGroupsCallable().call(request);
-   *     for (TransitionRouteGroup element : response.getTransitionRouteGroupsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listTransitionRouteGroupsCallable() { return stub.listTransitionRouteGroupsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -317,25 +229,16 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( public final TransitionRouteGroup getTransitionRouteGroup(TransitionRouteGroupName name) { GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); return getTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -348,23 +251,11 @@ public final TransitionRouteGroup getTransitionRouteGroup(String name) { return getTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -373,82 +264,50 @@ public final TransitionRouteGroup getTransitionRouteGroup( return getTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.getTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   TransitionRouteGroup response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getTransitionRouteGroupCallable() { return stub.getTransitionRouteGroupCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the * specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent, transitionRouteGroup);
-   * }
-   * 
- * * @param parent Required. The flow to create an * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transitionRouteGroup Required. The transition route group to create. + * @param transition_route_group Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( FlowName parent, TransitionRouteGroup transitionRouteGroup) { CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setTransitionRouteGroup(transitionRouteGroup) .build(); return createTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the * specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent.toString(), transitionRouteGroup);
-   * }
-   * 
- * * @param parent Required. The flow to create an * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transitionRouteGroup Required. The transition route group to create. + * @param transition_route_group Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( @@ -461,25 +320,11 @@ public final TransitionRouteGroup createTransitionRouteGroup( return createTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the * specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -488,49 +333,25 @@ public final TransitionRouteGroup createTransitionRouteGroup( return createTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the * specified flow. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.createTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   TransitionRouteGroup response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createTransitionRouteGroupCallable() { return stub.createTransitionRouteGroupCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(transitionRouteGroup, updateMask);
-   * }
-   * 
- * - * @param transitionRouteGroup Required. The transition route group to update. - * @param updateMask The mask to control which fields get updated. + * @param transition_route_group Required. The transition route group to update. + * @param update_mask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup updateTransitionRouteGroup( @@ -543,23 +364,11 @@ public final TransitionRouteGroup updateTransitionRouteGroup( return updateTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -568,44 +377,23 @@ public final TransitionRouteGroup updateTransitionRouteGroup( return updateTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.updateTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   TransitionRouteGroup response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateTransitionRouteGroupCallable() { return stub.updateTransitionRouteGroupCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(name);
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -615,25 +403,16 @@ public final TransitionRouteGroup updateTransitionRouteGroup( public final void deleteTransitionRouteGroup(TransitionRouteGroupName name) { DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); deleteTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] to delete. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -646,23 +425,11 @@ public final void deleteTransitionRouteGroup(String name) { deleteTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -670,24 +437,12 @@ public final void deleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest r deleteTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = transitionRouteGroupsClient.deleteTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteTransitionRouteGroupCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsSettings.java index 98e2947d3..e69f5702f 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link TransitionRouteGroupsClient}. * @@ -51,22 +52,25 @@ * *

For example, to set the total timeout of getTransitionRouteGroup to 30 seconds: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsSettings.Builder transitionRouteGroupsSettingsBuilder =
  *     TransitionRouteGroupsSettings.newBuilder();
  * transitionRouteGroupsSettingsBuilder
  *     .getTransitionRouteGroupSettings()
  *     .setRetrySettings(
- *         transitionRouteGroupsSettingsBuilder.getTransitionRouteGroupSettings().getRetrySettings().toBuilder()
+ *         transitionRouteGroupsSettingsBuilder
+ *             .getTransitionRouteGroupSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * TransitionRouteGroupsSettings transitionRouteGroupsSettings = transitionRouteGroupsSettingsBuilder.build();
- * 
- * 
+ * TransitionRouteGroupsSettings transitionRouteGroupsSettings = + * transitionRouteGroupsSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class TransitionRouteGroupsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listTransitionRouteGroups. */ public PagedCallSettings< ListTransitionRouteGroupsRequest, @@ -166,18 +170,15 @@ protected TransitionRouteGroupsSettings(Builder settingsBuilder) throws IOExcept /** Builder for TransitionRouteGroupsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(TransitionRouteGroupsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(TransitionRouteGroupsStubSettings.newBuilder()); - } - protected Builder(TransitionRouteGroupsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -186,11 +187,15 @@ protected Builder(TransitionRouteGroupsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(TransitionRouteGroupsStubSettings.newBuilder()); + } + public TransitionRouteGroupsStubSettings.Builder getStubSettingsBuilder() { return ((TransitionRouteGroupsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java index 4db4c6ee9..0f19f98e6 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -37,26 +38,18 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- *   Version response = versionsClient.getVersion(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the versionsClient object to clean up resources such as + *

Note: close() needs to be called on the VersionsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -84,28 +77,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * VersionsSettings versionsSettings =
  *     VersionsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * VersionsClient versionsClient =
- *     VersionsClient.create(versionsSettings);
- * 
- * 
+ * VersionsClient versionsClient = VersionsClient.create(versionsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * VersionsSettings versionsSettings =
  *     VersionsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * VersionsClient versionsClient =
- *     VersionsClient.create(versionsSettings);
- * 
- * 
+ * VersionsClient versionsClient = VersionsClient.create(versionsSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class VersionsClient implements BackgroundResource { private final VersionsSettings settings; @@ -127,7 +117,7 @@ public static final VersionsClient create(VersionsSettings settings) throws IOEx /** * Constructs an instance of VersionsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use VersionsSettings}. + * advanced usage - prefer using create(VersionsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final VersionsClient create(VersionsStub stub) { @@ -164,27 +154,14 @@ public VersionsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Version element : versionsClient.listVersions(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions * for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. @@ -193,26 +170,15 @@ public final OperationsClient getOperationsClient() { public final ListVersionsPagedResponse listVersions(FlowName parent) { ListVersionsRequest request = ListVersionsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listVersions(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Version element : versionsClient.listVersions(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to list all versions * for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. @@ -223,24 +189,10 @@ public final ListVersionsPagedResponse listVersions(String parent) { return listVersions(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Version element : versionsClient.listVersions(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -248,75 +200,31 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request) return listVersionsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListVersionsPagedResponse> future = versionsClient.listVersionsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Version element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listVersionsPagedCallable() { return stub.listVersionsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListVersionsResponse response = versionsClient.listVersionsCallable().call(request);
-   *     for (Version element : response.getVersionsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listVersionsCallable() { return stub.listVersionsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   Version response = versionsClient.getVersion(name);
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -324,23 +232,16 @@ public final UnaryCallable listVersio */ public final Version getVersion(VersionName name) { GetVersionRequest request = - GetVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetVersionRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   Version response = versionsClient.getVersion(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -351,22 +252,10 @@ public final Version getVersion(String name) { return getVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   GetVersionRequest request = GetVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Version response = versionsClient.getVersion(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -374,84 +263,48 @@ public final Version getVersion(GetVersionRequest request) { return getVersionCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   GetVersionRequest request = GetVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Version> future = versionsClient.getVersionCallable().futureCall(request);
-   *   // Do something
-   *   Version response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getVersionCallable() { return stub.getVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   Version response = versionsClient.createVersionAsync(parent, version).get();
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an * [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param version Required. The version to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createVersionAsync( FlowName parent, Version version) { CreateVersionRequest request = CreateVersionRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setVersion(version) .build(); return createVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   Version response = versionsClient.createVersionAsync(parent.toString(), version).get();
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow] to create an * [Version][google.cloud.dialogflow.cx.v3.Version] for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param version Required. The version to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createVersionAsync( String parent, Version version) { CreateVersionRequest request = @@ -459,103 +312,48 @@ public final OperationFuture createVers return createVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setVersion(version)
-   *     .build();
-   *   Version response = versionsClient.createVersionAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createVersionAsync( CreateVersionRequest request) { return createVersionOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setVersion(version)
-   *     .build();
-   *   OperationFuture<Version, CreateVersionOperationMetadata> future = versionsClient.createVersionOperationCallable().futureCall(request);
-   *   // Do something
-   *   Version response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable createVersionOperationCallable() { return stub.createVersionOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setVersion(version)
-   *     .build();
-   *   ApiFuture<Operation> future = versionsClient.createVersionCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createVersionCallable() { return stub.createVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   Version version = Version.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Version response = versionsClient.updateVersion(version, updateMask);
-   * }
-   * 
- * * @param version Required. The version to update. - * @param updateMask Required. The mask to control which fields get updated. Currently only + * @param update_mask Required. The mask to control which fields get updated. Currently only * `description` and `display_name` can be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -565,24 +363,10 @@ public final Version updateVersion(Version version, FieldMask updateMask) { return updateVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   Version version = Version.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
-   *     .setVersion(version)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Version response = versionsClient.updateVersion(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -590,43 +374,20 @@ public final Version updateVersion(UpdateVersionRequest request) { return updateVersionCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   Version version = Version.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
-   *     .setVersion(version)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Version> future = versionsClient.updateVersionCallable().futureCall(request);
-   *   // Do something
-   *   Version response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateVersionCallable() { return stub.updateVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.deleteVersion(name);
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to * delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -634,23 +395,16 @@ public final UnaryCallable updateVersionCallable( */ public final void deleteVersion(VersionName name) { DeleteVersionRequest request = - DeleteVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteVersionRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.deleteVersion(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3.Version] to * delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -661,22 +415,10 @@ public final void deleteVersion(String name) { deleteVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   versionsClient.deleteVersion(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -684,144 +426,73 @@ public final void deleteVersion(DeleteVersionRequest request) { deleteVersionCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = versionsClient.deleteVersionCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteVersionCallable() { return stub.deleteVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.loadVersionAsync(name).get();
-   * }
-   * 
- * * @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to * draft version. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture loadVersionAsync(VersionName name) { LoadVersionRequest request = - LoadVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + LoadVersionRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return loadVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.loadVersionAsync(name.toString()).get();
-   * }
-   * 
- * * @param name Required. The [Version][google.cloud.dialogflow.cx.v3.Version] to be loaded to * draft version. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture loadVersionAsync(String name) { LoadVersionRequest request = LoadVersionRequest.newBuilder().setName(name).build(); return loadVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   versionsClient.loadVersionAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture loadVersionAsync(LoadVersionRequest request) { return loadVersionOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, Struct> future = versionsClient.loadVersionOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable loadVersionOperationCallable() { return stub.loadVersionOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = versionsClient.loadVersionCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable loadVersionCallable() { return stub.loadVersionCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java index 38cf3ae3a..97f949903 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.VersionsClient.ListVersionsPagedResponse; @@ -37,7 +38,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link VersionsClient}. * @@ -54,22 +55,23 @@ * *

For example, to set the total timeout of getVersion to 30 seconds: * - *

- * 
- * VersionsSettings.Builder versionsSettingsBuilder =
- *     VersionsSettings.newBuilder();
+ * 
{@code
+ * VersionsSettings.Builder versionsSettingsBuilder = VersionsSettings.newBuilder();
  * versionsSettingsBuilder
  *     .getVersionSettings()
  *     .setRetrySettings(
- *         versionsSettingsBuilder.getVersionSettings().getRetrySettings().toBuilder()
+ *         versionsSettingsBuilder
+ *             .getVersionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * VersionsSettings versionsSettings = versionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class VersionsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listVersions. */ public PagedCallSettings listVersionsSettings() { @@ -87,8 +89,6 @@ public UnaryCallSettings createVersionSettings( } /** Returns the object with the settings used for calls to createVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings createVersionOperationSettings() { return ((VersionsStubSettings) getStubSettings()).createVersionOperationSettings(); @@ -110,8 +110,6 @@ public UnaryCallSettings loadVersionSettings() { } /** Returns the object with the settings used for calls to loadVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings loadVersionOperationSettings() { return ((VersionsStubSettings) getStubSettings()).loadVersionOperationSettings(); } @@ -175,18 +173,15 @@ protected VersionsSettings(Builder settingsBuilder) throws IOException { /** Builder for VersionsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(VersionsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(VersionsStubSettings.newBuilder()); - } - protected Builder(VersionsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -195,11 +190,15 @@ protected Builder(VersionsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(VersionsStubSettings.newBuilder()); + } + public VersionsStubSettings.Builder getStubSettingsBuilder() { return ((VersionsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -230,8 +229,6 @@ public UnaryCallSettings.Builder createVersionS } /** Returns the builder for the settings used for calls to createVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder< CreateVersionRequest, Version, CreateVersionOperationMetadata> createVersionOperationSettings() { @@ -254,8 +251,6 @@ public UnaryCallSettings.Builder loadVersionSetti } /** Returns the builder for the settings used for calls to loadVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder loadVersionOperationSettings() { return getStubSettingsBuilder().loadVersionOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java index 866ef77f1..9856c2fcd 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.ApiFunction; @@ -32,26 +33,18 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- *   Webhook response = webhooksClient.getWebhook(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the webhooksClient object to clean up resources such as + *

Note: close() needs to be called on the WebhooksClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -79,28 +72,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * WebhooksSettings webhooksSettings =
  *     WebhooksSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * WebhooksClient webhooksClient =
- *     WebhooksClient.create(webhooksSettings);
- * 
- * 
+ * WebhooksClient webhooksClient = WebhooksClient.create(webhooksSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * WebhooksSettings webhooksSettings =
  *     WebhooksSettings.newBuilder().setEndpoint(myEndpoint).build();
- * WebhooksClient webhooksClient =
- *     WebhooksClient.create(webhooksSettings);
- * 
- * 
+ * WebhooksClient webhooksClient = WebhooksClient.create(webhooksSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ +@BetaApi @Generated("by gapic-generator") public class WebhooksClient implements BackgroundResource { private final WebhooksSettings settings; @@ -121,7 +111,7 @@ public static final WebhooksClient create(WebhooksSettings settings) throws IOEx /** * Constructs an instance of WebhooksClient, using the given stub for making calls. This is for - * advanced usage - prefer to use WebhooksSettings}. + * advanced usage - prefer using create(WebhooksSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final WebhooksClient create(WebhooksStub stub) { @@ -152,21 +142,10 @@ public WebhooksStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Webhook element : webhooksClient.listWebhooks(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all webhooks for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -174,26 +153,15 @@ public WebhooksStub getStub() { public final ListWebhooksPagedResponse listWebhooks(AgentName parent) { ListWebhooksRequest request = ListWebhooksRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listWebhooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Webhook element : webhooksClient.listWebhooks(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all webhooks for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -203,24 +171,10 @@ public final ListWebhooksPagedResponse listWebhooks(String parent) { return listWebhooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Webhook element : webhooksClient.listWebhooks(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -228,98 +182,47 @@ public final ListWebhooksPagedResponse listWebhooks(ListWebhooksRequest request) return listWebhooksPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListWebhooksPagedResponse> future = webhooksClient.listWebhooksPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Webhook element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listWebhooksPagedCallable() { return stub.listWebhooksPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListWebhooksResponse response = webhooksClient.listWebhooksCallable().call(request);
-   *     for (Webhook element : response.getWebhooksList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listWebhooksCallable() { return stub.listWebhooksCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   Webhook response = webhooksClient.getWebhook(name);
-   * }
-   * 
- * * @param name Required. The name of the webhook. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Webhook getWebhook(WebhookName name) { GetWebhookRequest request = - GetWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetWebhookRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   Webhook response = webhooksClient.getWebhook(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the webhook. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -329,22 +232,10 @@ public final Webhook getWebhook(String name) { return getWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   GetWebhookRequest request = GetWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Webhook response = webhooksClient.getWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -352,42 +243,20 @@ public final Webhook getWebhook(GetWebhookRequest request) { return getWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   GetWebhookRequest request = GetWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Webhook> future = webhooksClient.getWebhookCallable().futureCall(request);
-   *   // Do something
-   *   Webhook response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getWebhookCallable() { return stub.getWebhookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   Webhook response = webhooksClient.createWebhook(parent, webhook);
-   * }
-   * 
- * * @param parent Required. The agent to create a webhook for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param webhook Required. The webhook to create. @@ -396,26 +265,16 @@ public final UnaryCallable getWebhookCallable() { public final Webhook createWebhook(AgentName parent, Webhook webhook) { CreateWebhookRequest request = CreateWebhookRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setWebhook(webhook) .build(); return createWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   Webhook response = webhooksClient.createWebhook(parent.toString(), webhook);
-   * }
-   * 
- * * @param parent Required. The agent to create a webhook for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param webhook Required. The webhook to create. @@ -427,24 +286,10 @@ public final Webhook createWebhook(String parent, Webhook webhook) { return createWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setWebhook(webhook)
-   *     .build();
-   *   Webhook response = webhooksClient.createWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -452,47 +297,23 @@ public final Webhook createWebhook(CreateWebhookRequest request) { return createWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setWebhook(webhook)
-   *     .build();
-   *   ApiFuture<Webhook> future = webhooksClient.createWebhookCallable().futureCall(request);
-   *   // Do something
-   *   Webhook response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createWebhookCallable() { return stub.createWebhookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Webhook response = webhooksClient.updateWebhook(webhook, updateMask);
-   * }
-   * 
- * * @param webhook Required. The webhook to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) { @@ -501,22 +322,10 @@ public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) { return updateWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
-   *     .setWebhook(webhook)
-   *     .build();
-   *   Webhook response = webhooksClient.updateWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -524,64 +333,36 @@ public final Webhook updateWebhook(UpdateWebhookRequest request) { return updateWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified webhook. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
-   *     .setWebhook(webhook)
-   *     .build();
-   *   ApiFuture<Webhook> future = webhooksClient.updateWebhookCallable().futureCall(request);
-   *   // Do something
-   *   Webhook response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateWebhookCallable() { return stub.updateWebhookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   webhooksClient.deleteWebhook(name);
-   * }
-   * 
- * * @param name Required. The name of the webhook to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteWebhook(WebhookName name) { DeleteWebhookRequest request = - DeleteWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteWebhookRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   webhooksClient.deleteWebhook(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the webhook to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -591,22 +372,10 @@ public final void deleteWebhook(String name) { deleteWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   webhooksClient.deleteWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -614,23 +383,11 @@ public final void deleteWebhook(DeleteWebhookRequest request) { deleteWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = webhooksClient.deleteWebhookCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteWebhookCallable() { return stub.deleteWebhookCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksSettings.java index 826a60f99..d16c59651 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.WebhooksClient.ListWebhooksPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link WebhooksClient}. * @@ -51,22 +52,23 @@ * *

For example, to set the total timeout of getWebhook to 30 seconds: * - *

- * 
- * WebhooksSettings.Builder webhooksSettingsBuilder =
- *     WebhooksSettings.newBuilder();
+ * 
{@code
+ * WebhooksSettings.Builder webhooksSettingsBuilder = WebhooksSettings.newBuilder();
  * webhooksSettingsBuilder
  *     .getWebhookSettings()
  *     .setRetrySettings(
- *         webhooksSettingsBuilder.getWebhookSettings().getRetrySettings().toBuilder()
+ *         webhooksSettingsBuilder
+ *             .getWebhookSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * WebhooksSettings webhooksSettings = webhooksSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") public class WebhooksSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listWebhooks. */ public PagedCallSettings listWebhooksSettings() { @@ -152,18 +154,15 @@ protected WebhooksSettings(Builder settingsBuilder) throws IOException { /** Builder for WebhooksSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(WebhooksStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(WebhooksStubSettings.newBuilder()); - } - protected Builder(WebhooksSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -172,11 +171,15 @@ protected Builder(WebhooksStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(WebhooksStubSettings.newBuilder()); + } + public WebhooksStubSettings.Builder getStubSettingsBuilder() { return ((WebhooksStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java index 5c34c1340..761ab736c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,136 +15,53 @@ */ /** - * A client to Dialogflow API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

=========== PagesClient =========== - * - *

Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. - * - *

Sample for PagesClient: - * - *

- * 
- * try (PagesClient pagesClient = PagesClient.create()) {
- *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- *   Page response = pagesClient.getPage(name);
- * }
- * 
- * 
- * - * =========== FlowsClient =========== - * - *

Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. - * - *

Sample for FlowsClient: - * - *

- * 
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Flow flow = Flow.newBuilder().build();
- *   Flow response = flowsClient.createFlow(parent, flow);
- * }
- * 
- * 
- * - * ============ AgentsClient ============ + *

======================= AgentsClient ======================= * *

Service Description: Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent]. * *

Sample for AgentsClient: * - *

- * 
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Agent response = agentsClient.getAgent(name);
- * }
- * 
- * 
- * - * ================= EntityTypesClient ================= + *

======================= EntityTypesClient ======================= * *

Service Description: Service for managing * [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType]. * *

Sample for EntityTypesClient: * - *

- * 
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- *   EntityType response = entityTypesClient.getEntityType(name);
- * }
- * 
- * 
- * - * ================== EnvironmentsClient ================== + *

======================= EnvironmentsClient ======================= * *

Service Description: Service for managing * [Environments][google.cloud.dialogflow.cx.v3.Environment]. * *

Sample for EnvironmentsClient: * - *

- * 
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- *   Environment response = environmentsClient.getEnvironment(name);
- * }
- * 
- * 
+ *

======================= FlowsClient ======================= * - * ============= IntentsClient ============= - * - *

Service Description: Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. + *

Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow]. * - *

Sample for IntentsClient: + *

Sample for FlowsClient: * - *

- * 
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- *   Intent response = intentsClient.getIntent(name);
- * }
- * 
- * 
+ *

======================= IntentsClient ======================= * - * ============================= SecuritySettingsServiceClient ============================= + *

Service Description: Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent]. * - *

Service Description: Service for managing security settings for Dialogflow. + *

Sample for IntentsClient: * - *

Sample for SecuritySettingsServiceClient: + *

======================= PagesClient ======================= * - *

- * 
- * try (SecuritySettingsServiceClient securitySettingsServiceClient = SecuritySettingsServiceClient.create()) {
- *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
- *   SecuritySettings securitySettings = SecuritySettings.newBuilder().build();
- *   SecuritySettings response = securitySettingsServiceClient.createSecuritySettings(parent, securitySettings);
- * }
- * 
- * 
+ *

Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page]. * - * ======================== SessionEntityTypesClient ======================== + *

Sample for PagesClient: * - *

Service Description: Service for managing - * [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. + *

======================= SecuritySettingsServiceClient ======================= * - *

Sample for SessionEntityTypesClient: + *

Service Description: Service for managing security settings for Dialogflow. * - *

- * 
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
- * }
- * 
- * 
+ *

Sample for SecuritySettingsServiceClient: * - * ============== SessionsClient ============== + *

======================= SessionsClient ======================= * *

Service Description: A session represents an interaction with a user. You retrieve user input * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to @@ -152,67 +69,33 @@ * *

Sample for SessionsClient: * - *

- * 
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- *   QueryInput queryInput = QueryInput.newBuilder().build();
- *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
- *     .setSession(session.toString())
- *     .setQueryInput(queryInput)
- *     .build();
- *   DetectIntentResponse response = sessionsClient.detectIntent(request);
- * }
- * 
- * 
- * - * =========================== TransitionRouteGroupsClient =========================== + *

======================= SessionEntityTypesClient ======================= + * + *

Service Description: Service for managing + * [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType]. + * + *

Sample for SessionEntityTypesClient: + * + *

======================= TransitionRouteGroupsClient ======================= * *

Service Description: Service for managing * [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * *

Sample for TransitionRouteGroupsClient: * - *

- * 
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
- * }
- * 
- * 
- * - * ============== VersionsClient ============== + *

======================= VersionsClient ======================= * *

Service Description: Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version]. * *

Sample for VersionsClient: * - *

- * 
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- *   Version response = versionsClient.getVersion(name);
- * }
- * 
- * 
- * - * ============== WebhooksClient ============== + *

======================= WebhooksClient ======================= * *

Service Description: Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook]. * *

Sample for WebhooksClient: - * - *

- * 
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- *   Webhook response = webhooksClient.getWebhook(name);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.dialogflow.cx.v3; import javax.annotation.Generated; diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java index 17fc87869..df817663c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.AgentsClient.ListAgentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -37,17 +37,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Agents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AgentsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -76,7 +74,6 @@ public UnaryCallable deleteAgentCallable() { throw new UnsupportedOperationException("Not implemented: deleteAgentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable exportAgentOperationCallable() { throw new UnsupportedOperationException("Not implemented: exportAgentOperationCallable()"); @@ -86,7 +83,6 @@ public UnaryCallable exportAgentCallable() { throw new UnsupportedOperationException("Not implemented: exportAgentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable restoreAgentOperationCallable() { throw new UnsupportedOperationException("Not implemented: restoreAgentOperationCallable()"); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java index 972d76358..3df57023e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.AgentsClient.ListAgentsPagedResponse; @@ -62,10 +63,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AgentsStub}. * @@ -82,21 +84,22 @@ * *

For example, to set the total timeout of getAgent to 30 seconds: * - *

- * 
- * AgentsStubSettings.Builder agentsSettingsBuilder =
- *     AgentsStubSettings.newBuilder();
+ * 
{@code
+ * AgentsStubSettings.Builder agentsSettingsBuilder = AgentsStubSettings.newBuilder();
  * agentsSettingsBuilder
  *     .getAgentSettings()
  *     .setRetrySettings(
- *         agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ *         agentsSettingsBuilder
+ *             .getAgentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AgentsStubSettings agentsSettings = agentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class AgentsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -118,6 +121,59 @@ public class AgentsStubSettings extends StubSettings { private final OperationCallSettings restoreAgentOperationSettings; + private static final PagedListDescriptor + LIST_AGENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAgentsRequest injectToken(ListAgentsRequest payload, String token) { + return ListAgentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAgentsRequest injectPageSize(ListAgentsRequest payload, int pageSize) { + return ListAgentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAgentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAgentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAgentsResponse payload) { + return Objects.isNull(payload.getAgentsList()) + ? ImmutableList.of() + : payload.getAgentsList(); + } + }; + + private static final PagedListResponseFactory< + ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> + LIST_AGENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAgentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_AGENTS_PAGE_STR_DESC, request, context); + return ListAgentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listAgents. */ public PagedCallSettings listAgentsSettings() { @@ -150,7 +206,6 @@ public UnaryCallSettings exportAgentSettings() { } /** Returns the object with the settings used for calls to exportAgent. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings exportAgentOperationSettings() { return exportAgentOperationSettings; @@ -162,7 +217,6 @@ public UnaryCallSettings restoreAgentSettings() } /** Returns the object with the settings used for calls to restoreAgent. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings restoreAgentOperationSettings() { return restoreAgentOperationSettings; } @@ -173,10 +227,10 @@ public AgentsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAgentsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -246,63 +300,9 @@ protected AgentsStubSettings(Builder settingsBuilder) throws IOException { restoreAgentOperationSettings = settingsBuilder.restoreAgentOperationSettings().build(); } - private static final PagedListDescriptor - LIST_AGENTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListAgentsRequest injectToken(ListAgentsRequest payload, String token) { - return ListAgentsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListAgentsRequest injectPageSize(ListAgentsRequest payload, int pageSize) { - return ListAgentsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListAgentsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListAgentsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListAgentsResponse payload) { - return payload.getAgentsList() != null - ? payload.getAgentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> - LIST_AGENTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListAgentsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_AGENTS_PAGE_STR_DESC, request, context); - return ListAgentsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for AgentsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> listAgentsSettings; @@ -316,7 +316,6 @@ public static class Builder extends StubSettings.Builder restoreAgentSettings; private final OperationCallSettings.Builder restoreAgentOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -324,14 +323,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -350,54 +343,25 @@ public static class Builder extends StubSettings.Builder>of( + listAgentsSettings, + getAgentSettings, + createAgentSettings, + updateAgentSettings, + deleteAgentSettings, + exportAgentSettings, + restoreAgentSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listAgentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .exportAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .restoreAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .exportAgentOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(ExportAgentResponse.class)) @@ -472,21 +461,22 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .restoreAgentOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -495,43 +485,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(AgentsStubSettings settings) { - super(settings); - - listAgentsSettings = settings.listAgentsSettings.toBuilder(); - getAgentSettings = settings.getAgentSettings.toBuilder(); - createAgentSettings = settings.createAgentSettings.toBuilder(); - updateAgentSettings = settings.updateAgentSettings.toBuilder(); - deleteAgentSettings = settings.deleteAgentSettings.toBuilder(); - exportAgentSettings = settings.exportAgentSettings.toBuilder(); - exportAgentOperationSettings = settings.exportAgentOperationSettings.toBuilder(); - restoreAgentSettings = settings.restoreAgentSettings.toBuilder(); - restoreAgentOperationSettings = settings.restoreAgentOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listAgentsSettings, - getAgentSettings, - createAgentSettings, - updateAgentSettings, - deleteAgentSettings, - exportAgentSettings, - restoreAgentSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStub.java index 8ac55ce43..7d5e24b79 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.EntityTypesClient.ListEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the EntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class EntityTypesStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java index ac312fea5..751d92c19 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.EntityTypesClient.ListEntityTypesPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EntityTypesStub}. * @@ -73,21 +75,23 @@ * *

For example, to set the total timeout of getEntityType to 30 seconds: * - *

- * 
+ * 
{@code
  * EntityTypesStubSettings.Builder entityTypesSettingsBuilder =
  *     EntityTypesStubSettings.newBuilder();
  * entityTypesSettingsBuilder
  *     .getEntityTypeSettings()
  *     .setRetrySettings(
- *         entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ *         entityTypesSettingsBuilder
+ *             .getEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EntityTypesStubSettings entityTypesSettings = entityTypesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class EntityTypesStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -104,6 +108,62 @@ public class EntityTypesStubSettings extends StubSettings updateEntityTypeSettings; private final UnaryCallSettings deleteEntityTypeSettings; + private static final PagedListDescriptor< + ListEntityTypesRequest, ListEntityTypesResponse, EntityType> + LIST_ENTITY_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEntityTypesRequest injectToken( + ListEntityTypesRequest payload, String token) { + return ListEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEntityTypesRequest injectPageSize( + ListEntityTypesRequest payload, int pageSize) { + return ListEntityTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEntityTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEntityTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEntityTypesResponse payload) { + return Objects.isNull(payload.getEntityTypesList()) + ? ImmutableList.of() + : payload.getEntityTypesList(); + } + }; + + private static final PagedListResponseFactory< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + LIST_ENTITY_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEntityTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ENTITY_TYPES_PAGE_STR_DESC, request, context); + return ListEntityTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listEntityTypes. */ public PagedCallSettings< ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> @@ -137,10 +197,10 @@ public EntityTypesStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcEntityTypesStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -207,66 +267,9 @@ protected EntityTypesStubSettings(Builder settingsBuilder) throws IOException { deleteEntityTypeSettings = settingsBuilder.deleteEntityTypeSettings().build(); } - private static final PagedListDescriptor< - ListEntityTypesRequest, ListEntityTypesResponse, EntityType> - LIST_ENTITY_TYPES_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListEntityTypesRequest injectToken( - ListEntityTypesRequest payload, String token) { - return ListEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListEntityTypesRequest injectPageSize( - ListEntityTypesRequest payload, int pageSize) { - return ListEntityTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListEntityTypesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListEntityTypesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListEntityTypesResponse payload) { - return payload.getEntityTypesList() != null - ? payload.getEntityTypesList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> - LIST_ENTITY_TYPES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListEntityTypesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_ENTITY_TYPES_PAGE_STR_DESC, request, context); - return ListEntityTypesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for EntityTypesStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> listEntityTypesSettings; @@ -277,7 +280,6 @@ public static class Builder extends StubSettings.Builder deleteEntityTypeSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -285,14 +287,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -311,46 +307,21 @@ public static class Builder extends StubSettings.Builder>of( + listEntityTypesSettings, + getEntityTypeSettings, + createEntityTypeSettings, + updateEntityTypeSettings, + deleteEntityTypeSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listEntityTypesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(EntityTypesStubSettings settings) { - super(settings); - - listEntityTypesSettings = settings.listEntityTypesSettings.toBuilder(); - getEntityTypeSettings = settings.getEntityTypeSettings.toBuilder(); - createEntityTypeSettings = settings.createEntityTypeSettings.toBuilder(); - updateEntityTypeSettings = settings.updateEntityTypeSettings.toBuilder(); - deleteEntityTypeSettings = settings.deleteEntityTypeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listEntityTypesSettings, - getEntityTypeSettings, - createEntityTypeSettings, - updateEntityTypeSettings, - deleteEntityTypeSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStub.java index 312c2d9f2..f2e0d0078 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.EnvironmentsClient.ListEnvironmentsPagedResponse; import static com.google.cloud.dialogflow.cx.v3.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -37,17 +37,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Environments service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class EnvironmentsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -66,7 +64,6 @@ public UnaryCallable getEnvironmentCallable( throw new UnsupportedOperationException("Not implemented: getEnvironmentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createEnvironmentOperationCallable() { throw new UnsupportedOperationException( @@ -77,7 +74,6 @@ public UnaryCallable createEnvironmentCalla throw new UnsupportedOperationException("Not implemented: createEnvironmentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable updateEnvironmentOperationCallable() { throw new UnsupportedOperationException( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java index 143225496..ef0e240c7 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.EnvironmentsClient.ListEnvironmentsPagedResponse; @@ -62,10 +63,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EnvironmentsStub}. * @@ -82,21 +84,23 @@ * *

For example, to set the total timeout of getEnvironment to 30 seconds: * - *

- * 
+ * 
{@code
  * EnvironmentsStubSettings.Builder environmentsSettingsBuilder =
  *     EnvironmentsStubSettings.newBuilder();
  * environmentsSettingsBuilder
  *     .getEnvironmentSettings()
  *     .setRetrySettings(
- *         environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ *         environmentsSettingsBuilder
+ *             .getEnvironmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EnvironmentsStubSettings environmentsSettings = environmentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class EnvironmentsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -122,6 +126,137 @@ public class EnvironmentsStubSettings extends StubSettings lookupEnvironmentHistorySettings; + private static final PagedListDescriptor< + ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> + LIST_ENVIRONMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListEnvironmentsRequest, ListEnvironmentsResponse, Environment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEnvironmentsRequest injectToken( + ListEnvironmentsRequest payload, String token) { + return ListEnvironmentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEnvironmentsRequest injectPageSize( + ListEnvironmentsRequest payload, int pageSize) { + return ListEnvironmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEnvironmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEnvironmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEnvironmentsResponse payload) { + return Objects.isNull(payload.getEnvironmentsList()) + ? ImmutableList.of() + : payload.getEnvironmentsList(); + } + }; + + private static final PagedListDescriptor< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment> + LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC = + new PagedListDescriptor< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public LookupEnvironmentHistoryRequest injectToken( + LookupEnvironmentHistoryRequest payload, String token) { + return LookupEnvironmentHistoryRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public LookupEnvironmentHistoryRequest injectPageSize( + LookupEnvironmentHistoryRequest payload, int pageSize) { + return LookupEnvironmentHistoryRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(LookupEnvironmentHistoryRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(LookupEnvironmentHistoryResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + LookupEnvironmentHistoryResponse payload) { + return Objects.isNull(payload.getEnvironmentsList()) + ? ImmutableList.of() + : payload.getEnvironmentsList(); + } + }; + + private static final PagedListResponseFactory< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + LIST_ENVIRONMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEnvironmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_ENVIRONMENTS_PAGE_STR_DESC, request, context); + return ListEnvironmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_FACT = + new PagedListResponseFactory< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + LookupEnvironmentHistoryRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + Environment> + pageContext = + PageContext.create( + callable, LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC, request, context); + return LookupEnvironmentHistoryPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listEnvironments. */ public PagedCallSettings< ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> @@ -140,7 +275,6 @@ public UnaryCallSettings createEnvironmentS } /** Returns the object with the settings used for calls to createEnvironment. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings createEnvironmentOperationSettings() { return createEnvironmentOperationSettings; @@ -152,7 +286,6 @@ public UnaryCallSettings updateEnvironmentS } /** Returns the object with the settings used for calls to updateEnvironment. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings updateEnvironmentOperationSettings() { return updateEnvironmentOperationSettings; @@ -178,10 +311,10 @@ public EnvironmentsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcEnvironmentsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -253,141 +386,9 @@ protected EnvironmentsStubSettings(Builder settingsBuilder) throws IOException { lookupEnvironmentHistorySettings = settingsBuilder.lookupEnvironmentHistorySettings().build(); } - private static final PagedListDescriptor< - ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> - LIST_ENVIRONMENTS_PAGE_STR_DESC = - new PagedListDescriptor< - ListEnvironmentsRequest, ListEnvironmentsResponse, Environment>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListEnvironmentsRequest injectToken( - ListEnvironmentsRequest payload, String token) { - return ListEnvironmentsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListEnvironmentsRequest injectPageSize( - ListEnvironmentsRequest payload, int pageSize) { - return ListEnvironmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListEnvironmentsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListEnvironmentsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListEnvironmentsResponse payload) { - return payload.getEnvironmentsList() != null - ? payload.getEnvironmentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListDescriptor< - LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment> - LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC = - new PagedListDescriptor< - LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public LookupEnvironmentHistoryRequest injectToken( - LookupEnvironmentHistoryRequest payload, String token) { - return LookupEnvironmentHistoryRequest.newBuilder(payload) - .setPageToken(token) - .build(); - } - - @Override - public LookupEnvironmentHistoryRequest injectPageSize( - LookupEnvironmentHistoryRequest payload, int pageSize) { - return LookupEnvironmentHistoryRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(LookupEnvironmentHistoryRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(LookupEnvironmentHistoryResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - LookupEnvironmentHistoryResponse payload) { - return payload.getEnvironmentsList() != null - ? payload.getEnvironmentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> - LIST_ENVIRONMENTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListEnvironmentsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_ENVIRONMENTS_PAGE_STR_DESC, request, context); - return ListEnvironmentsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - LookupEnvironmentHistoryRequest, - LookupEnvironmentHistoryResponse, - LookupEnvironmentHistoryPagedResponse> - LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_FACT = - new PagedListResponseFactory< - LookupEnvironmentHistoryRequest, - LookupEnvironmentHistoryResponse, - LookupEnvironmentHistoryPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - LookupEnvironmentHistoryRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - LookupEnvironmentHistoryRequest, - LookupEnvironmentHistoryResponse, - Environment> - pageContext = - PageContext.create( - callable, LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC, request, context); - return LookupEnvironmentHistoryPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for EnvironmentsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> listEnvironmentsSettings; @@ -408,7 +409,6 @@ public static class Builder extends StubSettings.Builder lookupEnvironmentHistorySettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -416,14 +416,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -442,52 +436,24 @@ public static class Builder extends StubSettings.Builder>of( + listEnvironmentsSettings, + getEnvironmentSettings, + createEnvironmentSettings, + updateEnvironmentSettings, + deleteEnvironmentSettings, + lookupEnvironmentHistorySettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listEnvironmentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .lookupEnvironmentHistorySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createEnvironmentOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) @@ -558,21 +547,22 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .updateEnvironmentOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) @@ -581,41 +571,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(EnvironmentsStubSettings settings) { - super(settings); - - listEnvironmentsSettings = settings.listEnvironmentsSettings.toBuilder(); - getEnvironmentSettings = settings.getEnvironmentSettings.toBuilder(); - createEnvironmentSettings = settings.createEnvironmentSettings.toBuilder(); - createEnvironmentOperationSettings = settings.createEnvironmentOperationSettings.toBuilder(); - updateEnvironmentSettings = settings.updateEnvironmentSettings.toBuilder(); - updateEnvironmentOperationSettings = settings.updateEnvironmentOperationSettings.toBuilder(); - deleteEnvironmentSettings = settings.deleteEnvironmentSettings.toBuilder(); - lookupEnvironmentHistorySettings = settings.lookupEnvironmentHistorySettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listEnvironmentsSettings, - getEnvironmentSettings, - createEnvironmentSettings, - updateEnvironmentSettings, - deleteEnvironmentSettings, - lookupEnvironmentHistorySettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStub.java index 3129d91a7..e4674f2e1 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.FlowsClient.ListFlowsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -35,17 +35,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Flows service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class FlowsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -74,7 +72,6 @@ public UnaryCallable updateFlowCallable() { throw new UnsupportedOperationException("Not implemented: updateFlowCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable trainFlowOperationCallable() { throw new UnsupportedOperationException("Not implemented: trainFlowOperationCallable()"); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java index 8855f6e4c..02cf29af6 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.FlowsClient.ListFlowsPagedResponse; @@ -60,10 +61,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link FlowsStub}. * @@ -80,21 +82,22 @@ * *

For example, to set the total timeout of createFlow to 30 seconds: * - *

- * 
- * FlowsStubSettings.Builder flowsSettingsBuilder =
- *     FlowsStubSettings.newBuilder();
+ * 
{@code
+ * FlowsStubSettings.Builder flowsSettingsBuilder = FlowsStubSettings.newBuilder();
  * flowsSettingsBuilder
  *     .createFlowSettings()
  *     .setRetrySettings(
- *         flowsSettingsBuilder.createFlowSettings().getRetrySettings().toBuilder()
+ *         flowsSettingsBuilder
+ *             .createFlowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * FlowsStubSettings flowsSettings = flowsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class FlowsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -112,6 +115,59 @@ public class FlowsStubSettings extends StubSettings { private final UnaryCallSettings trainFlowSettings; private final OperationCallSettings trainFlowOperationSettings; + private static final PagedListDescriptor + LIST_FLOWS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFlowsRequest injectToken(ListFlowsRequest payload, String token) { + return ListFlowsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFlowsRequest injectPageSize(ListFlowsRequest payload, int pageSize) { + return ListFlowsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFlowsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFlowsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFlowsResponse payload) { + return Objects.isNull(payload.getFlowsList()) + ? ImmutableList.of() + : payload.getFlowsList(); + } + }; + + private static final PagedListResponseFactory< + ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse> + LIST_FLOWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFlowsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FLOWS_PAGE_STR_DESC, request, context); + return ListFlowsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createFlow. */ public UnaryCallSettings createFlowSettings() { return createFlowSettings; @@ -144,7 +200,6 @@ public UnaryCallSettings trainFlowSettings() { } /** Returns the object with the settings used for calls to trainFlow. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings trainFlowOperationSettings() { return trainFlowOperationSettings; } @@ -155,10 +210,10 @@ public FlowsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcFlowsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -226,63 +281,9 @@ protected FlowsStubSettings(Builder settingsBuilder) throws IOException { trainFlowOperationSettings = settingsBuilder.trainFlowOperationSettings().build(); } - private static final PagedListDescriptor - LIST_FLOWS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListFlowsRequest injectToken(ListFlowsRequest payload, String token) { - return ListFlowsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListFlowsRequest injectPageSize(ListFlowsRequest payload, int pageSize) { - return ListFlowsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListFlowsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListFlowsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListFlowsResponse payload) { - return payload.getFlowsList() != null - ? payload.getFlowsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse> - LIST_FLOWS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListFlowsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_FLOWS_PAGE_STR_DESC, request, context); - return ListFlowsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for FlowsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createFlowSettings; private final UnaryCallSettings.Builder deleteFlowSettings; private final PagedCallSettings.Builder< @@ -293,7 +294,6 @@ public static class Builder extends StubSettings.Builder trainFlowSettings; private final OperationCallSettings.Builder trainFlowOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -301,14 +301,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -327,50 +321,23 @@ public static class Builder extends StubSettings.Builder>of( + createFlowSettings, + deleteFlowSettings, + listFlowsSettings, + getFlowSettings, + updateFlowSettings, + trainFlowSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .createFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .listFlowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .trainFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .trainFlowOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -439,40 +428,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(FlowsStubSettings settings) { - super(settings); - - createFlowSettings = settings.createFlowSettings.toBuilder(); - deleteFlowSettings = settings.deleteFlowSettings.toBuilder(); - listFlowsSettings = settings.listFlowsSettings.toBuilder(); - getFlowSettings = settings.getFlowSettings.toBuilder(); - updateFlowSettings = settings.updateFlowSettings.toBuilder(); - trainFlowSettings = settings.trainFlowSettings.toBuilder(); - trainFlowOperationSettings = settings.trainFlowOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createFlowSettings, - deleteFlowSettings, - listFlowsSettings, - getFlowSettings, - updateFlowSettings, - trainFlowSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsCallableFactory.java index b3c6a9f4a..85ae3965b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Agents service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAgentsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java index aee0bc897..cca5894f8 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.AgentsClient.ListAgentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -48,16 +48,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Agents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcAgentsStub extends AgentsStub { - private static final MethodDescriptor listAgentsMethodDescriptor = MethodDescriptor.newBuilder() @@ -66,6 +64,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(ListAgentsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListAgentsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -73,6 +72,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) .build(); + private static final MethodDescriptor createAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -80,6 +80,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) .build(); + private static final MethodDescriptor updateAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -87,6 +88,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdateAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -94,6 +96,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor exportAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -101,6 +104,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(ExportAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor restoreAgentMethodDescriptor = MethodDescriptor.newBuilder() @@ -110,9 +114,6 @@ public class GrpcAgentsStub extends AgentsStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable listAgentsCallable; private final UnaryCallable listAgentsPagedCallable; private final UnaryCallable getAgentCallable; @@ -125,6 +126,8 @@ public class GrpcAgentsStub extends AgentsStub { private final UnaryCallable restoreAgentCallable; private final OperationCallable restoreAgentOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcAgentsStub create(AgentsStubSettings settings) throws IOException { @@ -141,19 +144,11 @@ public static final GrpcAgentsStub create( AgentsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcAgentsStub(AgentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcAgentsCallableFactory()); } - /** - * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcAgentsStub( AgentsStubSettings settings, ClientContext clientContext, @@ -280,7 +275,7 @@ public Map extract(RestoreAgentRequest request) { exportAgentTransportSettings, settings.exportAgentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.restoreAgentCallable = callableFactory.createUnaryCallable( restoreAgentTransportSettings, settings.restoreAgentSettings(), clientContext); @@ -289,24 +284,24 @@ public Map extract(RestoreAgentRequest request) { restoreAgentTransportSettings, settings.restoreAgentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable listAgentsPagedCallable() { - return listAgentsPagedCallable; - } - public UnaryCallable listAgentsCallable() { return listAgentsCallable; } + public UnaryCallable listAgentsPagedCallable() { + return listAgentsPagedCallable; + } + public UnaryCallable getAgentCallable() { return getAgentCallable; } @@ -323,25 +318,23 @@ public UnaryCallable deleteAgentCallable() { return deleteAgentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable exportAgentCallable() { + return exportAgentCallable; + } + public OperationCallable exportAgentOperationCallable() { return exportAgentOperationCallable; } - public UnaryCallable exportAgentCallable() { - return exportAgentCallable; + public UnaryCallable restoreAgentCallable() { + return restoreAgentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable restoreAgentOperationCallable() { return restoreAgentOperationCallable; } - public UnaryCallable restoreAgentCallable() { - return restoreAgentCallable; - } - @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesCallableFactory.java index adc82304d..eb8395bc7 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the EntityTypes service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcEntityTypesCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java index 24cff0e2f..d951188c4 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.EntityTypesClient.ListEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse; import com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the EntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcEntityTypesStub extends EntityTypesStub { - private static final MethodDescriptor listEntityTypesMethodDescriptor = MethodDescriptor.newBuilder() @@ -61,6 +60,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { .setResponseMarshaller( ProtoUtils.marshaller(ListEntityTypesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -70,6 +70,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { ProtoUtils.marshaller(GetEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor createEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -79,6 +80,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { ProtoUtils.marshaller(CreateEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor updateEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -88,6 +90,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { ProtoUtils.marshaller(UpdateEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -98,8 +101,6 @@ public class GrpcEntityTypesStub extends EntityTypesStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listEntityTypesCallable; private final UnaryCallable @@ -109,6 +110,8 @@ public class GrpcEntityTypesStub extends EntityTypesStub { private final UnaryCallable updateEntityTypeCallable; private final UnaryCallable deleteEntityTypeCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcEntityTypesStub create(EntityTypesStubSettings settings) @@ -126,27 +129,18 @@ public static final GrpcEntityTypesStub create( EntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEntityTypesStub(EntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEntityTypesCallableFactory()); } - /** - * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEntityTypesStub( EntityTypesStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listEntityTypesTransportSettings = @@ -235,18 +229,23 @@ public Map extract(DeleteEntityTypeRequest request) { callableFactory.createUnaryCallable( deleteEntityTypeTransportSettings, settings.deleteEntityTypeSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable - listEntityTypesPagedCallable() { - return listEntityTypesPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listEntityTypesCallable() { return listEntityTypesCallable; } + public UnaryCallable + listEntityTypesPagedCallable() { + return listEntityTypesPagedCallable; + } + public UnaryCallable getEntityTypeCallable() { return getEntityTypeCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsCallableFactory.java index 47b8ad918..40dbc708d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Environments service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcEnvironmentsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java index fa0a466c8..de036e1c3 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.EnvironmentsClient.ListEnvironmentsPagedResponse; import static com.google.cloud.dialogflow.cx.v3.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -48,16 +48,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Environments service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcEnvironmentsStub extends EnvironmentsStub { - private static final MethodDescriptor listEnvironmentsMethodDescriptor = MethodDescriptor.newBuilder() @@ -68,6 +66,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListEnvironmentsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -77,6 +76,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(GetEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Environment.getDefaultInstance())) .build(); + private static final MethodDescriptor createEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -86,6 +86,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(CreateEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor updateEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -95,6 +96,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(UpdateEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -104,6 +106,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(DeleteEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor< LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse> lookupEnvironmentHistoryMethodDescriptor = @@ -118,9 +121,6 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(LookupEnvironmentHistoryResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable listEnvironmentsCallable; private final UnaryCallable @@ -139,6 +139,8 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryPagedResponse> lookupEnvironmentHistoryPagedCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcEnvironmentsStub create(EnvironmentsStubSettings settings) @@ -156,21 +158,11 @@ public static final GrpcEnvironmentsStub create( EnvironmentsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEnvironmentsStub(EnvironmentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEnvironmentsCallableFactory()); } - /** - * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEnvironmentsStub( EnvironmentsStubSettings settings, ClientContext clientContext, @@ -281,7 +273,7 @@ public Map extract(LookupEnvironmentHistoryRequest request) { createEnvironmentTransportSettings, settings.createEnvironmentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.updateEnvironmentCallable = callableFactory.createUnaryCallable( updateEnvironmentTransportSettings, @@ -292,7 +284,7 @@ public Map extract(LookupEnvironmentHistoryRequest request) { updateEnvironmentTransportSettings, settings.updateEnvironmentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.deleteEnvironmentCallable = callableFactory.createUnaryCallable( deleteEnvironmentTransportSettings, @@ -309,62 +301,60 @@ public Map extract(LookupEnvironmentHistoryRequest request) { settings.lookupEnvironmentHistorySettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable - listEnvironmentsPagedCallable() { - return listEnvironmentsPagedCallable; - } - public UnaryCallable listEnvironmentsCallable() { return listEnvironmentsCallable; } + public UnaryCallable + listEnvironmentsPagedCallable() { + return listEnvironmentsPagedCallable; + } + public UnaryCallable getEnvironmentCallable() { return getEnvironmentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable createEnvironmentCallable() { + return createEnvironmentCallable; + } + public OperationCallable createEnvironmentOperationCallable() { return createEnvironmentOperationCallable; } - public UnaryCallable createEnvironmentCallable() { - return createEnvironmentCallable; + public UnaryCallable updateEnvironmentCallable() { + return updateEnvironmentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable updateEnvironmentOperationCallable() { return updateEnvironmentOperationCallable; } - public UnaryCallable updateEnvironmentCallable() { - return updateEnvironmentCallable; - } - public UnaryCallable deleteEnvironmentCallable() { return deleteEnvironmentCallable; } - public UnaryCallable - lookupEnvironmentHistoryPagedCallable() { - return lookupEnvironmentHistoryPagedCallable; - } - public UnaryCallable lookupEnvironmentHistoryCallable() { return lookupEnvironmentHistoryCallable; } + public UnaryCallable + lookupEnvironmentHistoryPagedCallable() { + return lookupEnvironmentHistoryPagedCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsCallableFactory.java index f029bfa66..ac4d9854c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Flows service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcFlowsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java index 48f50c864..c72f56163 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.FlowsClient.ListFlowsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -46,16 +46,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Flows service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcFlowsStub extends FlowsStub { - private static final MethodDescriptor createFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -63,6 +61,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -70,6 +69,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor listFlowsMethodDescriptor = MethodDescriptor.newBuilder() @@ -78,6 +78,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(ListFlowsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListFlowsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -85,6 +86,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) .build(); + private static final MethodDescriptor updateFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -92,6 +94,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdateFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) .build(); + private static final MethodDescriptor trainFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -100,9 +103,6 @@ public class GrpcFlowsStub extends FlowsStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable createFlowCallable; private final UnaryCallable deleteFlowCallable; private final UnaryCallable listFlowsCallable; @@ -112,6 +112,8 @@ public class GrpcFlowsStub extends FlowsStub { private final UnaryCallable trainFlowCallable; private final OperationCallable trainFlowOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcFlowsStub create(FlowsStubSettings settings) throws IOException { @@ -128,19 +130,11 @@ public static final GrpcFlowsStub create( FlowsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcFlowsStub(FlowsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcFlowsCallableFactory()); } - /** - * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcFlowsStub( FlowsStubSettings settings, ClientContext clientContext, @@ -254,12 +248,12 @@ public Map extract(TrainFlowRequest request) { trainFlowTransportSettings, settings.trainFlowOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } @@ -272,14 +266,14 @@ public UnaryCallable deleteFlowCallable() { return deleteFlowCallable; } - public UnaryCallable listFlowsPagedCallable() { - return listFlowsPagedCallable; - } - public UnaryCallable listFlowsCallable() { return listFlowsCallable; } + public UnaryCallable listFlowsPagedCallable() { + return listFlowsPagedCallable; + } + public UnaryCallable getFlowCallable() { return getFlowCallable; } @@ -288,15 +282,14 @@ public UnaryCallable updateFlowCallable() { return updateFlowCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable trainFlowOperationCallable() { - return trainFlowOperationCallable; - } - public UnaryCallable trainFlowCallable() { return trainFlowCallable; } + public OperationCallable trainFlowOperationCallable() { + return trainFlowOperationCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsCallableFactory.java index a5dc15c25..5bfe77608 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Intents service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcIntentsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java index 34c139bfb..f84636d20 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.IntentsClient.ListIntentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.ListIntentsResponse; import com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Intents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcIntentsStub extends IntentsStub { - private static final MethodDescriptor listIntentsMethodDescriptor = MethodDescriptor.newBuilder() @@ -60,6 +59,7 @@ public class GrpcIntentsStub extends IntentsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListIntentsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -67,6 +67,7 @@ public class GrpcIntentsStub extends IntentsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetIntentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) .build(); + private static final MethodDescriptor createIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -74,6 +75,7 @@ public class GrpcIntentsStub extends IntentsStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateIntentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) .build(); + private static final MethodDescriptor updateIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -81,6 +83,7 @@ public class GrpcIntentsStub extends IntentsStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdateIntentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -89,8 +92,6 @@ public class GrpcIntentsStub extends IntentsStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listIntentsCallable; private final UnaryCallable listIntentsPagedCallable; @@ -99,6 +100,8 @@ public class GrpcIntentsStub extends IntentsStub { private final UnaryCallable updateIntentCallable; private final UnaryCallable deleteIntentCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcIntentsStub create(IntentsStubSettings settings) throws IOException { @@ -115,25 +118,18 @@ public static final GrpcIntentsStub create( IntentsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcIntentsStub(IntentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcIntentsCallableFactory()); } - /** - * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcIntentsStub( IntentsStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listIntentsTransportSettings = GrpcCallSettings.newBuilder() @@ -220,17 +216,22 @@ public Map extract(DeleteIntentRequest request) { callableFactory.createUnaryCallable( deleteIntentTransportSettings, settings.deleteIntentSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable listIntentsPagedCallable() { - return listIntentsPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listIntentsCallable() { return listIntentsCallable; } + public UnaryCallable listIntentsPagedCallable() { + return listIntentsPagedCallable; + } + public UnaryCallable getIntentCallable() { return getIntentCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesCallableFactory.java index c58978775..d47dc9879 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Pages service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcPagesCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java index 33c5e49ce..fffec43f3 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.PagesClient.ListPagesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.Page; import com.google.cloud.dialogflow.cx.v3.UpdatePageRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Pages service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcPagesStub extends PagesStub { - private static final MethodDescriptor listPagesMethodDescriptor = MethodDescriptor.newBuilder() @@ -59,6 +58,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(ListPagesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListPagesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getPageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -66,6 +66,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(GetPageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) .build(); + private static final MethodDescriptor createPageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -73,6 +74,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(CreatePageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) .build(); + private static final MethodDescriptor updatePageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -80,6 +82,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdatePageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) .build(); + private static final MethodDescriptor deletePageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -88,8 +91,6 @@ public class GrpcPagesStub extends PagesStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listPagesCallable; private final UnaryCallable listPagesPagedCallable; private final UnaryCallable getPageCallable; @@ -97,6 +98,8 @@ public class GrpcPagesStub extends PagesStub { private final UnaryCallable updatePageCallable; private final UnaryCallable deletePageCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcPagesStub create(PagesStubSettings settings) throws IOException { @@ -113,25 +116,18 @@ public static final GrpcPagesStub create( PagesStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcPagesStub(PagesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcPagesCallableFactory()); } - /** - * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcPagesStub( PagesStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listPagesTransportSettings = GrpcCallSettings.newBuilder() @@ -218,17 +214,22 @@ public Map extract(DeletePageRequest request) { callableFactory.createUnaryCallable( deletePageTransportSettings, settings.deletePageSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable listPagesPagedCallable() { - return listPagesPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listPagesCallable() { return listPagesCallable; } + public UnaryCallable listPagesPagedCallable() { + return listPagesPagedCallable; + } + public UnaryCallable getPageCallable() { return getPageCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceCallableFactory.java index 47d00bc03..03c7fb881 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the SecuritySettingsService service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcSecuritySettingsServiceCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java index f1a7b5a94..c6489d91b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.SecuritySettingsServiceClient.ListSecuritySettingsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.SecuritySettings; import com.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the SecuritySettingsService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcSecuritySettingsServiceStub extends SecuritySettingsServiceStub { - private static final MethodDescriptor createSecuritySettingsMethodDescriptor = MethodDescriptor.newBuilder() @@ -61,6 +60,7 @@ public class GrpcSecuritySettingsServiceStub extends SecuritySettingsServiceStub ProtoUtils.marshaller(CreateSecuritySettingsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SecuritySettings.getDefaultInstance())) .build(); + private static final MethodDescriptor getSecuritySettingsMethodDescriptor = MethodDescriptor.newBuilder() @@ -71,6 +71,7 @@ public class GrpcSecuritySettingsServiceStub extends SecuritySettingsServiceStub ProtoUtils.marshaller(GetSecuritySettingsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SecuritySettings.getDefaultInstance())) .build(); + private static final MethodDescriptor updateSecuritySettingsMethodDescriptor = MethodDescriptor.newBuilder() @@ -81,6 +82,7 @@ public class GrpcSecuritySettingsServiceStub extends SecuritySettingsServiceStub ProtoUtils.marshaller(UpdateSecuritySettingsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SecuritySettings.getDefaultInstance())) .build(); + private static final MethodDescriptor listSecuritySettingsMethodDescriptor = MethodDescriptor.newBuilder() @@ -92,6 +94,7 @@ public class GrpcSecuritySettingsServiceStub extends SecuritySettingsServiceStub .setResponseMarshaller( ProtoUtils.marshaller(ListSecuritySettingsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteSecuritySettingsMethodDescriptor = MethodDescriptor.newBuilder() @@ -103,8 +106,6 @@ public class GrpcSecuritySettingsServiceStub extends SecuritySettingsServiceStub .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable createSecuritySettingsCallable; private final UnaryCallable @@ -117,6 +118,8 @@ public class GrpcSecuritySettingsServiceStub extends SecuritySettingsServiceStub listSecuritySettingsPagedCallable; private final UnaryCallable deleteSecuritySettingsCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcSecuritySettingsServiceStub create( @@ -136,28 +139,19 @@ public static final GrpcSecuritySettingsServiceStub create( SecuritySettingsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcSecuritySettingsServiceStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcSecuritySettingsServiceStub( SecuritySettingsServiceStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSecuritySettingsServiceCallableFactory()); } - /** - * Constructs an instance of GrpcSecuritySettingsServiceStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcSecuritySettingsServiceStub( SecuritySettingsServiceStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings createSecuritySettingsTransportSettings = @@ -262,7 +256,12 @@ public Map extract(DeleteSecuritySettingsRequest request) { settings.deleteSecuritySettingsSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable @@ -279,16 +278,16 @@ public UnaryCallable getSecuritySe return updateSecuritySettingsCallable; } - public UnaryCallable - listSecuritySettingsPagedCallable() { - return listSecuritySettingsPagedCallable; - } - public UnaryCallable listSecuritySettingsCallable() { return listSecuritySettingsCallable; } + public UnaryCallable + listSecuritySettingsPagedCallable() { + return listSecuritySettingsPagedCallable; + } + public UnaryCallable deleteSecuritySettingsCallable() { return deleteSecuritySettingsCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesCallableFactory.java index 5c3059130..2f6260246 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the SessionEntityTypes service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcSessionEntityTypesCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java index 51b28194b..a8535750e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.SessionEntityType; import com.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the SessionEntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { - private static final MethodDescriptor< ListSessionEntityTypesRequest, ListSessionEntityTypesResponse> listSessionEntityTypesMethodDescriptor = @@ -64,6 +63,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { .setResponseMarshaller( ProtoUtils.marshaller(ListSessionEntityTypesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -74,6 +74,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { ProtoUtils.marshaller(GetSessionEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor createSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -84,6 +85,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { ProtoUtils.marshaller(CreateSessionEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor updateSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -94,6 +96,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { ProtoUtils.marshaller(UpdateSessionEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -105,8 +108,6 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listSessionEntityTypesCallable; private final UnaryCallable @@ -120,6 +121,8 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { private final UnaryCallable deleteSessionEntityTypeCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcSessionEntityTypesStub create(SessionEntityTypesStubSettings settings) @@ -139,27 +142,18 @@ public static final GrpcSessionEntityTypesStub create( SessionEntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionEntityTypesCallableFactory()); } - /** - * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listSessionEntityTypesTransportSettings = @@ -266,12 +260,12 @@ public Map extract(DeleteSessionEntityTypeRequest request) { settings.deleteSessionEntityTypeSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable - listSessionEntityTypesPagedCallable() { - return listSessionEntityTypesPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable @@ -279,6 +273,11 @@ public Map extract(DeleteSessionEntityTypeRequest request) { return listSessionEntityTypesCallable; } + public UnaryCallable + listSessionEntityTypesPagedCallable() { + return listSessionEntityTypesPagedCallable; + } + public UnaryCallable getSessionEntityTypeCallable() { return getSessionEntityTypeCallable; diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsCallableFactory.java index 186d37f1d..8d62a7f92 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Sessions service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcSessionsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java index ca6187c94..14527090a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest; import com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -40,16 +41,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Sessions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcSessionsStub extends SessionsStub { - private static final MethodDescriptor detectIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -59,6 +58,7 @@ public class GrpcSessionsStub extends SessionsStub { .setResponseMarshaller( ProtoUtils.marshaller(DetectIntentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor streamingDetectIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -69,6 +69,7 @@ public class GrpcSessionsStub extends SessionsStub { .setResponseMarshaller( ProtoUtils.marshaller(StreamingDetectIntentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor matchIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -78,6 +79,7 @@ public class GrpcSessionsStub extends SessionsStub { .setResponseMarshaller( ProtoUtils.marshaller(MatchIntentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor fulfillIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -89,14 +91,14 @@ public class GrpcSessionsStub extends SessionsStub { ProtoUtils.marshaller(FulfillIntentResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable detectIntentCallable; private final BidiStreamingCallable streamingDetectIntentCallable; private final UnaryCallable matchIntentCallable; private final UnaryCallable fulfillIntentCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcSessionsStub create(SessionsStubSettings settings) throws IOException { @@ -113,25 +115,18 @@ public static final GrpcSessionsStub create( SessionsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcSessionsStub(SessionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionsCallableFactory()); } - /** - * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcSessionsStub( SessionsStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings detectIntentTransportSettings = GrpcCallSettings.newBuilder() @@ -196,7 +191,12 @@ public Map extract(FulfillIntentRequest request) { callableFactory.createUnaryCallable( fulfillIntentTransportSettings, settings.fulfillIntentSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable detectIntentCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsCallableFactory.java index b2e2a710e..65c8f7e60 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the TransitionRouteGroups service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcTransitionRouteGroupsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java index e5029fd8b..ed5c22720 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup; import com.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the TransitionRouteGroups service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { - private static final MethodDescriptor< ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse> listTransitionRouteGroupsMethodDescriptor = @@ -64,6 +63,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListTransitionRouteGroupsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -75,6 +75,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) .build(); + private static final MethodDescriptor createTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -86,6 +87,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) .build(); + private static final MethodDescriptor updateTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -97,6 +99,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -108,8 +111,6 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listTransitionRouteGroupsCallable; private final UnaryCallable< @@ -124,6 +125,8 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { private final UnaryCallable deleteTransitionRouteGroupCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcTransitionRouteGroupsStub create( @@ -143,27 +146,18 @@ public static final GrpcTransitionRouteGroupsStub create( TransitionRouteGroupsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcTransitionRouteGroupsCallableFactory()); } - /** - * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listTransitionRouteGroupsTransportSettings = @@ -273,12 +267,12 @@ public Map extract( settings.deleteTransitionRouteGroupSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable - listTransitionRouteGroupsPagedCallable() { - return listTransitionRouteGroupsPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable @@ -286,6 +280,11 @@ public Map extract( return listTransitionRouteGroupsCallable; } + public UnaryCallable + listTransitionRouteGroupsPagedCallable() { + return listTransitionRouteGroupsPagedCallable; + } + public UnaryCallable getTransitionRouteGroupCallable() { return getTransitionRouteGroupCallable; diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsCallableFactory.java index 7b7ac0241..2f208608d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Versions service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcVersionsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java index c0463720a..3b781baec 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.VersionsClient.ListVersionsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -47,16 +47,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Versions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcVersionsStub extends VersionsStub { - private static final MethodDescriptor listVersionsMethodDescriptor = MethodDescriptor.newBuilder() @@ -66,6 +64,7 @@ public class GrpcVersionsStub extends VersionsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListVersionsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -73,6 +72,7 @@ public class GrpcVersionsStub extends VersionsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) .build(); + private static final MethodDescriptor createVersionMethodDescriptor = MethodDescriptor.newBuilder() @@ -82,6 +82,7 @@ public class GrpcVersionsStub extends VersionsStub { ProtoUtils.marshaller(CreateVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor updateVersionMethodDescriptor = MethodDescriptor.newBuilder() @@ -91,6 +92,7 @@ public class GrpcVersionsStub extends VersionsStub { ProtoUtils.marshaller(UpdateVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -98,6 +100,7 @@ public class GrpcVersionsStub extends VersionsStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor loadVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -106,9 +109,6 @@ public class GrpcVersionsStub extends VersionsStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable listVersionsCallable; private final UnaryCallable listVersionsPagedCallable; @@ -121,6 +121,8 @@ public class GrpcVersionsStub extends VersionsStub { private final UnaryCallable loadVersionCallable; private final OperationCallable loadVersionOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcVersionsStub create(VersionsStubSettings settings) throws IOException { @@ -137,19 +139,11 @@ public static final GrpcVersionsStub create( VersionsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcVersionsStub(VersionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcVersionsCallableFactory()); } - /** - * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcVersionsStub( VersionsStubSettings settings, ClientContext clientContext, @@ -254,7 +248,7 @@ public Map extract(LoadVersionRequest request) { createVersionTransportSettings, settings.createVersionOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.updateVersionCallable = callableFactory.createUnaryCallable( updateVersionTransportSettings, settings.updateVersionSettings(), clientContext); @@ -269,38 +263,37 @@ public Map extract(LoadVersionRequest request) { loadVersionTransportSettings, settings.loadVersionOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable listVersionsPagedCallable() { - return listVersionsPagedCallable; - } - public UnaryCallable listVersionsCallable() { return listVersionsCallable; } + public UnaryCallable listVersionsPagedCallable() { + return listVersionsPagedCallable; + } + public UnaryCallable getVersionCallable() { return getVersionCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable createVersionCallable() { + return createVersionCallable; + } + public OperationCallable createVersionOperationCallable() { return createVersionOperationCallable; } - public UnaryCallable createVersionCallable() { - return createVersionCallable; - } - public UnaryCallable updateVersionCallable() { return updateVersionCallable; } @@ -309,15 +302,14 @@ public UnaryCallable deleteVersionCallable() { return deleteVersionCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable loadVersionOperationCallable() { - return loadVersionOperationCallable; - } - public UnaryCallable loadVersionCallable() { return loadVersionCallable; } + public OperationCallable loadVersionOperationCallable() { + return loadVersionOperationCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksCallableFactory.java index 6739bf802..c1e205a13 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Webhooks service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcWebhooksCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java index f5cccddb2..a2ef507b3 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.WebhooksClient.ListWebhooksPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest; import com.google.cloud.dialogflow.cx.v3.Webhook; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Webhooks service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcWebhooksStub extends WebhooksStub { - private static final MethodDescriptor listWebhooksMethodDescriptor = MethodDescriptor.newBuilder() @@ -60,6 +59,7 @@ public class GrpcWebhooksStub extends WebhooksStub { .setResponseMarshaller( ProtoUtils.marshaller(ListWebhooksResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getWebhookMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -67,6 +67,7 @@ public class GrpcWebhooksStub extends WebhooksStub { .setRequestMarshaller(ProtoUtils.marshaller(GetWebhookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) .build(); + private static final MethodDescriptor createWebhookMethodDescriptor = MethodDescriptor.newBuilder() @@ -76,6 +77,7 @@ public class GrpcWebhooksStub extends WebhooksStub { ProtoUtils.marshaller(CreateWebhookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) .build(); + private static final MethodDescriptor updateWebhookMethodDescriptor = MethodDescriptor.newBuilder() @@ -85,6 +87,7 @@ public class GrpcWebhooksStub extends WebhooksStub { ProtoUtils.marshaller(UpdateWebhookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteWebhookMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -93,8 +96,6 @@ public class GrpcWebhooksStub extends WebhooksStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listWebhooksCallable; private final UnaryCallable listWebhooksPagedCallable; @@ -103,6 +104,8 @@ public class GrpcWebhooksStub extends WebhooksStub { private final UnaryCallable updateWebhookCallable; private final UnaryCallable deleteWebhookCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcWebhooksStub create(WebhooksStubSettings settings) throws IOException { @@ -119,25 +122,18 @@ public static final GrpcWebhooksStub create( WebhooksStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcWebhooksStub(WebhooksStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcWebhooksCallableFactory()); } - /** - * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcWebhooksStub( WebhooksStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listWebhooksTransportSettings = GrpcCallSettings.newBuilder() @@ -224,17 +220,22 @@ public Map extract(DeleteWebhookRequest request) { callableFactory.createUnaryCallable( deleteWebhookTransportSettings, settings.deleteWebhookSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable listWebhooksPagedCallable() { - return listWebhooksPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listWebhooksCallable() { return listWebhooksCallable; } + public UnaryCallable listWebhooksPagedCallable() { + return listWebhooksPagedCallable; + } + public UnaryCallable getWebhookCallable() { return getWebhookCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStub.java index 500c7ec0f..b4b5736a0 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.IntentsClient.ListIntentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.CreateIntentRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Intents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class IntentsStub implements BackgroundResource { public UnaryCallable listIntentsPagedCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java index 9bb240af0..5bc773043 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.IntentsClient.ListIntentsPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link IntentsStub}. * @@ -73,21 +75,22 @@ * *

For example, to set the total timeout of getIntent to 30 seconds: * - *

- * 
- * IntentsStubSettings.Builder intentsSettingsBuilder =
- *     IntentsStubSettings.newBuilder();
+ * 
{@code
+ * IntentsStubSettings.Builder intentsSettingsBuilder = IntentsStubSettings.newBuilder();
  * intentsSettingsBuilder
  *     .getIntentSettings()
  *     .setRetrySettings(
- *         intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ *         intentsSettingsBuilder
+ *             .getIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * IntentsStubSettings intentsSettings = intentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class IntentsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -103,6 +106,59 @@ public class IntentsStubSettings extends StubSettings { private final UnaryCallSettings updateIntentSettings; private final UnaryCallSettings deleteIntentSettings; + private static final PagedListDescriptor + LIST_INTENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListIntentsRequest injectToken(ListIntentsRequest payload, String token) { + return ListIntentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListIntentsRequest injectPageSize(ListIntentsRequest payload, int pageSize) { + return ListIntentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListIntentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListIntentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListIntentsResponse payload) { + return Objects.isNull(payload.getIntentsList()) + ? ImmutableList.of() + : payload.getIntentsList(); + } + }; + + private static final PagedListResponseFactory< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> + LIST_INTENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListIntentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INTENTS_PAGE_STR_DESC, request, context); + return ListIntentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listIntents. */ public PagedCallSettings listIntentsSettings() { @@ -135,10 +191,10 @@ public IntentsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcIntentsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -204,63 +260,9 @@ protected IntentsStubSettings(Builder settingsBuilder) throws IOException { deleteIntentSettings = settingsBuilder.deleteIntentSettings().build(); } - private static final PagedListDescriptor - LIST_INTENTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListIntentsRequest injectToken(ListIntentsRequest payload, String token) { - return ListIntentsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListIntentsRequest injectPageSize(ListIntentsRequest payload, int pageSize) { - return ListIntentsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListIntentsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListIntentsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListIntentsResponse payload) { - return payload.getIntentsList() != null - ? payload.getIntentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> - LIST_INTENTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListIntentsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_INTENTS_PAGE_STR_DESC, request, context); - return ListIntentsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for IntentsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> listIntentsSettings; @@ -268,7 +270,6 @@ public static class Builder extends StubSettings.Builder createIntentSettings; private final UnaryCallSettings.Builder updateIntentSettings; private final UnaryCallSettings.Builder deleteIntentSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -276,14 +277,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -302,46 +297,21 @@ public static class Builder extends StubSettings.Builder>of( + listIntentsSettings, + getIntentSettings, + createIntentSettings, + updateIntentSettings, + deleteIntentSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listIntentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(IntentsStubSettings settings) { - super(settings); - - listIntentsSettings = settings.listIntentsSettings.toBuilder(); - getIntentSettings = settings.getIntentSettings.toBuilder(); - createIntentSettings = settings.createIntentSettings.toBuilder(); - updateIntentSettings = settings.updateIntentSettings.toBuilder(); - deleteIntentSettings = settings.deleteIntentSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listIntentsSettings, - getIntentSettings, - createIntentSettings, - updateIntentSettings, - deleteIntentSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStub.java index dadd64b0a..11e82584b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.PagesClient.ListPagesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.CreatePageRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Pages service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class PagesStub implements BackgroundResource { public UnaryCallable listPagesPagedCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java index 8a6dad8e8..94c042157 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.PagesClient.ListPagesPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link PagesStub}. * @@ -73,21 +75,22 @@ * *

For example, to set the total timeout of getPage to 30 seconds: * - *

- * 
- * PagesStubSettings.Builder pagesSettingsBuilder =
- *     PagesStubSettings.newBuilder();
+ * 
{@code
+ * PagesStubSettings.Builder pagesSettingsBuilder = PagesStubSettings.newBuilder();
  * pagesSettingsBuilder
  *     .getPageSettings()
  *     .setRetrySettings(
- *         pagesSettingsBuilder.getPageSettings().getRetrySettings().toBuilder()
+ *         pagesSettingsBuilder
+ *             .getPageSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PagesStubSettings pagesSettings = pagesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class PagesStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -103,6 +106,59 @@ public class PagesStubSettings extends StubSettings { private final UnaryCallSettings updatePageSettings; private final UnaryCallSettings deletePageSettings; + private static final PagedListDescriptor + LIST_PAGES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPagesRequest injectToken(ListPagesRequest payload, String token) { + return ListPagesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPagesRequest injectPageSize(ListPagesRequest payload, int pageSize) { + return ListPagesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPagesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPagesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPagesResponse payload) { + return Objects.isNull(payload.getPagesList()) + ? ImmutableList.of() + : payload.getPagesList(); + } + }; + + private static final PagedListResponseFactory< + ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> + LIST_PAGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPagesRequest, ListPagesResponse, ListPagesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPagesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PAGES_PAGE_STR_DESC, request, context); + return ListPagesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listPages. */ public PagedCallSettings listPagesSettings() { @@ -135,10 +191,10 @@ public PagesStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcPagesStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -204,63 +260,9 @@ protected PagesStubSettings(Builder settingsBuilder) throws IOException { deletePageSettings = settingsBuilder.deletePageSettings().build(); } - private static final PagedListDescriptor - LIST_PAGES_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListPagesRequest injectToken(ListPagesRequest payload, String token) { - return ListPagesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListPagesRequest injectPageSize(ListPagesRequest payload, int pageSize) { - return ListPagesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListPagesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListPagesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListPagesResponse payload) { - return payload.getPagesList() != null - ? payload.getPagesList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> - LIST_PAGES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListPagesRequest, ListPagesResponse, ListPagesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListPagesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_PAGES_PAGE_STR_DESC, request, context); - return ListPagesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for PagesStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> listPagesSettings; @@ -268,7 +270,6 @@ public static class Builder extends StubSettings.Builder createPageSettings; private final UnaryCallSettings.Builder updatePageSettings; private final UnaryCallSettings.Builder deletePageSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -276,14 +277,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -302,46 +297,21 @@ public static class Builder extends StubSettings.Builder>of( + listPagesSettings, + getPageSettings, + createPageSettings, + updatePageSettings, + deletePageSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listPagesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getPageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createPageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updatePageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deletePageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(PagesStubSettings settings) { - super(settings); - - listPagesSettings = settings.listPagesSettings.toBuilder(); - getPageSettings = settings.getPageSettings.toBuilder(); - createPageSettings = settings.createPageSettings.toBuilder(); - updatePageSettings = settings.updatePageSettings.toBuilder(); - deletePageSettings = settings.deletePageSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listPagesSettings, - getPageSettings, - createPageSettings, - updatePageSettings, - deletePageSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStub.java index 1e92511cc..b49dfd4c8 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.SecuritySettingsServiceClient.ListSecuritySettingsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the SecuritySettingsService service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SecuritySettingsServiceStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java index b39f1f704..400351705 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.SecuritySettingsServiceClient.ListSecuritySettingsPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SecuritySettingsServiceStub}. * @@ -73,21 +75,24 @@ * *

For example, to set the total timeout of createSecuritySettings to 30 seconds: * - *

- * 
+ * 
{@code
  * SecuritySettingsServiceStubSettings.Builder securitySettingsServiceSettingsBuilder =
  *     SecuritySettingsServiceStubSettings.newBuilder();
  * securitySettingsServiceSettingsBuilder
  *     .createSecuritySettingsSettings()
  *     .setRetrySettings(
- *         securitySettingsServiceSettingsBuilder.createSecuritySettingsSettings().getRetrySettings().toBuilder()
+ *         securitySettingsServiceSettingsBuilder
+ *             .createSecuritySettingsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * SecuritySettingsServiceStubSettings securitySettingsServiceSettings = securitySettingsServiceSettingsBuilder.build();
- * 
- * 
+ * SecuritySettingsServiceStubSettings securitySettingsServiceSettings = + * securitySettingsServiceSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class SecuritySettingsServiceStubSettings extends StubSettings { /** The default scopes of the service. */ @@ -111,6 +116,71 @@ public class SecuritySettingsServiceStubSettings private final UnaryCallSettings deleteSecuritySettingsSettings; + private static final PagedListDescriptor< + ListSecuritySettingsRequest, ListSecuritySettingsResponse, SecuritySettings> + LIST_SECURITY_SETTINGS_PAGE_STR_DESC = + new PagedListDescriptor< + ListSecuritySettingsRequest, ListSecuritySettingsResponse, SecuritySettings>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSecuritySettingsRequest injectToken( + ListSecuritySettingsRequest payload, String token) { + return ListSecuritySettingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSecuritySettingsRequest injectPageSize( + ListSecuritySettingsRequest payload, int pageSize) { + return ListSecuritySettingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListSecuritySettingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSecuritySettingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListSecuritySettingsResponse payload) { + return Objects.isNull(payload.getSecuritySettingsList()) + ? ImmutableList.of() + : payload.getSecuritySettingsList(); + } + }; + + private static final PagedListResponseFactory< + ListSecuritySettingsRequest, + ListSecuritySettingsResponse, + ListSecuritySettingsPagedResponse> + LIST_SECURITY_SETTINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSecuritySettingsRequest, + ListSecuritySettingsResponse, + ListSecuritySettingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListSecuritySettingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListSecuritySettingsRequest, ListSecuritySettingsResponse, SecuritySettings> + pageContext = + PageContext.create( + callable, LIST_SECURITY_SETTINGS_PAGE_STR_DESC, request, context); + return ListSecuritySettingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createSecuritySettings. */ public UnaryCallSettings createSecuritySettingsSettings() { @@ -149,10 +219,10 @@ public SecuritySettingsServiceStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcSecuritySettingsServiceStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -219,76 +289,10 @@ protected SecuritySettingsServiceStubSettings(Builder settingsBuilder) throws IO deleteSecuritySettingsSettings = settingsBuilder.deleteSecuritySettingsSettings().build(); } - private static final PagedListDescriptor< - ListSecuritySettingsRequest, ListSecuritySettingsResponse, SecuritySettings> - LIST_SECURITY_SETTINGS_PAGE_STR_DESC = - new PagedListDescriptor< - ListSecuritySettingsRequest, ListSecuritySettingsResponse, SecuritySettings>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSecuritySettingsRequest injectToken( - ListSecuritySettingsRequest payload, String token) { - return ListSecuritySettingsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSecuritySettingsRequest injectPageSize( - ListSecuritySettingsRequest payload, int pageSize) { - return ListSecuritySettingsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListSecuritySettingsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSecuritySettingsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - ListSecuritySettingsResponse payload) { - return payload.getSecuritySettingsList() != null - ? payload.getSecuritySettingsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListSecuritySettingsRequest, - ListSecuritySettingsResponse, - ListSecuritySettingsPagedResponse> - LIST_SECURITY_SETTINGS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSecuritySettingsRequest, - ListSecuritySettingsResponse, - ListSecuritySettingsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListSecuritySettingsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - ListSecuritySettingsRequest, ListSecuritySettingsResponse, SecuritySettings> - pageContext = - PageContext.create( - callable, LIST_SECURITY_SETTINGS_PAGE_STR_DESC, request, context); - return ListSecuritySettingsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for SecuritySettingsServiceStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createSecuritySettingsSettings; private final UnaryCallSettings.Builder @@ -302,7 +306,6 @@ public static class Builder listSecuritySettingsSettings; private final UnaryCallSettings.Builder deleteSecuritySettingsSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -310,14 +313,8 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -336,47 +333,22 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_1_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("retry_policy_2_params", settings); - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("no_retry_1_params", settings); + definitions.put("retry_policy_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(clientContext); createSecuritySettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - getSecuritySettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateSecuritySettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - listSecuritySettingsSettings = PagedCallSettings.newBuilder(LIST_SECURITY_SETTINGS_PAGE_STR_FACT); - deleteSecuritySettingsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = @@ -386,68 +358,68 @@ protected Builder(ClientContext clientContext) { updateSecuritySettingsSettings, listSecuritySettingsSettings, deleteSecuritySettingsSettings); - initDefaults(this); } + protected Builder(SecuritySettingsServiceStubSettings settings) { + super(settings); + + createSecuritySettingsSettings = settings.createSecuritySettingsSettings.toBuilder(); + getSecuritySettingsSettings = settings.getSecuritySettingsSettings.toBuilder(); + updateSecuritySettingsSettings = settings.updateSecuritySettingsSettings.toBuilder(); + listSecuritySettingsSettings = settings.listSecuritySettingsSettings.toBuilder(); + deleteSecuritySettingsSettings = settings.deleteSecuritySettingsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSecuritySettingsSettings, + getSecuritySettingsSettings, + updateSecuritySettingsSettings, + listSecuritySettingsSettings, + deleteSecuritySettingsSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .createSecuritySettingsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getSecuritySettingsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateSecuritySettingsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .listSecuritySettingsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteSecuritySettingsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(SecuritySettingsServiceStubSettings settings) { - super(settings); - - createSecuritySettingsSettings = settings.createSecuritySettingsSettings.toBuilder(); - getSecuritySettingsSettings = settings.getSecuritySettingsSettings.toBuilder(); - updateSecuritySettingsSettings = settings.updateSecuritySettingsSettings.toBuilder(); - listSecuritySettingsSettings = settings.listSecuritySettingsSettings.toBuilder(); - deleteSecuritySettingsSettings = settings.deleteSecuritySettingsSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createSecuritySettingsSettings, - getSecuritySettingsSettings, - updateSecuritySettingsSettings, - listSecuritySettingsSettings, - deleteSecuritySettingsSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStub.java index e4b13241d..4b688c7f0 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the SessionEntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SessionEntityTypesStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java index c8d9c853c..1a8657bfc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionEntityTypesStub}. * @@ -73,21 +75,24 @@ * *

For example, to set the total timeout of getSessionEntityType to 30 seconds: * - *

- * 
+ * 
{@code
  * SessionEntityTypesStubSettings.Builder sessionEntityTypesSettingsBuilder =
  *     SessionEntityTypesStubSettings.newBuilder();
  * sessionEntityTypesSettingsBuilder
  *     .getSessionEntityTypeSettings()
  *     .setRetrySettings(
- *         sessionEntityTypesSettingsBuilder.getSessionEntityTypeSettings().getRetrySettings().toBuilder()
+ *         sessionEntityTypesSettingsBuilder
+ *             .getSessionEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * SessionEntityTypesStubSettings sessionEntityTypesSettings = sessionEntityTypesSettingsBuilder.build();
- * 
- * 
+ * SessionEntityTypesStubSettings sessionEntityTypesSettings = + * sessionEntityTypesSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class SessionEntityTypesStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -110,6 +115,76 @@ public class SessionEntityTypesStubSettings extends StubSettings deleteSessionEntityTypeSettings; + private static final PagedListDescriptor< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> + LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionEntityTypesRequest injectToken( + ListSessionEntityTypesRequest payload, String token) { + return ListSessionEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionEntityTypesRequest injectPageSize( + ListSessionEntityTypesRequest payload, int pageSize) { + return ListSessionEntityTypesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListSessionEntityTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionEntityTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListSessionEntityTypesResponse payload) { + return Objects.isNull(payload.getSessionEntityTypesList()) + ? ImmutableList.of() + : payload.getSessionEntityTypesList(); + } + }; + + private static final PagedListResponseFactory< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListSessionEntityTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + SessionEntityType> + pageContext = + PageContext.create( + callable, LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC, request, context); + return ListSessionEntityTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listSessionEntityTypes. */ public PagedCallSettings< ListSessionEntityTypesRequest, @@ -149,10 +224,10 @@ public SessionEntityTypesStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcSessionEntityTypesStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -219,81 +294,10 @@ protected SessionEntityTypesStubSettings(Builder settingsBuilder) throws IOExcep deleteSessionEntityTypeSettings = settingsBuilder.deleteSessionEntityTypeSettings().build(); } - private static final PagedListDescriptor< - ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> - LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC = - new PagedListDescriptor< - ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSessionEntityTypesRequest injectToken( - ListSessionEntityTypesRequest payload, String token) { - return ListSessionEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSessionEntityTypesRequest injectPageSize( - ListSessionEntityTypesRequest payload, int pageSize) { - return ListSessionEntityTypesRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(ListSessionEntityTypesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSessionEntityTypesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - ListSessionEntityTypesResponse payload) { - return payload.getSessionEntityTypesList() != null - ? payload.getSessionEntityTypesList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListSessionEntityTypesRequest, - ListSessionEntityTypesResponse, - ListSessionEntityTypesPagedResponse> - LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSessionEntityTypesRequest, - ListSessionEntityTypesResponse, - ListSessionEntityTypesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - ListSessionEntityTypesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - ListSessionEntityTypesRequest, - ListSessionEntityTypesResponse, - SessionEntityType> - pageContext = - PageContext.create( - callable, LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC, request, context); - return ListSessionEntityTypesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for SessionEntityTypesStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, @@ -307,7 +311,6 @@ public static class Builder updateSessionEntityTypeSettings; private final UnaryCallSettings.Builder deleteSessionEntityTypeSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -315,14 +318,8 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -341,33 +338,12 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_1_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("retry_policy_2_params", settings); - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("no_retry_1_params", settings); + definitions.put("retry_policy_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { @@ -375,13 +351,9 @@ protected Builder(ClientContext clientContext) { listSessionEntityTypesSettings = PagedCallSettings.newBuilder(LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT); - getSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = @@ -391,68 +363,68 @@ protected Builder(ClientContext clientContext) { createSessionEntityTypeSettings, updateSessionEntityTypeSettings, deleteSessionEntityTypeSettings); - initDefaults(this); } + protected Builder(SessionEntityTypesStubSettings settings) { + super(settings); + + listSessionEntityTypesSettings = settings.listSessionEntityTypesSettings.toBuilder(); + getSessionEntityTypeSettings = settings.getSessionEntityTypeSettings.toBuilder(); + createSessionEntityTypeSettings = settings.createSessionEntityTypeSettings.toBuilder(); + updateSessionEntityTypeSettings = settings.updateSessionEntityTypeSettings.toBuilder(); + deleteSessionEntityTypeSettings = settings.deleteSessionEntityTypeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listSessionEntityTypesSettings, + getSessionEntityTypeSettings, + createSessionEntityTypeSettings, + updateSessionEntityTypeSettings, + deleteSessionEntityTypeSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listSessionEntityTypesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(SessionEntityTypesStubSettings settings) { - super(settings); - - listSessionEntityTypesSettings = settings.listSessionEntityTypesSettings.toBuilder(); - getSessionEntityTypeSettings = settings.getSessionEntityTypeSettings.toBuilder(); - createSessionEntityTypeSettings = settings.createSessionEntityTypeSettings.toBuilder(); - updateSessionEntityTypeSettings = settings.updateSessionEntityTypeSettings.toBuilder(); - deleteSessionEntityTypeSettings = settings.deleteSessionEntityTypeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listSessionEntityTypesSettings, - getSessionEntityTypeSettings, - createSessionEntityTypeSettings, - updateSessionEntityTypeSettings, - deleteSessionEntityTypeSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStub.java index 6d406284f..36802f5be 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -29,14 +29,13 @@ import com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Sessions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SessionsStub implements BackgroundResource { public UnaryCallable detectIntentCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStubSettings.java index 7da137a92..915b4013e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import com.google.api.core.ApiFunction; @@ -48,7 +49,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionsStub}. * @@ -65,21 +66,22 @@ * *

For example, to set the total timeout of detectIntent to 30 seconds: * - *

- * 
- * SessionsStubSettings.Builder sessionsSettingsBuilder =
- *     SessionsStubSettings.newBuilder();
+ * 
{@code
+ * SessionsStubSettings.Builder sessionsSettingsBuilder = SessionsStubSettings.newBuilder();
  * sessionsSettingsBuilder
  *     .detectIntentSettings()
  *     .setRetrySettings(
- *         sessionsSettingsBuilder.detectIntentSettings().getRetrySettings().toBuilder()
+ *         sessionsSettingsBuilder
+ *             .detectIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * SessionsStubSettings sessionsSettings = sessionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class SessionsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -122,10 +124,10 @@ public SessionsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcSessionsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -193,7 +195,6 @@ protected SessionsStubSettings(Builder settingsBuilder) throws IOException { /** Builder for SessionsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder detectIntentSettings; private final StreamingCallSettings.Builder< @@ -203,7 +204,6 @@ public static class Builder extends StubSettings.Builder fulfillIntentSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -213,12 +213,11 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -232,101 +231,96 @@ public static class Builder extends StubSettings.Builder>of( detectIntentSettings, matchIntentSettings, fulfillIntentSettings); - initDefaults(this); } + protected Builder(SessionsStubSettings settings) { + super(settings); + + detectIntentSettings = settings.detectIntentSettings.toBuilder(); + streamingDetectIntentSettings = settings.streamingDetectIntentSettings.toBuilder(); + matchIntentSettings = settings.matchIntentSettings.toBuilder(); + fulfillIntentSettings = settings.fulfillIntentSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + detectIntentSettings, matchIntentSettings, fulfillIntentSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .detectIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .matchIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .fulfillIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(SessionsStubSettings settings) { - super(settings); - - detectIntentSettings = settings.detectIntentSettings.toBuilder(); - streamingDetectIntentSettings = settings.streamingDetectIntentSettings.toBuilder(); - matchIntentSettings = settings.matchIntentSettings.toBuilder(); - fulfillIntentSettings = settings.fulfillIntentSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - detectIntentSettings, matchIntentSettings, fulfillIntentSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStub.java index b6d94ed2c..ecb70c747 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the TransitionRouteGroups service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TransitionRouteGroupsStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java index c097f3280..6efad2f46 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link TransitionRouteGroupsStub}. * @@ -73,21 +75,24 @@ * *

For example, to set the total timeout of getTransitionRouteGroup to 30 seconds: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsStubSettings.Builder transitionRouteGroupsSettingsBuilder =
  *     TransitionRouteGroupsStubSettings.newBuilder();
  * transitionRouteGroupsSettingsBuilder
  *     .getTransitionRouteGroupSettings()
  *     .setRetrySettings(
- *         transitionRouteGroupsSettingsBuilder.getTransitionRouteGroupSettings().getRetrySettings().toBuilder()
+ *         transitionRouteGroupsSettingsBuilder
+ *             .getTransitionRouteGroupSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * TransitionRouteGroupsStubSettings transitionRouteGroupsSettings = transitionRouteGroupsSettingsBuilder.build();
- * 
- * 
+ * TransitionRouteGroupsStubSettings transitionRouteGroupsSettings = + * transitionRouteGroupsSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class TransitionRouteGroupsStubSettings extends StubSettings { /** The default scopes of the service. */ @@ -111,6 +116,81 @@ public class TransitionRouteGroupsStubSettings private final UnaryCallSettings deleteTransitionRouteGroupSettings; + private static final PagedListDescriptor< + ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse, TransitionRouteGroup> + LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTransitionRouteGroupsRequest injectToken( + ListTransitionRouteGroupsRequest payload, String token) { + return ListTransitionRouteGroupsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListTransitionRouteGroupsRequest injectPageSize( + ListTransitionRouteGroupsRequest payload, int pageSize) { + return ListTransitionRouteGroupsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListTransitionRouteGroupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTransitionRouteGroupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListTransitionRouteGroupsResponse payload) { + return Objects.isNull(payload.getTransitionRouteGroupsList()) + ? ImmutableList.of() + : payload.getTransitionRouteGroupsList(); + } + }; + + private static final PagedListResponseFactory< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListTransitionRouteGroupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup> + pageContext = + PageContext.create( + callable, LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC, request, context); + return ListTransitionRouteGroupsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listTransitionRouteGroups. */ public PagedCallSettings< ListTransitionRouteGroupsRequest, @@ -150,10 +230,10 @@ public TransitionRouteGroupsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcTransitionRouteGroupsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -223,86 +303,10 @@ protected TransitionRouteGroupsStubSettings(Builder settingsBuilder) throws IOEx settingsBuilder.deleteTransitionRouteGroupSettings().build(); } - private static final PagedListDescriptor< - ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse, TransitionRouteGroup> - LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC = - new PagedListDescriptor< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - TransitionRouteGroup>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListTransitionRouteGroupsRequest injectToken( - ListTransitionRouteGroupsRequest payload, String token) { - return ListTransitionRouteGroupsRequest.newBuilder(payload) - .setPageToken(token) - .build(); - } - - @Override - public ListTransitionRouteGroupsRequest injectPageSize( - ListTransitionRouteGroupsRequest payload, int pageSize) { - return ListTransitionRouteGroupsRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(ListTransitionRouteGroupsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListTransitionRouteGroupsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - ListTransitionRouteGroupsResponse payload) { - return payload.getTransitionRouteGroupsList() != null - ? payload.getTransitionRouteGroupsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - ListTransitionRouteGroupsPagedResponse> - LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - ListTransitionRouteGroupsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - ListTransitionRouteGroupsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - TransitionRouteGroup> - pageContext = - PageContext.create( - callable, LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC, request, context); - return ListTransitionRouteGroupsPagedResponse.createAsync( - pageContext, futureResponse); - } - }; - /** Builder for TransitionRouteGroupsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse, @@ -316,7 +320,6 @@ public static class Builder updateTransitionRouteGroupSettings; private final UnaryCallSettings.Builder deleteTransitionRouteGroupSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -324,14 +327,8 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -350,33 +347,12 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_1_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("retry_policy_2_params", settings); - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("no_retry_1_params", settings); + definitions.put("retry_policy_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { @@ -384,13 +360,9 @@ protected Builder(ClientContext clientContext) { listTransitionRouteGroupsSettings = PagedCallSettings.newBuilder(LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT); - getTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = @@ -400,68 +372,68 @@ protected Builder(ClientContext clientContext) { createTransitionRouteGroupSettings, updateTransitionRouteGroupSettings, deleteTransitionRouteGroupSettings); - initDefaults(this); } + protected Builder(TransitionRouteGroupsStubSettings settings) { + super(settings); + + listTransitionRouteGroupsSettings = settings.listTransitionRouteGroupsSettings.toBuilder(); + getTransitionRouteGroupSettings = settings.getTransitionRouteGroupSettings.toBuilder(); + createTransitionRouteGroupSettings = settings.createTransitionRouteGroupSettings.toBuilder(); + updateTransitionRouteGroupSettings = settings.updateTransitionRouteGroupSettings.toBuilder(); + deleteTransitionRouteGroupSettings = settings.deleteTransitionRouteGroupSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTransitionRouteGroupsSettings, + getTransitionRouteGroupSettings, + createTransitionRouteGroupSettings, + updateTransitionRouteGroupSettings, + deleteTransitionRouteGroupSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listTransitionRouteGroupsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(TransitionRouteGroupsStubSettings settings) { - super(settings); - - listTransitionRouteGroupsSettings = settings.listTransitionRouteGroupsSettings.toBuilder(); - getTransitionRouteGroupSettings = settings.getTransitionRouteGroupSettings.toBuilder(); - createTransitionRouteGroupSettings = settings.createTransitionRouteGroupSettings.toBuilder(); - updateTransitionRouteGroupSettings = settings.updateTransitionRouteGroupSettings.toBuilder(); - deleteTransitionRouteGroupSettings = settings.deleteTransitionRouteGroupSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listTransitionRouteGroupsSettings, - getTransitionRouteGroupSettings, - createTransitionRouteGroupSettings, - updateTransitionRouteGroupSettings, - deleteTransitionRouteGroupSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStub.java index 697bbd4c1..005936a03 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.VersionsClient.ListVersionsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -36,17 +36,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Versions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class VersionsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -63,7 +61,6 @@ public UnaryCallable getVersionCallable() { throw new UnsupportedOperationException("Not implemented: getVersionCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createVersionOperationCallable() { throw new UnsupportedOperationException("Not implemented: createVersionOperationCallable()"); @@ -81,7 +78,6 @@ public UnaryCallable deleteVersionCallable() { throw new UnsupportedOperationException("Not implemented: deleteVersionCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable loadVersionOperationCallable() { throw new UnsupportedOperationException("Not implemented: loadVersionOperationCallable()"); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java index 0dd151b4b..dcbb15fda 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.VersionsClient.ListVersionsPagedResponse; @@ -61,10 +62,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link VersionsStub}. * @@ -81,21 +83,22 @@ * *

For example, to set the total timeout of getVersion to 30 seconds: * - *

- * 
- * VersionsStubSettings.Builder versionsSettingsBuilder =
- *     VersionsStubSettings.newBuilder();
+ * 
{@code
+ * VersionsStubSettings.Builder versionsSettingsBuilder = VersionsStubSettings.newBuilder();
  * versionsSettingsBuilder
  *     .getVersionSettings()
  *     .setRetrySettings(
- *         versionsSettingsBuilder.getVersionSettings().getRetrySettings().toBuilder()
+ *         versionsSettingsBuilder
+ *             .getVersionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * VersionsStubSettings versionsSettings = versionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class VersionsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -117,6 +120,59 @@ public class VersionsStubSettings extends StubSettings { private final OperationCallSettings loadVersionOperationSettings; + private static final PagedListDescriptor + LIST_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListVersionsRequest injectToken(ListVersionsRequest payload, String token) { + return ListVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListVersionsRequest injectPageSize(ListVersionsRequest payload, int pageSize) { + return ListVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListVersionsResponse payload) { + return Objects.isNull(payload.getVersionsList()) + ? ImmutableList.of() + : payload.getVersionsList(); + } + }; + + private static final PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + LIST_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VERSIONS_PAGE_STR_DESC, request, context); + return ListVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listVersions. */ public PagedCallSettings listVersionsSettings() { @@ -134,7 +190,6 @@ public UnaryCallSettings createVersionSettings( } /** Returns the object with the settings used for calls to createVersion. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings createVersionOperationSettings() { return createVersionOperationSettings; @@ -156,7 +211,6 @@ public UnaryCallSettings loadVersionSettings() { } /** Returns the object with the settings used for calls to loadVersion. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings loadVersionOperationSettings() { return loadVersionOperationSettings; } @@ -167,10 +221,10 @@ public VersionsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcVersionsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -239,63 +293,9 @@ protected VersionsStubSettings(Builder settingsBuilder) throws IOException { loadVersionOperationSettings = settingsBuilder.loadVersionOperationSettings().build(); } - private static final PagedListDescriptor - LIST_VERSIONS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListVersionsRequest injectToken(ListVersionsRequest payload, String token) { - return ListVersionsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListVersionsRequest injectPageSize(ListVersionsRequest payload, int pageSize) { - return ListVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListVersionsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListVersionsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListVersionsResponse payload) { - return payload.getVersionsList() != null - ? payload.getVersionsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> - LIST_VERSIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListVersionsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_VERSIONS_PAGE_STR_DESC, request, context); - return ListVersionsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for VersionsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> listVersionsSettings; @@ -309,7 +309,6 @@ public static class Builder extends StubSettings.Builder loadVersionSettings; private final OperationCallSettings.Builder loadVersionOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -317,14 +316,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -343,52 +336,24 @@ public static class Builder extends StubSettings.Builder>of( + listVersionsSettings, + getVersionSettings, + createVersionSettings, + updateVersionSettings, + deleteVersionSettings, + loadVersionSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listVersionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .loadVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createVersionOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Version.class)) @@ -459,20 +447,21 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .loadVersionOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -481,41 +470,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(VersionsStubSettings settings) { - super(settings); - - listVersionsSettings = settings.listVersionsSettings.toBuilder(); - getVersionSettings = settings.getVersionSettings.toBuilder(); - createVersionSettings = settings.createVersionSettings.toBuilder(); - createVersionOperationSettings = settings.createVersionOperationSettings.toBuilder(); - updateVersionSettings = settings.updateVersionSettings.toBuilder(); - deleteVersionSettings = settings.deleteVersionSettings.toBuilder(); - loadVersionSettings = settings.loadVersionSettings.toBuilder(); - loadVersionOperationSettings = settings.loadVersionOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listVersionsSettings, - getVersionSettings, - createVersionSettings, - updateVersionSettings, - deleteVersionSettings, - loadVersionSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStub.java index 9a3e4d06e..4cac7fe04 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.WebhooksClient.ListWebhooksPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Webhooks service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class WebhooksStub implements BackgroundResource { public UnaryCallable listWebhooksPagedCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java index 33730a96e..cfb726f2c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3.stub; import static com.google.cloud.dialogflow.cx.v3.WebhooksClient.ListWebhooksPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link WebhooksStub}. * @@ -73,21 +75,22 @@ * *

For example, to set the total timeout of getWebhook to 30 seconds: * - *

- * 
- * WebhooksStubSettings.Builder webhooksSettingsBuilder =
- *     WebhooksStubSettings.newBuilder();
+ * 
{@code
+ * WebhooksStubSettings.Builder webhooksSettingsBuilder = WebhooksStubSettings.newBuilder();
  * webhooksSettingsBuilder
  *     .getWebhookSettings()
  *     .setRetrySettings(
- *         webhooksSettingsBuilder.getWebhookSettings().getRetrySettings().toBuilder()
+ *         webhooksSettingsBuilder
+ *             .getWebhookSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * WebhooksStubSettings webhooksSettings = webhooksSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") +@BetaApi +@Generated("by gapic-generator-java") public class WebhooksStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -104,6 +107,59 @@ public class WebhooksStubSettings extends StubSettings { private final UnaryCallSettings updateWebhookSettings; private final UnaryCallSettings deleteWebhookSettings; + private static final PagedListDescriptor + LIST_WEBHOOKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWebhooksRequest injectToken(ListWebhooksRequest payload, String token) { + return ListWebhooksRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWebhooksRequest injectPageSize(ListWebhooksRequest payload, int pageSize) { + return ListWebhooksRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWebhooksRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWebhooksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWebhooksResponse payload) { + return Objects.isNull(payload.getWebhooksList()) + ? ImmutableList.of() + : payload.getWebhooksList(); + } + }; + + private static final PagedListResponseFactory< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> + LIST_WEBHOOKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWebhooksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WEBHOOKS_PAGE_STR_DESC, request, context); + return ListWebhooksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listWebhooks. */ public PagedCallSettings listWebhooksSettings() { @@ -136,10 +192,10 @@ public WebhooksStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcWebhooksStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -205,63 +261,9 @@ protected WebhooksStubSettings(Builder settingsBuilder) throws IOException { deleteWebhookSettings = settingsBuilder.deleteWebhookSettings().build(); } - private static final PagedListDescriptor - LIST_WEBHOOKS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListWebhooksRequest injectToken(ListWebhooksRequest payload, String token) { - return ListWebhooksRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListWebhooksRequest injectPageSize(ListWebhooksRequest payload, int pageSize) { - return ListWebhooksRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListWebhooksRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListWebhooksResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListWebhooksResponse payload) { - return payload.getWebhooksList() != null - ? payload.getWebhooksList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> - LIST_WEBHOOKS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListWebhooksRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_WEBHOOKS_PAGE_STR_DESC, request, context); - return ListWebhooksPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for WebhooksStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> listWebhooksSettings; @@ -269,7 +271,6 @@ public static class Builder extends StubSettings.Builder createWebhookSettings; private final UnaryCallSettings.Builder updateWebhookSettings; private final UnaryCallSettings.Builder deleteWebhookSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -277,14 +278,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -303,46 +298,21 @@ public static class Builder extends StubSettings.Builder>of( + listWebhooksSettings, + getWebhookSettings, + createWebhookSettings, + updateWebhookSettings, + deleteWebhookSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listWebhooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(WebhooksStubSettings settings) { - super(settings); - - listWebhooksSettings = settings.listWebhooksSettings.toBuilder(); - getWebhookSettings = settings.getWebhookSettings.toBuilder(); - createWebhookSettings = settings.createWebhookSettings.toBuilder(); - updateWebhookSettings = settings.updateWebhookSettings.toBuilder(); - deleteWebhookSettings = settings.deleteWebhookSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listWebhooksSettings, - getWebhookSettings, - createWebhookSettings, - updateWebhookSettings, - deleteWebhookSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java index fc0a047d1..fb9dfe06d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -37,26 +38,18 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Agent response = agentsClient.getAgent(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the agentsClient object to clean up resources such as + *

Note: close() needs to be called on the AgentsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -84,30 +77,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * AgentsSettings agentsSettings =
  *     AgentsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * AgentsClient agentsClient =
- *     AgentsClient.create(agentsSettings);
- * 
- * 
+ * AgentsClient agentsClient = AgentsClient.create(agentsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * AgentsSettings agentsSettings =
- *     AgentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * AgentsClient agentsClient =
- *     AgentsClient.create(agentsSettings);
- * 
- * 
+ *
{@code
+ * AgentsSettings agentsSettings = AgentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AgentsClient agentsClient = AgentsClient.create(agentsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class AgentsClient implements BackgroundResource { private final AgentsSettings settings; private final AgentsStub stub; @@ -128,7 +116,7 @@ public static final AgentsClient create(AgentsSettings settings) throws IOExcept /** * Constructs an instance of AgentsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use AgentsSettings}. + * advanced usage - prefer using create(AgentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final AgentsClient create(AgentsStub stub) { @@ -165,52 +153,30 @@ public AgentsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Agent element : agentsClient.listAgents(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The location to list all agents for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAgentsPagedResponse listAgents(LocationName parent) { ListAgentsRequest request = - ListAgentsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListAgentsRequest.newBuilder() + .setParent(Objects.isNull(parent) ? null : parent.toString()) + .build(); return listAgents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   for (Agent element : agentsClient.listAgents(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The location to list all agents for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -220,24 +186,10 @@ public final ListAgentsPagedResponse listAgents(String parent) { return listAgents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Agent element : agentsClient.listAgents(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -245,97 +197,44 @@ public final ListAgentsPagedResponse listAgents(ListAgentsRequest request) { return listAgentsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListAgentsPagedResponse> future = agentsClient.listAgentsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Agent element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listAgentsPagedCallable() { return stub.listAgentsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all agents in the specified location. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   ListAgentsRequest request = ListAgentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListAgentsResponse response = agentsClient.listAgentsCallable().call(request);
-   *     for (Agent element : response.getAgentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listAgentsCallable() { return stub.listAgentsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Agent response = agentsClient.getAgent(name);
-   * }
-   * 
- * * @param name Required. The name of the agent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Agent getAgent(AgentName name) { GetAgentRequest request = - GetAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetAgentRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); return getAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Agent response = agentsClient.getAgent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the agent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -345,22 +244,10 @@ public final Agent getAgent(String name) { return getAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   GetAgentRequest request = GetAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Agent response = agentsClient.getAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -368,42 +255,20 @@ public final Agent getAgent(GetAgentRequest request) { return getAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified agent. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   GetAgentRequest request = GetAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Agent> future = agentsClient.getAgentCallable().futureCall(request);
-   *   // Do something
-   *   Agent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getAgentCallable() { return stub.getAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   Agent response = agentsClient.createAgent(parent, agent);
-   * }
-   * 
- * * @param parent Required. The location to create a agent for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @param agent Required. The agent to create. @@ -412,26 +277,16 @@ public final UnaryCallable getAgentCallable() { public final Agent createAgent(LocationName parent, Agent agent) { CreateAgentRequest request = CreateAgentRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setAgent(agent) .build(); return createAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   Agent response = agentsClient.createAgent(parent.toString(), agent);
-   * }
-   * 
- * * @param parent Required. The location to create a agent for. Format: `projects/<Project * ID>/locations/<Location ID>`. * @param agent Required. The agent to create. @@ -443,24 +298,10 @@ public final Agent createAgent(String parent, Agent agent) { return createAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   CreateAgentRequest request = CreateAgentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setAgent(agent)
-   *     .build();
-   *   Agent response = agentsClient.createAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -468,47 +309,23 @@ public final Agent createAgent(CreateAgentRequest request) { return createAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an agent in the specified location. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
-   *   Agent agent = Agent.newBuilder().build();
-   *   CreateAgentRequest request = CreateAgentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setAgent(agent)
-   *     .build();
-   *   ApiFuture<Agent> future = agentsClient.createAgentCallable().futureCall(request);
-   *   // Do something
-   *   Agent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createAgentCallable() { return stub.createAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   Agent agent = Agent.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Agent response = agentsClient.updateAgent(agent, updateMask);
-   * }
-   * 
- * * @param agent Required. The agent to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Agent updateAgent(Agent agent, FieldMask updateMask) { @@ -517,22 +334,10 @@ public final Agent updateAgent(Agent agent, FieldMask updateMask) { return updateAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   Agent agent = Agent.newBuilder().build();
-   *   UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
-   *     .setAgent(agent)
-   *     .build();
-   *   Agent response = agentsClient.updateAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -540,64 +345,36 @@ public final Agent updateAgent(UpdateAgentRequest request) { return updateAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified agent. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   Agent agent = Agent.newBuilder().build();
-   *   UpdateAgentRequest request = UpdateAgentRequest.newBuilder()
-   *     .setAgent(agent)
-   *     .build();
-   *   ApiFuture<Agent> future = agentsClient.updateAgentCallable().futureCall(request);
-   *   // Do something
-   *   Agent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateAgentCallable() { return stub.updateAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   agentsClient.deleteAgent(name);
-   * }
-   * 
- * * @param name Required. The name of the agent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteAgent(AgentName name) { DeleteAgentRequest request = - DeleteAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteAgentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   agentsClient.deleteAgent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the agent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -607,22 +384,10 @@ public final void deleteAgent(String name) { deleteAgent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   agentsClient.deleteAgent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -630,129 +395,64 @@ public final void deleteAgent(DeleteAgentRequest request) { deleteAgentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified agent. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   DeleteAgentRequest request = DeleteAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = agentsClient.deleteAgentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteAgentCallable() { return stub.deleteAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports the specified agent to a binary file. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ExportAgentResponse response = agentsClient.exportAgentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture exportAgentAsync( ExportAgentRequest request) { return exportAgentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports the specified agent to a binary file. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<ExportAgentResponse, Struct> future = agentsClient.exportAgentOperationCallable().futureCall(request);
-   *   // Do something
-   *   ExportAgentResponse response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable exportAgentOperationCallable() { return stub.exportAgentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Exports the specified agent to a binary file. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ExportAgentRequest request = ExportAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = agentsClient.exportAgentCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable exportAgentCallable() { return stub.exportAgentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restores the specified agent from a binary file. * *

Replaces the current agent with a new one. Note that all existing resources in agent (e.g. * intents, entity types, flows) will be removed. * - *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   agentsClient.restoreAgentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture restoreAgentAsync(RestoreAgentRequest request) { return restoreAgentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restores the specified agent from a binary file. * @@ -760,26 +460,13 @@ public final OperationFuture restoreAgentAsync(RestoreAgentReques * intents, entity types, flows) will be removed. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, Struct> future = agentsClient.restoreAgentOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable restoreAgentOperationCallable() { return stub.restoreAgentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Restores the specified agent from a binary file. * @@ -787,18 +474,6 @@ public final OperationFuture restoreAgentAsync(RestoreAgentReques * intents, entity types, flows) will be removed. * *

Sample code: - * - *


-   * try (AgentsClient agentsClient = AgentsClient.create()) {
-   *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   RestoreAgentRequest request = RestoreAgentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = agentsClient.restoreAgentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable restoreAgentCallable() { return stub.restoreAgentCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsSettings.java index 5659d6fcf..81b55b3fd 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; @@ -37,7 +38,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AgentsClient}. * @@ -54,23 +55,23 @@ * *

For example, to set the total timeout of getAgent to 30 seconds: * - *

- * 
- * AgentsSettings.Builder agentsSettingsBuilder =
- *     AgentsSettings.newBuilder();
+ * 
{@code
+ * AgentsSettings.Builder agentsSettingsBuilder = AgentsSettings.newBuilder();
  * agentsSettingsBuilder
  *     .getAgentSettings()
  *     .setRetrySettings(
- *         agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ *         agentsSettingsBuilder
+ *             .getAgentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AgentsSettings agentsSettings = agentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class AgentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listAgents. */ public PagedCallSettings listAgentsSettings() { @@ -103,8 +104,6 @@ public UnaryCallSettings exportAgentSettings() { } /** Returns the object with the settings used for calls to exportAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings exportAgentOperationSettings() { return ((AgentsStubSettings) getStubSettings()).exportAgentOperationSettings(); @@ -116,8 +115,6 @@ public UnaryCallSettings restoreAgentSettings() } /** Returns the object with the settings used for calls to restoreAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings restoreAgentOperationSettings() { return ((AgentsStubSettings) getStubSettings()).restoreAgentOperationSettings(); } @@ -181,18 +178,15 @@ protected AgentsSettings(Builder settingsBuilder) throws IOException { /** Builder for AgentsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(AgentsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(AgentsStubSettings.newBuilder()); - } - protected Builder(AgentsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -201,11 +195,15 @@ protected Builder(AgentsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(AgentsStubSettings.newBuilder()); + } + public AgentsStubSettings.Builder getStubSettingsBuilder() { return ((AgentsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -250,8 +248,6 @@ public UnaryCallSettings.Builder exportAgentSetti } /** Returns the builder for the settings used for calls to exportAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder exportAgentOperationSettings() { return getStubSettingsBuilder().exportAgentOperationSettings(); @@ -263,8 +259,6 @@ public UnaryCallSettings.Builder restoreAgentSet } /** Returns the builder for the settings used for calls to restoreAgent. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder restoreAgentOperationSettings() { return getStubSettingsBuilder().restoreAgentOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java index b52e299fd..d0aceaa07 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -32,10 +33,11 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType]. @@ -43,16 +45,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- *   EntityType response = entityTypesClient.getEntityType(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the entityTypesClient object to clean up resources such as + *

Note: close() needs to be called on the EntityTypesClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -80,30 +73,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * EntityTypesSettings entityTypesSettings =
  *     EntityTypesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * EntityTypesClient entityTypesClient =
- *     EntityTypesClient.create(entityTypesSettings);
- * 
- * 
+ * EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * EntityTypesSettings entityTypesSettings =
  *     EntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
- * EntityTypesClient entityTypesClient =
- *     EntityTypesClient.create(entityTypesSettings);
- * 
- * 
+ * EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class EntityTypesClient implements BackgroundResource { private final EntityTypesSettings settings; private final EntityTypesStub stub; @@ -123,7 +112,7 @@ public static final EntityTypesClient create(EntityTypesSettings settings) throw /** * Constructs an instance of EntityTypesClient, using the given stub for making calls. This is for - * advanced usage - prefer to use EntityTypesSettings}. + * advanced usage - prefer using create(EntityTypesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EntityTypesClient create(EntityTypesStub stub) { @@ -155,21 +144,10 @@ public EntityTypesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all entity types for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -177,26 +155,15 @@ public EntityTypesStub getStub() { public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) { ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (EntityType element : entityTypesClient.listEntityTypes(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all entity types for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -206,24 +173,10 @@ public final ListEntityTypesPagedResponse listEntityTypes(String parent) { return listEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (EntityType element : entityTypesClient.listEntityTypes(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -231,76 +184,32 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest return listEntityTypesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListEntityTypesPagedResponse> future = entityTypesClient.listEntityTypesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (EntityType element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEntityTypesPagedCallable() { return stub.listEntityTypesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all entity types in the specified agent. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListEntityTypesResponse response = entityTypesClient.listEntityTypesCallable().call(request);
-   *     for (EntityType element : response.getEntityTypesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEntityTypesCallable() { return stub.listEntityTypesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   EntityType response = entityTypesClient.getEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -308,23 +217,16 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest */ public final EntityType getEntityType(EntityTypeName name) { GetEntityTypeRequest request = - GetEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetEntityTypeRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   EntityType response = entityTypesClient.getEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -335,22 +237,10 @@ public final EntityType getEntityType(String name) { return getEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   EntityType response = entityTypesClient.getEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -358,73 +248,41 @@ public final EntityType getEntityType(GetEntityTypeRequest request) { return getEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified entity type. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<EntityType> future = entityTypesClient.getEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   EntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getEntityTypeCallable() { return stub.getEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   EntityType response = entityTypesClient.createEntityType(parent, entityType);
-   * }
-   * 
- * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entityType Required. The entity type to create. + * @param entity_type Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(AgentName parent, EntityType entityType) { CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setEntityType(entityType) .build(); return createEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType);
-   * }
-   * 
- * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entityType Required. The entity type to create. + * @param entity_type Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(String parent, EntityType entityType) { @@ -433,24 +291,10 @@ public final EntityType createEntityType(String parent, EntityType entityType) { return createEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEntityType(entityType)
-   *     .build();
-   *   EntityType response = entityTypesClient.createEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -458,46 +302,22 @@ public final EntityType createEntityType(CreateEntityTypeRequest request) { return createEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an entity type in the specified agent. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEntityType(entityType)
-   *     .build();
-   *   ApiFuture<EntityType> future = entityTypesClient.createEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   EntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createEntityTypeCallable() { return stub.createEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   EntityType response = entityTypesClient.updateEntityType(entityType, updateMask);
-   * }
-   * 
- * - * @param entityType Required. The entity type to update. - * @param updateMask The mask to control which fields get updated. + * @param entity_type Required. The entity type to update. + * @param update_mask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType updateEntityType(EntityType entityType, FieldMask updateMask) { @@ -509,22 +329,10 @@ public final EntityType updateEntityType(EntityType entityType, FieldMask update return updateEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
-   *     .setEntityType(entityType)
-   *     .build();
-   *   EntityType response = entityTypesClient.updateEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -532,41 +340,20 @@ public final EntityType updateEntityType(UpdateEntityTypeRequest request) { return updateEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified entity type. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityType entityType = EntityType.newBuilder().build();
-   *   UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
-   *     .setEntityType(entityType)
-   *     .build();
-   *   ApiFuture<EntityType> future = entityTypesClient.updateEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   EntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateEntityTypeCallable() { return stub.updateEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   entityTypesClient.deleteEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the entity type to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -574,23 +361,16 @@ public final UnaryCallable updateEntityType */ public final void deleteEntityType(EntityTypeName name) { DeleteEntityTypeRequest request = - DeleteEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteEntityTypeRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   entityTypesClient.deleteEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the entity type to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/entityTypes/<Entity Type * ID>`. @@ -601,22 +381,10 @@ public final void deleteEntityType(String name) { deleteEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * - *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   entityTypesClient.deleteEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -624,23 +392,11 @@ public final void deleteEntityType(DeleteEntityTypeRequest request) { deleteEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified entity type. * *

Sample code: - * - *


-   * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
-   *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
-   *   DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteEntityTypeCallable() { return stub.deleteEntityTypeCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesSettings.java index 08ef354c6..878cafedc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EntityTypesClient}. * @@ -51,23 +52,23 @@ * *

For example, to set the total timeout of getEntityType to 30 seconds: * - *

- * 
- * EntityTypesSettings.Builder entityTypesSettingsBuilder =
- *     EntityTypesSettings.newBuilder();
+ * 
{@code
+ * EntityTypesSettings.Builder entityTypesSettingsBuilder = EntityTypesSettings.newBuilder();
  * entityTypesSettingsBuilder
  *     .getEntityTypeSettings()
  *     .setRetrySettings(
- *         entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ *         entityTypesSettingsBuilder
+ *             .getEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EntityTypesSettings entityTypesSettings = entityTypesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class EntityTypesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listEntityTypes. */ public PagedCallSettings< ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> @@ -154,18 +155,15 @@ protected EntityTypesSettings(Builder settingsBuilder) throws IOException { /** Builder for EntityTypesSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(EntityTypesStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(EntityTypesStubSettings.newBuilder()); - } - protected Builder(EntityTypesSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -174,11 +172,15 @@ protected Builder(EntityTypesStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(EntityTypesStubSettings.newBuilder()); + } + public EntityTypesStubSettings.Builder getStubSettingsBuilder() { return ((EntityTypesStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java index c6fec5e31..ae5cbebbf 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -37,10 +38,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [Environments][google.cloud.dialogflow.cx.v3beta1.Environment]. @@ -48,16 +50,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- *   Environment response = environmentsClient.getEnvironment(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the environmentsClient object to clean up resources such + *

Note: close() needs to be called on the EnvironmentsClient object to clean up resources such * as threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -85,30 +78,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * EnvironmentsSettings environmentsSettings =
  *     EnvironmentsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * EnvironmentsClient environmentsClient =
- *     EnvironmentsClient.create(environmentsSettings);
- * 
- * 
+ * EnvironmentsClient environmentsClient = EnvironmentsClient.create(environmentsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * EnvironmentsSettings environmentsSettings =
  *     EnvironmentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * EnvironmentsClient environmentsClient =
- *     EnvironmentsClient.create(environmentsSettings);
- * 
- * 
+ * EnvironmentsClient environmentsClient = EnvironmentsClient.create(environmentsSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class EnvironmentsClient implements BackgroundResource { private final EnvironmentsSettings settings; private final EnvironmentsStub stub; @@ -129,7 +118,7 @@ public static final EnvironmentsClient create(EnvironmentsSettings settings) thr /** * Constructs an instance of EnvironmentsClient, using the given stub for making calls. This is - * for advanced usage - prefer to use EnvironmentsSettings}. + * for advanced usage - prefer using create(EnvironmentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final EnvironmentsClient create(EnvironmentsStub stub) { @@ -167,28 +156,15 @@ public EnvironmentsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Environment element : environmentsClient.listEnvironments(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all * environments for. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>`. @@ -197,27 +173,16 @@ public final OperationsClient getOperationsClient() { public final ListEnvironmentsPagedResponse listEnvironments(AgentName parent) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listEnvironments(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Environment element : environmentsClient.listEnvironments(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to list all * environments for. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>`. @@ -229,25 +194,11 @@ public final ListEnvironmentsPagedResponse listEnvironments(String parent) { return listEnvironments(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Environment element : environmentsClient.listEnvironments(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -255,78 +206,34 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ return listEnvironmentsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListEnvironmentsPagedResponse> future = environmentsClient.listEnvironmentsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Environment element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEnvironmentsPagedCallable() { return stub.listEnvironmentsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all environments in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListEnvironmentsResponse response = environmentsClient.listEnvironmentsCallable().call(request);
-   *     for (Environment element : response.getEnvironmentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listEnvironmentsCallable() { return stub.listEnvironmentsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   Environment response = environmentsClient.getEnvironment(name);
-   * }
-   * 
- * * @param name Required. The name of the * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -335,23 +242,16 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ */ public final Environment getEnvironment(EnvironmentName name) { GetEnvironmentRequest request = - GetEnvironmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetEnvironmentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   Environment response = environmentsClient.getEnvironment(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -363,22 +263,10 @@ public final Environment getEnvironment(String name) { return getEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Environment response = environmentsClient.getEnvironment(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -386,84 +274,48 @@ public final Environment getEnvironment(GetEnvironmentRequest request) { return getEnvironmentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   GetEnvironmentRequest request = GetEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Environment> future = environmentsClient.getEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   Environment response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getEnvironmentCallable() { return stub.getEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   Environment response = environmentsClient.createEnvironmentAsync(parent, environment).get();
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. * @param environment Required. The environment to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createEnvironmentAsync( AgentName parent, Environment environment) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setEnvironment(environment) .build(); return createEnvironmentAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   Environment response = environmentsClient.createEnvironmentAsync(parent.toString(), environment).get();
-   * }
-   * 
- * * @param parent Required. The [Agent][google.cloud.dialogflow.cx.v3beta1.Agent] to create an * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`. * @param environment Required. The environment to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createEnvironmentAsync( String parent, Environment environment) { CreateEnvironmentRequest request = @@ -471,107 +323,50 @@ public final OperationFuture createEnvironmentAsync( return createEnvironmentAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEnvironment(environment)
-   *     .build();
-   *   Environment response = environmentsClient.createEnvironmentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createEnvironmentAsync( CreateEnvironmentRequest request) { return createEnvironmentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEnvironment(environment)
-   *     .build();
-   *   OperationFuture<Environment, Struct> future = environmentsClient.createEnvironmentOperationCallable().futureCall(request);
-   *   // Do something
-   *   Environment response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable createEnvironmentOperationCallable() { return stub.createEnvironmentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified * [Agent][google.cloud.dialogflow.cx.v3beta1.Agent]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Environment environment = Environment.newBuilder().build();
-   *   CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setEnvironment(environment)
-   *     .build();
-   *   ApiFuture<Operation> future = environmentsClient.createEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createEnvironmentCallable() { return stub.createEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Environment response = environmentsClient.updateEnvironmentAsync(environment, updateMask).get();
-   * }
-   * 
- * * @param environment Required. The environment to update. - * @param updateMask Required. The mask to control which fields get updated. + * @param update_mask Required. The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture updateEnvironmentAsync( Environment environment, FieldMask updateMask) { UpdateEnvironmentRequest request = @@ -582,97 +377,43 @@ public final OperationFuture updateEnvironmentAsync( return updateEnvironmentAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
-   *     .setEnvironment(environment)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Environment response = environmentsClient.updateEnvironmentAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture updateEnvironmentAsync( UpdateEnvironmentRequest request) { return updateEnvironmentOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
-   *     .setEnvironment(environment)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   OperationFuture<Environment, Struct> future = environmentsClient.updateEnvironmentOperationCallable().futureCall(request);
-   *   // Do something
-   *   Environment response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable updateEnvironmentOperationCallable() { return stub.updateEnvironmentOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   Environment environment = Environment.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateEnvironmentRequest request = UpdateEnvironmentRequest.newBuilder()
-   *     .setEnvironment(environment)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Operation> future = environmentsClient.updateEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateEnvironmentCallable() { return stub.updateEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   environmentsClient.deleteEnvironment(name);
-   * }
-   * 
- * * @param name Required. The name of the * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -682,24 +423,15 @@ public final UnaryCallable updateEnvironmen public final void deleteEnvironment(EnvironmentName name) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); deleteEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   environmentsClient.deleteEnvironment(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] to delete. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -711,22 +443,10 @@ public final void deleteEnvironment(String name) { deleteEnvironment(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   environmentsClient.deleteEnvironment(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -734,44 +454,21 @@ public final void deleteEnvironment(DeleteEnvironmentRequest request) { deleteEnvironmentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = environmentsClient.deleteEnvironmentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteEnvironmentCallable() { return stub.deleteEnvironmentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(name).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param name Required. Resource name of the environment to look up the history for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>`. @@ -781,27 +478,16 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( EnvironmentName name) { LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); return lookupEnvironmentHistory(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(name.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param name Required. Resource name of the environment to look up the history for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>`. @@ -813,25 +499,11 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory(Stri return lookupEnvironmentHistory(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * - *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   for (Environment element : environmentsClient.lookupEnvironmentHistory(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -840,59 +512,24 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( return lookupEnvironmentHistoryPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<LookupEnvironmentHistoryPagedResponse> future = environmentsClient.lookupEnvironmentHistoryPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Environment element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable lookupEnvironmentHistoryPagedCallable() { return stub.lookupEnvironmentHistoryPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Looks up the history of the specified * [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * *

Sample code: - * - *


-   * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
-   *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
-   *   LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   while (true) {
-   *     LookupEnvironmentHistoryResponse response = environmentsClient.lookupEnvironmentHistoryCallable().call(request);
-   *     for (Environment element : response.getEnvironmentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable lookupEnvironmentHistoryCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsSettings.java index 608ddfaa4..a171dd7b2 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; @@ -38,7 +39,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EnvironmentsClient}. * @@ -55,23 +56,23 @@ * *

For example, to set the total timeout of getEnvironment to 30 seconds: * - *

- * 
- * EnvironmentsSettings.Builder environmentsSettingsBuilder =
- *     EnvironmentsSettings.newBuilder();
+ * 
{@code
+ * EnvironmentsSettings.Builder environmentsSettingsBuilder = EnvironmentsSettings.newBuilder();
  * environmentsSettingsBuilder
  *     .getEnvironmentSettings()
  *     .setRetrySettings(
- *         environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ *         environmentsSettingsBuilder
+ *             .getEnvironmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EnvironmentsSettings environmentsSettings = environmentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class EnvironmentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listEnvironments. */ public PagedCallSettings< ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> @@ -90,8 +91,6 @@ public UnaryCallSettings createEnvironmentS } /** Returns the object with the settings used for calls to createEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings createEnvironmentOperationSettings() { return ((EnvironmentsStubSettings) getStubSettings()).createEnvironmentOperationSettings(); @@ -103,8 +102,6 @@ public UnaryCallSettings updateEnvironmentS } /** Returns the object with the settings used for calls to updateEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings updateEnvironmentOperationSettings() { return ((EnvironmentsStubSettings) getStubSettings()).updateEnvironmentOperationSettings(); @@ -184,18 +181,15 @@ protected EnvironmentsSettings(Builder settingsBuilder) throws IOException { /** Builder for EnvironmentsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(EnvironmentsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(EnvironmentsStubSettings.newBuilder()); - } - protected Builder(EnvironmentsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -204,11 +198,15 @@ protected Builder(EnvironmentsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(EnvironmentsStubSettings.newBuilder()); + } + public EnvironmentsStubSettings.Builder getStubSettingsBuilder() { return ((EnvironmentsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -240,8 +238,6 @@ public UnaryCallSettings.Builder getEnvironm } /** Returns the builder for the settings used for calls to createEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder createEnvironmentOperationSettings() { return getStubSettingsBuilder().createEnvironmentOperationSettings(); @@ -254,8 +250,6 @@ public UnaryCallSettings.Builder getEnvironm } /** Returns the builder for the settings used for calls to updateEnvironment. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder updateEnvironmentOperationSettings() { return getStubSettingsBuilder().updateEnvironmentOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java index 1aba5a124..2530247b0 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -37,27 +38,18 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Flow flow = Flow.newBuilder().build();
- *   Flow response = flowsClient.createFlow(parent, flow);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the flowsClient object to clean up resources such as + *

Note: close() needs to be called on the FlowsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -85,30 +77,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * FlowsSettings flowsSettings =
  *     FlowsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * FlowsClient flowsClient =
- *     FlowsClient.create(flowsSettings);
- * 
- * 
+ * FlowsClient flowsClient = FlowsClient.create(flowsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * FlowsSettings flowsSettings =
- *     FlowsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * FlowsClient flowsClient =
- *     FlowsClient.create(flowsSettings);
- * 
- * 
+ *
{@code
+ * FlowsSettings flowsSettings = FlowsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * FlowsClient flowsClient = FlowsClient.create(flowsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class FlowsClient implements BackgroundResource { private final FlowsSettings settings; private final FlowsStub stub; @@ -129,7 +116,7 @@ public static final FlowsClient create(FlowsSettings settings) throws IOExceptio /** * Constructs an instance of FlowsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use FlowsSettings}. + * advanced usage - prefer using create(FlowsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final FlowsClient create(FlowsStub stub) { @@ -166,26 +153,14 @@ public FlowsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   Flow response = flowsClient.createFlow(parent, flow);
-   * }
-   * 
- * * @param parent Required. The agent to create a flow for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param flow Required. The flow to create. @@ -194,26 +169,16 @@ public final OperationsClient getOperationsClient() { public final Flow createFlow(AgentName parent, Flow flow) { CreateFlowRequest request = CreateFlowRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setFlow(flow) .build(); return createFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   Flow response = flowsClient.createFlow(parent.toString(), flow);
-   * }
-   * 
- * * @param parent Required. The agent to create a flow for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param flow Required. The flow to create. @@ -225,24 +190,10 @@ public final Flow createFlow(String parent, Flow flow) { return createFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   CreateFlowRequest request = CreateFlowRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setFlow(flow)
-   *     .build();
-   *   Flow response = flowsClient.createFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -250,66 +201,36 @@ public final Flow createFlow(CreateFlowRequest request) { return createFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a flow in the specified agent. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Flow flow = Flow.newBuilder().build();
-   *   CreateFlowRequest request = CreateFlowRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setFlow(flow)
-   *     .build();
-   *   ApiFuture<Flow> future = flowsClient.createFlowCallable().futureCall(request);
-   *   // Do something
-   *   Flow response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createFlowCallable() { return stub.createFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.deleteFlow(name);
-   * }
-   * 
- * * @param name Required. The name of the flow to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteFlow(FlowName name) { DeleteFlowRequest request = - DeleteFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteFlowRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.deleteFlow(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the flow to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -319,22 +240,10 @@ public final void deleteFlow(String name) { deleteFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   flowsClient.deleteFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -342,68 +251,36 @@ public final void deleteFlow(DeleteFlowRequest request) { deleteFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes a specified flow. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   DeleteFlowRequest request = DeleteFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = flowsClient.deleteFlowCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteFlowCallable() { return stub.deleteFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Flow element : flowsClient.listFlows(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent containing the flows. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListFlowsPagedResponse listFlows(AgentName parent) { ListFlowsRequest request = - ListFlowsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListFlowsRequest.newBuilder() + .setParent(Objects.isNull(parent) ? null : parent.toString()) + .build(); return listFlows(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Flow element : flowsClient.listFlows(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent containing the flows. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -413,24 +290,10 @@ public final ListFlowsPagedResponse listFlows(String parent) { return listFlows(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Flow element : flowsClient.listFlows(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -438,97 +301,44 @@ public final ListFlowsPagedResponse listFlows(ListFlowsRequest request) { return listFlowsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListFlowsPagedResponse> future = flowsClient.listFlowsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Flow element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listFlowsPagedCallable() { return stub.listFlowsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all flows in the specified agent. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListFlowsRequest request = ListFlowsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListFlowsResponse response = flowsClient.listFlowsCallable().call(request);
-   *     for (Flow element : response.getFlowsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listFlowsCallable() { return stub.listFlowsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Flow response = flowsClient.getFlow(name);
-   * }
-   * 
- * * @param name Required. The name of the flow to get. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Flow getFlow(FlowName name) { GetFlowRequest request = - GetFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetFlowRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); return getFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Flow response = flowsClient.getFlow(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the flow to get. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -538,22 +348,10 @@ public final Flow getFlow(String name) { return getFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   GetFlowRequest request = GetFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Flow response = flowsClient.getFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -561,44 +359,22 @@ public final Flow getFlow(GetFlowRequest request) { return getFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified flow. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   GetFlowRequest request = GetFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Flow> future = flowsClient.getFlowCallable().futureCall(request);
-   *   // Do something
-   *   Flow response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getFlowCallable() { return stub.getFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   Flow flow = Flow.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Flow response = flowsClient.updateFlow(flow, updateMask);
-   * }
-   * 
- * * @param flow Required. The flow to update. - * @param updateMask Required. The mask to control which fields get updated. If `update_mask` is + * @param update_mask Required. The mask to control which fields get updated. If `update_mask` is * not specified, an error will be returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -608,24 +384,10 @@ public final Flow updateFlow(Flow flow, FieldMask updateMask) { return updateFlow(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified flow. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   Flow flow = Flow.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
-   *     .setFlow(flow)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Flow response = flowsClient.updateFlow(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -633,144 +395,71 @@ public final Flow updateFlow(UpdateFlowRequest request) { return updateFlowCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified flow. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   Flow flow = Flow.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateFlowRequest request = UpdateFlowRequest.newBuilder()
-   *     .setFlow(flow)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Flow> future = flowsClient.updateFlowCallable().futureCall(request);
-   *   // Do something
-   *   Flow response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateFlowCallable() { return stub.updateFlowCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.trainFlowAsync(name).get();
-   * }
-   * 
- * * @param name Required. The flow to train. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture trainFlowAsync(FlowName name) { TrainFlowRequest request = - TrainFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + TrainFlowRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return trainFlowAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   flowsClient.trainFlowAsync(name.toString()).get();
-   * }
-   * 
- * * @param name Required. The flow to train. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture trainFlowAsync(String name) { TrainFlowRequest request = TrainFlowRequest.newBuilder().setName(name).build(); return trainFlowAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * - *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   flowsClient.trainFlowAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture trainFlowAsync(TrainFlowRequest request) { return trainFlowOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, Struct> future = flowsClient.trainFlowOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable trainFlowOperationCallable() { return stub.trainFlowOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Trains the specified flow. Note that only the flow in 'draft' environment is trained. * *

Sample code: - * - *


-   * try (FlowsClient flowsClient = FlowsClient.create()) {
-   *   FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TrainFlowRequest request = TrainFlowRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = flowsClient.trainFlowCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable trainFlowCallable() { return stub.trainFlowCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsSettings.java index 2a321216d..7b95a7b2d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; @@ -37,7 +38,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link FlowsClient}. * @@ -54,23 +55,23 @@ * *

For example, to set the total timeout of createFlow to 30 seconds: * - *

- * 
- * FlowsSettings.Builder flowsSettingsBuilder =
- *     FlowsSettings.newBuilder();
+ * 
{@code
+ * FlowsSettings.Builder flowsSettingsBuilder = FlowsSettings.newBuilder();
  * flowsSettingsBuilder
  *     .createFlowSettings()
  *     .setRetrySettings(
- *         flowsSettingsBuilder.createFlowSettings().getRetrySettings().toBuilder()
+ *         flowsSettingsBuilder
+ *             .createFlowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * FlowsSettings flowsSettings = flowsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class FlowsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createFlow. */ public UnaryCallSettings createFlowSettings() { return ((FlowsStubSettings) getStubSettings()).createFlowSettings(); @@ -103,8 +104,6 @@ public UnaryCallSettings trainFlowSettings() { } /** Returns the object with the settings used for calls to trainFlow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings trainFlowOperationSettings() { return ((FlowsStubSettings) getStubSettings()).trainFlowOperationSettings(); } @@ -168,18 +167,15 @@ protected FlowsSettings(Builder settingsBuilder) throws IOException { /** Builder for FlowsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(FlowsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(FlowsStubSettings.newBuilder()); - } - protected Builder(FlowsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -188,11 +184,15 @@ protected Builder(FlowsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(FlowsStubSettings.newBuilder()); + } + public FlowsStubSettings.Builder getStubSettingsBuilder() { return ((FlowsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -237,8 +237,6 @@ public UnaryCallSettings.Builder trainFlowSettings( } /** Returns the builder for the settings used for calls to trainFlow. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder trainFlowOperationSettings() { return getStubSettingsBuilder().trainFlowOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java index a76007393..76e866a11 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -32,26 +33,18 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- *   Intent response = intentsClient.getIntent(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the intentsClient object to clean up resources such as + *

Note: close() needs to be called on the IntentsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -79,30 +72,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * IntentsSettings intentsSettings =
  *     IntentsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * IntentsClient intentsClient =
- *     IntentsClient.create(intentsSettings);
- * 
- * 
+ * IntentsClient intentsClient = IntentsClient.create(intentsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * IntentsSettings intentsSettings =
- *     IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * IntentsClient intentsClient =
- *     IntentsClient.create(intentsSettings);
- * 
- * 
+ *
{@code
+ * IntentsSettings intentsSettings = IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * IntentsClient intentsClient = IntentsClient.create(intentsSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class IntentsClient implements BackgroundResource { private final IntentsSettings settings; private final IntentsStub stub; @@ -122,7 +110,7 @@ public static final IntentsClient create(IntentsSettings settings) throws IOExce /** * Constructs an instance of IntentsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use IntentsSettings}. + * advanced usage - prefer using create(IntentsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final IntentsClient create(IntentsStub stub) { @@ -153,21 +141,10 @@ public IntentsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all intents for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -175,26 +152,15 @@ public IntentsStub getStub() { public final ListIntentsPagedResponse listIntents(AgentName parent) { ListIntentsRequest request = ListIntentsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listIntents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Intent element : intentsClient.listIntents(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all intents for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -204,24 +170,10 @@ public final ListIntentsPagedResponse listIntents(String parent) { return listIntents(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Intent element : intentsClient.listIntents(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -229,98 +181,47 @@ public final ListIntentsPagedResponse listIntents(ListIntentsRequest request) { return listIntentsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListIntentsPagedResponse> future = intentsClient.listIntentsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Intent element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listIntentsPagedCallable() { return stub.listIntentsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all intents in the specified agent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListIntentsRequest request = ListIntentsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListIntentsResponse response = intentsClient.listIntentsCallable().call(request);
-   *     for (Intent element : response.getIntentsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listIntentsCallable() { return stub.listIntentsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   Intent response = intentsClient.getIntent(name);
-   * }
-   * 
- * * @param name Required. The name of the intent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Intent getIntent(IntentName name) { GetIntentRequest request = - GetIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetIntentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   Intent response = intentsClient.getIntent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the intent. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -330,22 +231,10 @@ public final Intent getIntent(String name) { return getIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   GetIntentRequest request = GetIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Intent response = intentsClient.getIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -353,42 +242,20 @@ public final Intent getIntent(GetIntentRequest request) { return getIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified intent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   GetIntentRequest request = GetIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Intent> future = intentsClient.getIntentCallable().futureCall(request);
-   *   // Do something
-   *   Intent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getIntentCallable() { return stub.getIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   Intent response = intentsClient.createIntent(parent, intent);
-   * }
-   * 
- * * @param parent Required. The agent to create an intent for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param intent Required. The intent to create. @@ -397,26 +264,16 @@ public final UnaryCallable getIntentCallable() { public final Intent createIntent(AgentName parent, Intent intent) { CreateIntentRequest request = CreateIntentRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setIntent(intent) .build(); return createIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   Intent response = intentsClient.createIntent(parent.toString(), intent);
-   * }
-   * 
- * * @param parent Required. The agent to create an intent for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param intent Required. The intent to create. @@ -428,24 +285,10 @@ public final Intent createIntent(String parent, Intent intent) { return createIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   CreateIntentRequest request = CreateIntentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setIntent(intent)
-   *     .build();
-   *   Intent response = intentsClient.createIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -453,47 +296,23 @@ public final Intent createIntent(CreateIntentRequest request) { return createIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an intent in the specified agent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Intent intent = Intent.newBuilder().build();
-   *   CreateIntentRequest request = CreateIntentRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setIntent(intent)
-   *     .build();
-   *   ApiFuture<Intent> future = intentsClient.createIntentCallable().futureCall(request);
-   *   // Do something
-   *   Intent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createIntentCallable() { return stub.createIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   Intent intent = Intent.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Intent response = intentsClient.updateIntent(intent, updateMask);
-   * }
-   * 
- * * @param intent Required. The intent to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Intent updateIntent(Intent intent, FieldMask updateMask) { @@ -502,22 +321,10 @@ public final Intent updateIntent(Intent intent, FieldMask updateMask) { return updateIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   Intent intent = Intent.newBuilder().build();
-   *   UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
-   *     .setIntent(intent)
-   *     .build();
-   *   Intent response = intentsClient.updateIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -525,64 +332,36 @@ public final Intent updateIntent(UpdateIntentRequest request) { return updateIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified intent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   Intent intent = Intent.newBuilder().build();
-   *   UpdateIntentRequest request = UpdateIntentRequest.newBuilder()
-   *     .setIntent(intent)
-   *     .build();
-   *   ApiFuture<Intent> future = intentsClient.updateIntentCallable().futureCall(request);
-   *   // Do something
-   *   Intent response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateIntentCallable() { return stub.updateIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   intentsClient.deleteIntent(name);
-   * }
-   * 
- * * @param name Required. The name of the intent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteIntent(IntentName name) { DeleteIntentRequest request = - DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteIntentRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   intentsClient.deleteIntent(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the intent to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/intents/<Intent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -592,22 +371,10 @@ public final void deleteIntent(String name) { deleteIntent(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * - *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   intentsClient.deleteIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -615,23 +382,11 @@ public final void deleteIntent(DeleteIntentRequest request) { deleteIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified intent. * *

Sample code: - * - *


-   * try (IntentsClient intentsClient = IntentsClient.create()) {
-   *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
-   *   DeleteIntentRequest request = DeleteIntentRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = intentsClient.deleteIntentCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteIntentCallable() { return stub.deleteIntentCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java index 298bf5345..f70eecefe 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link IntentsClient}. * @@ -51,23 +52,23 @@ * *

For example, to set the total timeout of getIntent to 30 seconds: * - *

- * 
- * IntentsSettings.Builder intentsSettingsBuilder =
- *     IntentsSettings.newBuilder();
+ * 
{@code
+ * IntentsSettings.Builder intentsSettingsBuilder = IntentsSettings.newBuilder();
  * intentsSettingsBuilder
  *     .getIntentSettings()
  *     .setRetrySettings(
- *         intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ *         intentsSettingsBuilder
+ *             .getIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * IntentsSettings intentsSettings = intentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class IntentsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listIntents. */ public PagedCallSettings listIntentsSettings() { @@ -153,18 +154,15 @@ protected IntentsSettings(Builder settingsBuilder) throws IOException { /** Builder for IntentsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(IntentsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(IntentsStubSettings.newBuilder()); - } - protected Builder(IntentsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -173,11 +171,15 @@ protected Builder(IntentsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(IntentsStubSettings.newBuilder()); + } + public IntentsStubSettings.Builder getStubSettingsBuilder() { return ((IntentsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java index b481c31a0..f3d5c4e5d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -32,26 +33,18 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (PagesClient pagesClient = PagesClient.create()) {
- *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- *   Page response = pagesClient.getPage(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the pagesClient object to clean up resources such as + *

Note: close() needs to be called on the PagesClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -79,30 +72,25 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * PagesSettings pagesSettings =
  *     PagesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * PagesClient pagesClient =
- *     PagesClient.create(pagesSettings);
- * 
- * 
+ * PagesClient pagesClient = PagesClient.create(pagesSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
- * PagesSettings pagesSettings =
- *     PagesSettings.newBuilder().setEndpoint(myEndpoint).build();
- * PagesClient pagesClient =
- *     PagesClient.create(pagesSettings);
- * 
- * 
+ *
{@code
+ * PagesSettings pagesSettings = PagesSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PagesClient pagesClient = PagesClient.create(pagesSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class PagesClient implements BackgroundResource { private final PagesSettings settings; private final PagesStub stub; @@ -122,7 +110,7 @@ public static final PagesClient create(PagesSettings settings) throws IOExceptio /** * Constructs an instance of PagesClient, using the given stub for making calls. This is for - * advanced usage - prefer to use PagesSettings}. + * advanced usage - prefer using create(PagesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final PagesClient create(PagesStub stub) { @@ -153,46 +141,26 @@ public PagesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Page element : pagesClient.listPages(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all pages for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListPagesPagedResponse listPages(FlowName parent) { ListPagesRequest request = - ListPagesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + ListPagesRequest.newBuilder() + .setParent(Objects.isNull(parent) ? null : parent.toString()) + .build(); return listPages(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Page element : pagesClient.listPages(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all pages for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -202,24 +170,10 @@ public final ListPagesPagedResponse listPages(String parent) { return listPages(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListPagesRequest request = ListPagesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Page element : pagesClient.listPages(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -227,74 +181,30 @@ public final ListPagesPagedResponse listPages(ListPagesRequest request) { return listPagesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListPagesRequest request = ListPagesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListPagesPagedResponse> future = pagesClient.listPagesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Page element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listPagesPagedCallable() { return stub.listPagesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all pages in the specified flow. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListPagesRequest request = ListPagesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListPagesResponse response = pagesClient.listPagesCallable().call(request);
-   *     for (Page element : response.getPagesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listPagesCallable() { return stub.listPagesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   Page response = pagesClient.getPage(name);
-   * }
-   * 
- * * @param name Required. The name of the page. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow * ID>/pages/<Page ID>`. @@ -302,23 +212,14 @@ public final UnaryCallable listPagesCallabl */ public final Page getPage(PageName name) { GetPageRequest request = - GetPageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetPageRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); return getPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   Page response = pagesClient.getPage(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the page. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow * ID>/pages/<Page ID>`. @@ -329,22 +230,10 @@ public final Page getPage(String name) { return getPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   GetPageRequest request = GetPageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Page response = pagesClient.getPage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -352,42 +241,20 @@ public final Page getPage(GetPageRequest request) { return getPageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified page. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   GetPageRequest request = GetPageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Page> future = pagesClient.getPageCallable().futureCall(request);
-   *   // Do something
-   *   Page response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getPageCallable() { return stub.getPageCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   Page response = pagesClient.createPage(parent, page);
-   * }
-   * 
- * * @param parent Required. The flow to create a page for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param page Required. The page to create. @@ -396,26 +263,16 @@ public final UnaryCallable getPageCallable() { public final Page createPage(FlowName parent, Page page) { CreatePageRequest request = CreatePageRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setPage(page) .build(); return createPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   Page response = pagesClient.createPage(parent.toString(), page);
-   * }
-   * 
- * * @param parent Required. The flow to create a page for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param page Required. The page to create. @@ -427,24 +284,10 @@ public final Page createPage(String parent, Page page) { return createPage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   CreatePageRequest request = CreatePageRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setPage(page)
-   *     .build();
-   *   Page response = pagesClient.createPage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -452,47 +295,23 @@ public final Page createPage(CreatePageRequest request) { return createPageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a page in the specified flow. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Page page = Page.newBuilder().build();
-   *   CreatePageRequest request = CreatePageRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setPage(page)
-   *     .build();
-   *   ApiFuture<Page> future = pagesClient.createPageCallable().futureCall(request);
-   *   // Do something
-   *   Page response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createPageCallable() { return stub.createPageCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   Page page = Page.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Page response = pagesClient.updatePage(page, updateMask);
-   * }
-   * 
- * * @param page Required. The page to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Page updatePage(Page page, FieldMask updateMask) { @@ -501,22 +320,10 @@ public final Page updatePage(Page page, FieldMask updateMask) { return updatePage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   Page page = Page.newBuilder().build();
-   *   UpdatePageRequest request = UpdatePageRequest.newBuilder()
-   *     .setPage(page)
-   *     .build();
-   *   Page response = pagesClient.updatePage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -524,41 +331,20 @@ public final Page updatePage(UpdatePageRequest request) { return updatePageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified page. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   Page page = Page.newBuilder().build();
-   *   UpdatePageRequest request = UpdatePageRequest.newBuilder()
-   *     .setPage(page)
-   *     .build();
-   *   ApiFuture<Page> future = pagesClient.updatePageCallable().futureCall(request);
-   *   // Do something
-   *   Page response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updatePageCallable() { return stub.updatePageCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   pagesClient.deletePage(name);
-   * }
-   * 
- * * @param name Required. The name of the page to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow * ID>/pages/<Page ID>`. @@ -566,23 +352,16 @@ public final UnaryCallable updatePageCallable() { */ public final void deletePage(PageName name) { DeletePageRequest request = - DeletePageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeletePageRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deletePage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   pagesClient.deletePage(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the page to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/Flows/<flow * ID>/pages/<Page ID>`. @@ -593,22 +372,10 @@ public final void deletePage(String name) { deletePage(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * - *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   DeletePageRequest request = DeletePageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   pagesClient.deletePage(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -616,23 +383,11 @@ public final void deletePage(DeletePageRequest request) { deletePageCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified page. * *

Sample code: - * - *


-   * try (PagesClient pagesClient = PagesClient.create()) {
-   *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
-   *   DeletePageRequest request = DeletePageRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = pagesClient.deletePageCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deletePageCallable() { return stub.deletePageCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesSettings.java index 61cbe4cdc..e5ea3dd6b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link PagesClient}. * @@ -51,23 +52,23 @@ * *

For example, to set the total timeout of getPage to 30 seconds: * - *

- * 
- * PagesSettings.Builder pagesSettingsBuilder =
- *     PagesSettings.newBuilder();
+ * 
{@code
+ * PagesSettings.Builder pagesSettingsBuilder = PagesSettings.newBuilder();
  * pagesSettingsBuilder
  *     .getPageSettings()
  *     .setRetrySettings(
- *         pagesSettingsBuilder.getPageSettings().getRetrySettings().toBuilder()
+ *         pagesSettingsBuilder
+ *             .getPageSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PagesSettings pagesSettings = pagesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class PagesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listPages. */ public PagedCallSettings listPagesSettings() { @@ -153,18 +154,15 @@ protected PagesSettings(Builder settingsBuilder) throws IOException { /** Builder for PagesSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(PagesStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(PagesStubSettings.newBuilder()); - } - protected Builder(PagesSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -173,11 +171,15 @@ protected Builder(PagesStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(PagesStubSettings.newBuilder()); + } + public PagesStubSettings.Builder getStubSettingsBuilder() { return ((PagesStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java index c97b36bd7..cd9278e0e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -32,10 +33,11 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. @@ -43,16 +45,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the sessionEntityTypesClient object to clean up resources + *

Note: close() needs to be called on the SessionEntityTypesClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). * @@ -81,30 +74,28 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * SessionEntityTypesSettings sessionEntityTypesSettings =
  *     SessionEntityTypesSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
  * SessionEntityTypesClient sessionEntityTypesClient =
  *     SessionEntityTypesClient.create(sessionEntityTypesSettings);
- * 
- * 
+ * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * SessionEntityTypesSettings sessionEntityTypesSettings =
  *     SessionEntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
  * SessionEntityTypesClient sessionEntityTypesClient =
  *     SessionEntityTypesClient.create(sessionEntityTypesSettings);
- * 
- * 
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class SessionEntityTypesClient implements BackgroundResource { private final SessionEntityTypesSettings settings; private final SessionEntityTypesStub stub; @@ -125,7 +116,7 @@ public static final SessionEntityTypesClient create(SessionEntityTypesSettings s /** * Constructs an instance of SessionEntityTypesClient, using the given stub for making calls. This - * is for advanced usage - prefer to use SessionEntityTypesSettings}. + * is for advanced usage - prefer using create(SessionEntityTypesSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SessionEntityTypesClient create(SessionEntityTypesStub stub) { @@ -157,21 +148,10 @@ public SessionEntityTypesStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The session to list all session entity types from. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location @@ -182,26 +162,15 @@ public SessionEntityTypesStub getStub() { public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionName parent) { ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listSessionEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The session to list all session entity types from. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location @@ -215,24 +184,10 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(String p return listSessionEntityTypes(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (SessionEntityType element : sessionEntityTypesClient.listSessionEntityTypes(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -241,76 +196,32 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( return listSessionEntityTypesPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListSessionEntityTypesPagedResponse> future = sessionEntityTypesClient.listSessionEntityTypesPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (SessionEntityType element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listSessionEntityTypesPagedCallable() { return stub.listSessionEntityTypesPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all session entity types in the specified session. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListSessionEntityTypesResponse response = sessionEntityTypesClient.listSessionEntityTypesCallable().call(request);
-   *     for (SessionEntityType element : response.getSessionEntityTypesList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listSessionEntityTypesCallable() { return stub.listSessionEntityTypesCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the session entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>` or `projects/<Project @@ -322,24 +233,15 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( public final SessionEntityType getSessionEntityType(SessionEntityTypeName name) { GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); return getSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the session entity type. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>` or `projects/<Project @@ -354,22 +256,10 @@ public final SessionEntityType getSessionEntityType(String name) { return getSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -377,85 +267,53 @@ public final SessionEntityType getSessionEntityType(GetSessionEntityTypeRequest return getSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.getSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   SessionEntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getSessionEntityTypeCallable() { return stub.getSessionEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent, sessionEntityType);
-   * }
-   * 
- * * @param parent Required. The session to create a session entity type for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param sessionEntityType Required. The session entity type to create. + * @param session_entity_type Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( SessionName parent, SessionEntityType sessionEntityType) { CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setSessionEntityType(sessionEntityType) .build(); return createSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(parent.toString(), sessionEntityType);
-   * }
-   * 
- * * @param parent Required. The session to create a session entity type for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param sessionEntityType Required. The session entity type to create. + * @param session_entity_type Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( @@ -468,26 +326,12 @@ public final SessionEntityType createSessionEntityType( return createSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -495,55 +339,31 @@ public final SessionEntityType createSessionEntityType(CreateSessionEntityTypeRe return createSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a session entity type. * *

If the specified session entity type already exists, overrides the session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionName parent = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.createSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   SessionEntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createSessionEntityTypeCallable() { return stub.createSessionEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(sessionEntityType, updateMask);
-   * }
-   * 
- * - * @param sessionEntityType Required. The session entity type to update. Format: + * @param session_entity_type Required. The session entity type to update. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>`. If `Environment ID` is not specified, we assume * default 'draft' environment. - * @param updateMask The mask to control which fields get updated. + * @param update_mask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType updateSessionEntityType( @@ -556,22 +376,10 @@ public final SessionEntityType updateSessionEntityType( return updateSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -579,42 +387,21 @@ public final SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRe return updateSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
-   *   UpdateSessionEntityTypeRequest request = UpdateSessionEntityTypeRequest.newBuilder()
-   *     .setSessionEntityType(sessionEntityType)
-   *     .build();
-   *   ApiFuture<SessionEntityType> future = sessionEntityTypesClient.updateSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   SessionEntityType response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateSessionEntityTypeCallable() { return stub.updateSessionEntityTypeCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   sessionEntityTypesClient.deleteSessionEntityType(name);
-   * }
-   * 
- * * @param name Required. The name of the session entity type to delete. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or @@ -627,24 +414,15 @@ public final SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRe public final void deleteSessionEntityType(SessionEntityTypeName name) { DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); deleteSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   sessionEntityTypesClient.deleteSessionEntityType(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the session entity type to delete. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or @@ -660,22 +438,10 @@ public final void deleteSessionEntityType(String name) { deleteSessionEntityType(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * - *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   sessionEntityTypesClient.deleteSessionEntityType(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -683,23 +449,11 @@ public final void deleteSessionEntityType(DeleteSessionEntityTypeRequest request deleteSessionEntityTypeCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified session entity type. * *

Sample code: - * - *


-   * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
-   *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
-   *   DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = sessionEntityTypesClient.deleteSessionEntityTypeCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteSessionEntityTypeCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesSettings.java index 803ee9c52..901eb8107 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionEntityTypesClient}. * @@ -51,23 +52,25 @@ * *

For example, to set the total timeout of getSessionEntityType to 30 seconds: * - *

- * 
+ * 
{@code
  * SessionEntityTypesSettings.Builder sessionEntityTypesSettingsBuilder =
  *     SessionEntityTypesSettings.newBuilder();
  * sessionEntityTypesSettingsBuilder
  *     .getSessionEntityTypeSettings()
  *     .setRetrySettings(
- *         sessionEntityTypesSettingsBuilder.getSessionEntityTypeSettings().getRetrySettings().toBuilder()
+ *         sessionEntityTypesSettingsBuilder
+ *             .getSessionEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * SessionEntityTypesSettings sessionEntityTypesSettings = sessionEntityTypesSettingsBuilder.build();
- * 
- * 
+ * SessionEntityTypesSettings sessionEntityTypesSettings = + * sessionEntityTypesSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class SessionEntityTypesSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listSessionEntityTypes. */ public PagedCallSettings< ListSessionEntityTypesRequest, @@ -161,18 +164,15 @@ protected SessionEntityTypesSettings(Builder settingsBuilder) throws IOException /** Builder for SessionEntityTypesSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(SessionEntityTypesStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(SessionEntityTypesStubSettings.newBuilder()); - } - protected Builder(SessionEntityTypesSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -181,11 +181,15 @@ protected Builder(SessionEntityTypesStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(SessionEntityTypesStubSettings.newBuilder()); + } + public SessionEntityTypesStubSettings.Builder getStubSettingsBuilder() { return ((SessionEntityTypesStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java index b04f28d08..1494cea1c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -25,7 +26,7 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: A session represents an interaction with a user. You retrieve user input and * pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to @@ -34,21 +35,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- *   QueryInput queryInput = QueryInput.newBuilder().build();
- *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
- *     .setSession(session.toString())
- *     .setQueryInput(queryInput)
- *     .build();
- *   DetectIntentResponse response = sessionsClient.detectIntent(request);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the sessionsClient object to clean up resources such as + *

Note: close() needs to be called on the SessionsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -76,30 +63,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * SessionsSettings sessionsSettings =
  *     SessionsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * SessionsClient sessionsClient =
- *     SessionsClient.create(sessionsSettings);
- * 
- * 
+ * SessionsClient sessionsClient = SessionsClient.create(sessionsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * SessionsSettings sessionsSettings =
  *     SessionsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * SessionsClient sessionsClient =
- *     SessionsClient.create(sessionsSettings);
- * 
- * 
+ * SessionsClient sessionsClient = SessionsClient.create(sessionsSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class SessionsClient implements BackgroundResource { private final SessionsSettings settings; private final SessionsStub stub; @@ -119,7 +102,7 @@ public static final SessionsClient create(SessionsSettings settings) throws IOEx /** * Constructs an instance of SessionsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use SessionsSettings}. + * advanced usage - prefer using create(SessionsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final SessionsClient create(SessionsStub stub) { @@ -150,26 +133,12 @@ public SessionsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Processes a natural language query and returns structured, actionable data as a result. This * method is not idempotent, because it may cause session entity types to be updated, which in * turn might affect results of future queries. * - *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   DetectIntentResponse response = sessionsClient.detectIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -177,79 +146,35 @@ public final DetectIntentResponse detectIntent(DetectIntentRequest request) { return detectIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Processes a natural language query and returns structured, actionable data as a result. This * method is not idempotent, because it may cause session entity types to be updated, which in * turn might affect results of future queries. * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   ApiFuture<DetectIntentResponse> future = sessionsClient.detectIntentCallable().futureCall(request);
-   *   // Do something
-   *   DetectIntentResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable detectIntentCallable() { return stub.detectIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Processes a natural language query in audio format in a streaming fashion and returns * structured, actionable data as a result. This method is only available via the gRPC API (not * REST). * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   BidiStream<StreamingDetectIntentRequest, StreamingDetectIntentResponse> bidiStream =
-   *       sessionsClient.streamingDetectIntentCallable().call();
-   *
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   StreamingDetectIntentRequest request = StreamingDetectIntentRequest.newBuilder()
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   bidiStream.send(request);
-   *   for (StreamingDetectIntentResponse response : bidiStream) {
-   *     // Do something when receive a response
-   *   }
-   * }
-   * 
*/ public final BidiStreamingCallable streamingDetectIntentCallable() { return stub.streamingDetectIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns preliminary intent match results, doesn't change the session status. * - *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   MatchIntentRequest request = MatchIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   MatchIntentResponse response = sessionsClient.matchIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -257,31 +182,17 @@ public final MatchIntentResponse matchIntent(MatchIntentRequest request) { return matchIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns preliminary intent match results, doesn't change the session status. * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
-   *   QueryInput queryInput = QueryInput.newBuilder().build();
-   *   MatchIntentRequest request = MatchIntentRequest.newBuilder()
-   *     .setSession(session.toString())
-   *     .setQueryInput(queryInput)
-   *     .build();
-   *   ApiFuture<MatchIntentResponse> future = sessionsClient.matchIntentCallable().futureCall(request);
-   *   // Do something
-   *   MatchIntentResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable matchIntentCallable() { return stub.matchIntentCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Fulfills a matched intent returned by * [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent]. Must be called after @@ -289,15 +200,6 @@ public final UnaryCallable matchIntentC * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the * behavior is undefined. * - *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
-   *   FulfillIntentResponse response = sessionsClient.fulfillIntent(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -305,7 +207,7 @@ public final FulfillIntentResponse fulfillIntent(FulfillIntentRequest request) { return fulfillIntentCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Fulfills a matched intent returned by * [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent]. Must be called after @@ -314,15 +216,6 @@ public final FulfillIntentResponse fulfillIntent(FulfillIntentRequest request) { * behavior is undefined. * *

Sample code: - * - *


-   * try (SessionsClient sessionsClient = SessionsClient.create()) {
-   *   FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build();
-   *   ApiFuture<FulfillIntentResponse> future = sessionsClient.fulfillIntentCallable().futureCall(request);
-   *   // Do something
-   *   FulfillIntentResponse response = future.get();
-   * }
-   * 
*/ public final UnaryCallable fulfillIntentCallable() { return stub.fulfillIntentCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsSettings.java index 709df6271..c8eaf4bc3 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -31,7 +32,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionsClient}. * @@ -48,23 +49,23 @@ * *

For example, to set the total timeout of detectIntent to 30 seconds: * - *

- * 
- * SessionsSettings.Builder sessionsSettingsBuilder =
- *     SessionsSettings.newBuilder();
+ * 
{@code
+ * SessionsSettings.Builder sessionsSettingsBuilder = SessionsSettings.newBuilder();
  * sessionsSettingsBuilder
  *     .detectIntentSettings()
  *     .setRetrySettings(
- *         sessionsSettingsBuilder.detectIntentSettings().getRetrySettings().toBuilder()
+ *         sessionsSettingsBuilder
+ *             .detectIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * SessionsSettings sessionsSettings = sessionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class SessionsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to detectIntent. */ public UnaryCallSettings detectIntentSettings() { return ((SessionsStubSettings) getStubSettings()).detectIntentSettings(); @@ -145,18 +146,15 @@ protected SessionsSettings(Builder settingsBuilder) throws IOException { /** Builder for SessionsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(SessionsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(SessionsStubSettings.newBuilder()); - } - protected Builder(SessionsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -165,11 +163,15 @@ protected Builder(SessionsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(SessionsStubSettings.newBuilder()); + } + public SessionsStubSettings.Builder getStubSettingsBuilder() { return ((SessionsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java index 4e8361932..065e3eeba 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -32,10 +33,11 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing * [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. @@ -43,16 +45,7 @@ *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the transitionRouteGroupsClient object to clean up + *

Note: close() needs to be called on the TransitionRouteGroupsClient object to clean up * resources such as threads. In the example above, try-with-resources is used, which automatically * calls close(). * @@ -81,30 +74,28 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsSettings transitionRouteGroupsSettings =
  *     TransitionRouteGroupsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
  * TransitionRouteGroupsClient transitionRouteGroupsClient =
  *     TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
- * 
- * 
+ * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsSettings transitionRouteGroupsSettings =
  *     TransitionRouteGroupsSettings.newBuilder().setEndpoint(myEndpoint).build();
  * TransitionRouteGroupsClient transitionRouteGroupsClient =
  *     TransitionRouteGroupsClient.create(transitionRouteGroupsSettings);
- * 
- * 
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class TransitionRouteGroupsClient implements BackgroundResource { private final TransitionRouteGroupsSettings settings; private final TransitionRouteGroupsStub stub; @@ -125,7 +116,7 @@ public static final TransitionRouteGroupsClient create(TransitionRouteGroupsSett /** * Constructs an instance of TransitionRouteGroupsClient, using the given stub for making calls. - * This is for advanced usage - prefer to use TransitionRouteGroupsSettings}. + * This is for advanced usage - prefer using create(TransitionRouteGroupsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final TransitionRouteGroupsClient create(TransitionRouteGroupsStub stub) { @@ -157,21 +148,10 @@ public TransitionRouteGroupsStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all transition route groups for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. @@ -180,26 +160,15 @@ public TransitionRouteGroupsStub getStub() { public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(FlowName parent) { ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listTransitionRouteGroups(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The flow to list all transition route groups for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. @@ -211,24 +180,10 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(St return listTransitionRouteGroups(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (TransitionRouteGroup element : transitionRouteGroupsClient.listTransitionRouteGroups(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -237,25 +192,11 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( return listTransitionRouteGroupsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListTransitionRouteGroupsPagedResponse> future = transitionRouteGroupsClient.listTransitionRouteGroupsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (TransitionRouteGroup element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable< ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsPagedResponse> @@ -263,52 +204,22 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( return stub.listTransitionRouteGroupsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all transition route groups in the specified flow. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListTransitionRouteGroupsResponse response = transitionRouteGroupsClient.listTransitionRouteGroupsCallable().call(request);
-   *     for (TransitionRouteGroup element : response.getTransitionRouteGroupsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listTransitionRouteGroupsCallable() { return stub.listTransitionRouteGroupsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -318,25 +229,16 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( public final TransitionRouteGroup getTransitionRouteGroup(TransitionRouteGroupName name) { GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); return getTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -349,23 +251,11 @@ public final TransitionRouteGroup getTransitionRouteGroup(String name) { return getTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -374,82 +264,50 @@ public final TransitionRouteGroup getTransitionRouteGroup( return getTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.getTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   TransitionRouteGroup response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getTransitionRouteGroupCallable() { return stub.getTransitionRouteGroupCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in * the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent, transitionRouteGroup);
-   * }
-   * 
- * * @param parent Required. The flow to create an * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transitionRouteGroup Required. The transition route group to create. + * @param transition_route_group Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( FlowName parent, TransitionRouteGroup transitionRouteGroup) { CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setTransitionRouteGroup(transitionRouteGroup) .build(); return createTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in * the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(parent.toString(), transitionRouteGroup);
-   * }
-   * 
- * * @param parent Required. The flow to create an * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transitionRouteGroup Required. The transition route group to create. + * @param transition_route_group Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( @@ -462,25 +320,11 @@ public final TransitionRouteGroup createTransitionRouteGroup( return createTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in * the specified flow. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.createTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -489,49 +333,25 @@ public final TransitionRouteGroup createTransitionRouteGroup( return createTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in * the specified flow. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.createTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   TransitionRouteGroup response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createTransitionRouteGroupCallable() { return stub.createTransitionRouteGroupCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(transitionRouteGroup, updateMask);
-   * }
-   * 
- * - * @param transitionRouteGroup Required. The transition route group to update. - * @param updateMask The mask to control which fields get updated. + * @param transition_route_group Required. The transition route group to update. + * @param update_mask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup updateTransitionRouteGroup( @@ -544,23 +364,11 @@ public final TransitionRouteGroup updateTransitionRouteGroup( return updateTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   TransitionRouteGroup response = transitionRouteGroupsClient.updateTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -569,44 +377,23 @@ public final TransitionRouteGroup updateTransitionRouteGroup( return updateTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build();
-   *   UpdateTransitionRouteGroupRequest request = UpdateTransitionRouteGroupRequest.newBuilder()
-   *     .setTransitionRouteGroup(transitionRouteGroup)
-   *     .build();
-   *   ApiFuture<TransitionRouteGroup> future = transitionRouteGroupsClient.updateTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   TransitionRouteGroup response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateTransitionRouteGroupCallable() { return stub.updateTransitionRouteGroupCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(name);
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -616,25 +403,16 @@ public final TransitionRouteGroup updateTransitionRouteGroup( public final void deleteTransitionRouteGroup(TransitionRouteGroupName name) { DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder() - .setName(name == null ? null : name.toString()) + .setName(Objects.isNull(name) ? null : name.toString()) .build(); deleteTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] to delete. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent @@ -647,23 +425,11 @@ public final void deleteTransitionRouteGroup(String name) { deleteTransitionRouteGroup(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   transitionRouteGroupsClient.deleteTransitionRouteGroup(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -671,24 +437,12 @@ public final void deleteTransitionRouteGroup(DeleteTransitionRouteGroupRequest r deleteTransitionRouteGroupCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * *

Sample code: - * - *


-   * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
-   *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
-   *   DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = transitionRouteGroupsClient.deleteTransitionRouteGroupCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteTransitionRouteGroupCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsSettings.java index 729f2af46..826026d28 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link TransitionRouteGroupsClient}. * @@ -51,23 +52,25 @@ * *

For example, to set the total timeout of getTransitionRouteGroup to 30 seconds: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsSettings.Builder transitionRouteGroupsSettingsBuilder =
  *     TransitionRouteGroupsSettings.newBuilder();
  * transitionRouteGroupsSettingsBuilder
  *     .getTransitionRouteGroupSettings()
  *     .setRetrySettings(
- *         transitionRouteGroupsSettingsBuilder.getTransitionRouteGroupSettings().getRetrySettings().toBuilder()
+ *         transitionRouteGroupsSettingsBuilder
+ *             .getTransitionRouteGroupSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * TransitionRouteGroupsSettings transitionRouteGroupsSettings = transitionRouteGroupsSettingsBuilder.build();
- * 
- * 
+ * TransitionRouteGroupsSettings transitionRouteGroupsSettings = + * transitionRouteGroupsSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class TransitionRouteGroupsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listTransitionRouteGroups. */ public PagedCallSettings< ListTransitionRouteGroupsRequest, @@ -167,18 +170,15 @@ protected TransitionRouteGroupsSettings(Builder settingsBuilder) throws IOExcept /** Builder for TransitionRouteGroupsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(TransitionRouteGroupsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(TransitionRouteGroupsStubSettings.newBuilder()); - } - protected Builder(TransitionRouteGroupsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -187,11 +187,15 @@ protected Builder(TransitionRouteGroupsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(TransitionRouteGroupsStubSettings.newBuilder()); + } + public TransitionRouteGroupsStubSettings.Builder getStubSettingsBuilder() { return ((TransitionRouteGroupsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java index 1dcd21179..a707d7793 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -37,26 +38,18 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- *   Version response = versionsClient.getVersion(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the versionsClient object to clean up resources such as + *

Note: close() needs to be called on the VersionsClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -84,30 +77,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * VersionsSettings versionsSettings =
  *     VersionsSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * VersionsClient versionsClient =
- *     VersionsClient.create(versionsSettings);
- * 
- * 
+ * VersionsClient versionsClient = VersionsClient.create(versionsSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * VersionsSettings versionsSettings =
  *     VersionsSettings.newBuilder().setEndpoint(myEndpoint).build();
- * VersionsClient versionsClient =
- *     VersionsClient.create(versionsSettings);
- * 
- * 
+ * VersionsClient versionsClient = VersionsClient.create(versionsSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class VersionsClient implements BackgroundResource { private final VersionsSettings settings; private final VersionsStub stub; @@ -128,7 +117,7 @@ public static final VersionsClient create(VersionsSettings settings) throws IOEx /** * Constructs an instance of VersionsClient, using the given stub for making calls. This is for - * advanced usage - prefer to use VersionsSettings}. + * advanced usage - prefer using create(VersionsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final VersionsClient create(VersionsStub stub) { @@ -165,28 +154,15 @@ public VersionsStub getStub() { * Returns the OperationsClient that can be used to query the status of a long-running operation * returned by another API method call. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient() { return operationsClient; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Version element : versionsClient.listVersions(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all * versions for. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/flows/<Flow ID>`. @@ -195,27 +171,16 @@ public final OperationsClient getOperationsClient() { public final ListVersionsPagedResponse listVersions(FlowName parent) { ListVersionsRequest request = ListVersionsRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listVersions(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   for (Version element : versionsClient.listVersions(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to list all * versions for. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/flows/<Flow ID>`. @@ -226,25 +191,11 @@ public final ListVersionsPagedResponse listVersions(String parent) { return listVersions(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Version element : versionsClient.listVersions(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -252,77 +203,33 @@ public final ListVersionsPagedResponse listVersions(ListVersionsRequest request) return listVersionsPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListVersionsPagedResponse> future = versionsClient.listVersionsPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Version element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listVersionsPagedCallable() { return stub.listVersionsPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all versions in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   ListVersionsRequest request = ListVersionsRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListVersionsResponse response = versionsClient.listVersionsCallable().call(request);
-   *     for (Version element : response.getVersionsList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listVersionsCallable() { return stub.listVersionsCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   Version response = versionsClient.getVersion(name);
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -330,23 +237,16 @@ public final UnaryCallable listVersio */ public final Version getVersion(VersionName name) { GetVersionRequest request = - GetVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetVersionRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   Version response = versionsClient.getVersion(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -357,22 +257,10 @@ public final Version getVersion(String name) { return getVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   GetVersionRequest request = GetVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Version response = versionsClient.getVersion(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -380,84 +268,48 @@ public final Version getVersion(GetVersionRequest request) { return getVersionCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   GetVersionRequest request = GetVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Version> future = versionsClient.getVersionCallable().futureCall(request);
-   *   // Do something
-   *   Version response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getVersionCallable() { return stub.getVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   Version response = versionsClient.createVersionAsync(parent, version).get();
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an * [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param version Required. The version to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createVersionAsync( FlowName parent, Version version) { CreateVersionRequest request = CreateVersionRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setVersion(version) .build(); return createVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   Version response = versionsClient.createVersionAsync(parent.toString(), version).get();
-   * }
-   * 
- * * @param parent Required. The [Flow][google.cloud.dialogflow.cx.v3beta1.Flow] to create an * [Version][google.cloud.dialogflow.cx.v3beta1.Version] for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>`. * @param version Required. The version to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createVersionAsync( String parent, Version version) { CreateVersionRequest request = @@ -465,103 +317,48 @@ public final OperationFuture createVers return createVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setVersion(version)
-   *     .build();
-   *   Version response = versionsClient.createVersionAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture createVersionAsync( CreateVersionRequest request) { return createVersionOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setVersion(version)
-   *     .build();
-   *   OperationFuture<Version, CreateVersionOperationMetadata> future = versionsClient.createVersionOperationCallable().futureCall(request);
-   *   // Do something
-   *   Version response = future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable createVersionOperationCallable() { return stub.createVersionOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified * [Flow][google.cloud.dialogflow.cx.v3beta1.Flow]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
-   *   Version version = Version.newBuilder().build();
-   *   CreateVersionRequest request = CreateVersionRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setVersion(version)
-   *     .build();
-   *   ApiFuture<Operation> future = versionsClient.createVersionCallable().futureCall(request);
-   *   // Do something
-   *   Operation response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createVersionCallable() { return stub.createVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   Version version = Version.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Version response = versionsClient.updateVersion(version, updateMask);
-   * }
-   * 
- * * @param version Required. The version to update. - * @param updateMask Required. The mask to control which fields get updated. Currently only + * @param update_mask Required. The mask to control which fields get updated. Currently only * `description` and `display_name` can be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -571,24 +368,10 @@ public final Version updateVersion(Version version, FieldMask updateMask) { return updateVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   Version version = Version.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
-   *     .setVersion(version)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   Version response = versionsClient.updateVersion(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -596,43 +379,20 @@ public final Version updateVersion(UpdateVersionRequest request) { return updateVersionCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   Version version = Version.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   UpdateVersionRequest request = UpdateVersionRequest.newBuilder()
-   *     .setVersion(version)
-   *     .setUpdateMask(updateMask)
-   *     .build();
-   *   ApiFuture<Version> future = versionsClient.updateVersionCallable().futureCall(request);
-   *   // Do something
-   *   Version response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateVersionCallable() { return stub.updateVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.deleteVersion(name);
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to * delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -640,23 +400,16 @@ public final UnaryCallable updateVersionCallable( */ public final void deleteVersion(VersionName name) { DeleteVersionRequest request = - DeleteVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteVersionRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.deleteVersion(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the [Version][google.cloud.dialogflow.cx.v3beta1.Version] to * delete. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>/versions/<Version ID>`. @@ -667,22 +420,10 @@ public final void deleteVersion(String name) { deleteVersion(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   versionsClient.deleteVersion(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -690,144 +431,73 @@ public final void deleteVersion(DeleteVersionRequest request) { deleteVersionCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   DeleteVersionRequest request = DeleteVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = versionsClient.deleteVersionCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteVersionCallable() { return stub.deleteVersionCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.loadVersionAsync(name).get();
-   * }
-   * 
- * * @param name Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to * draft version. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture loadVersionAsync(VersionName name) { LoadVersionRequest request = - LoadVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + LoadVersionRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return loadVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   versionsClient.loadVersionAsync(name.toString()).get();
-   * }
-   * 
- * * @param name Required. The [Version][google.cloud.dialogflow.cx.v3beta1.Version] to be loaded to * draft version. Format: `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture loadVersionAsync(String name) { LoadVersionRequest request = LoadVersionRequest.newBuilder().setName(name).build(); return loadVersionAsync(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * - *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   versionsClient.loadVersionAsync(request).get();
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture loadVersionAsync(LoadVersionRequest request) { return loadVersionOperationCallable().futureCall(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   OperationFuture<Empty, Struct> future = versionsClient.loadVersionOperationCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable loadVersionOperationCallable() { return stub.loadVersionOperationCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Loads a specified version to draft version. * *

Sample code: - * - *


-   * try (VersionsClient versionsClient = VersionsClient.create()) {
-   *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
-   *   LoadVersionRequest request = LoadVersionRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Operation> future = versionsClient.loadVersionCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable loadVersionCallable() { return stub.loadVersionCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsSettings.java index d4d987539..f5c6b5e33 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; @@ -37,7 +38,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link VersionsClient}. * @@ -54,23 +55,23 @@ * *

For example, to set the total timeout of getVersion to 30 seconds: * - *

- * 
- * VersionsSettings.Builder versionsSettingsBuilder =
- *     VersionsSettings.newBuilder();
+ * 
{@code
+ * VersionsSettings.Builder versionsSettingsBuilder = VersionsSettings.newBuilder();
  * versionsSettingsBuilder
  *     .getVersionSettings()
  *     .setRetrySettings(
- *         versionsSettingsBuilder.getVersionSettings().getRetrySettings().toBuilder()
+ *         versionsSettingsBuilder
+ *             .getVersionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * VersionsSettings versionsSettings = versionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class VersionsSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listVersions. */ public PagedCallSettings listVersionsSettings() { @@ -88,8 +89,6 @@ public UnaryCallSettings createVersionSettings( } /** Returns the object with the settings used for calls to createVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings createVersionOperationSettings() { return ((VersionsStubSettings) getStubSettings()).createVersionOperationSettings(); @@ -111,8 +110,6 @@ public UnaryCallSettings loadVersionSettings() { } /** Returns the object with the settings used for calls to loadVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings loadVersionOperationSettings() { return ((VersionsStubSettings) getStubSettings()).loadVersionOperationSettings(); } @@ -176,18 +173,15 @@ protected VersionsSettings(Builder settingsBuilder) throws IOException { /** Builder for VersionsSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(VersionsStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(VersionsStubSettings.newBuilder()); - } - protected Builder(VersionsSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -196,11 +190,15 @@ protected Builder(VersionsStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(VersionsStubSettings.newBuilder()); + } + public VersionsStubSettings.Builder getStubSettingsBuilder() { return ((VersionsStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * @@ -231,8 +229,6 @@ public UnaryCallSettings.Builder createVersionS } /** Returns the builder for the settings used for calls to createVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder< CreateVersionRequest, Version, CreateVersionOperationMetadata> createVersionOperationSettings() { @@ -255,8 +251,6 @@ public UnaryCallSettings.Builder loadVersionSetti } /** Returns the builder for the settings used for calls to loadVersion. */ - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") public OperationCallSettings.Builder loadVersionOperationSettings() { return getStubSettingsBuilder().loadVersionOperationSettings(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java index fac122291..e28a038f5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.ApiFunction; @@ -32,26 +33,18 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND SERVICE +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Service Description: Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. * *

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * - *

- * 
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- *   Webhook response = webhooksClient.getWebhook(name);
- * }
- * 
- * 
- * - *

Note: close() needs to be called on the webhooksClient object to clean up resources such as + *

Note: close() needs to be called on the WebhooksClient object to clean up resources such as * threads. In the example above, try-with-resources is used, which automatically calls close(). * *

The surface of this class includes several types of Java methods for each of the API's @@ -79,30 +72,26 @@ * *

To customize credentials: * - *

- * 
+ * 
{@code
  * WebhooksSettings webhooksSettings =
  *     WebhooksSettings.newBuilder()
  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
  *         .build();
- * WebhooksClient webhooksClient =
- *     WebhooksClient.create(webhooksSettings);
- * 
- * 
+ * WebhooksClient webhooksClient = WebhooksClient.create(webhooksSettings); + * }
* - * To customize the endpoint: + *

To customize the endpoint: * - *

- * 
+ * 
{@code
  * WebhooksSettings webhooksSettings =
  *     WebhooksSettings.newBuilder().setEndpoint(myEndpoint).build();
- * WebhooksClient webhooksClient =
- *     WebhooksClient.create(webhooksSettings);
- * 
- * 
+ * WebhooksClient webhooksClient = WebhooksClient.create(webhooksSettings); + * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator") public class WebhooksClient implements BackgroundResource { private final WebhooksSettings settings; private final WebhooksStub stub; @@ -122,7 +111,7 @@ public static final WebhooksClient create(WebhooksSettings settings) throws IOEx /** * Constructs an instance of WebhooksClient, using the given stub for making calls. This is for - * advanced usage - prefer to use WebhooksSettings}. + * advanced usage - prefer using create(WebhooksSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final WebhooksClient create(WebhooksStub stub) { @@ -153,21 +142,10 @@ public WebhooksStub getStub() { return stub; } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Webhook element : webhooksClient.listWebhooks(parent).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all webhooks for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -175,26 +153,15 @@ public WebhooksStub getStub() { public final ListWebhooksPagedResponse listWebhooks(AgentName parent) { ListWebhooksRequest request = ListWebhooksRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .build(); return listWebhooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   for (Webhook element : webhooksClient.listWebhooks(parent.toString()).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param parent Required. The agent to list all webhooks for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -204,24 +171,10 @@ public final ListWebhooksPagedResponse listWebhooks(String parent) { return listWebhooks(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   for (Webhook element : webhooksClient.listWebhooks(request).iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -229,98 +182,47 @@ public final ListWebhooksPagedResponse listWebhooks(ListWebhooksRequest request) return listWebhooksPagedCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   ApiFuture<ListWebhooksPagedResponse> future = webhooksClient.listWebhooksPagedCallable().futureCall(request);
-   *   // Do something
-   *   for (Webhook element : future.get().iterateAll()) {
-   *     // doThingsWith(element);
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listWebhooksPagedCallable() { return stub.listWebhooksPagedCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all webhooks in the specified agent. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   ListWebhooksRequest request = ListWebhooksRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .build();
-   *   while (true) {
-   *     ListWebhooksResponse response = webhooksClient.listWebhooksCallable().call(request);
-   *     for (Webhook element : response.getWebhooksList()) {
-   *       // doThingsWith(element);
-   *     }
-   *     String nextPageToken = response.getNextPageToken();
-   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
-   *       request = request.toBuilder().setPageToken(nextPageToken).build();
-   *     } else {
-   *       break;
-   *     }
-   *   }
-   * }
-   * 
*/ public final UnaryCallable listWebhooksCallable() { return stub.listWebhooksCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   Webhook response = webhooksClient.getWebhook(name);
-   * }
-   * 
- * * @param name Required. The name of the webhook. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Webhook getWebhook(WebhookName name) { GetWebhookRequest request = - GetWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + GetWebhookRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); return getWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   Webhook response = webhooksClient.getWebhook(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the webhook. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -330,22 +232,10 @@ public final Webhook getWebhook(String name) { return getWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   GetWebhookRequest request = GetWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   Webhook response = webhooksClient.getWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -353,42 +243,20 @@ public final Webhook getWebhook(GetWebhookRequest request) { return getWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves the specified webhook. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   GetWebhookRequest request = GetWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Webhook> future = webhooksClient.getWebhookCallable().futureCall(request);
-   *   // Do something
-   *   Webhook response = future.get();
-   * }
-   * 
*/ public final UnaryCallable getWebhookCallable() { return stub.getWebhookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   Webhook response = webhooksClient.createWebhook(parent, webhook);
-   * }
-   * 
- * * @param parent Required. The agent to create a webhook for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param webhook Required. The webhook to create. @@ -397,26 +265,16 @@ public final UnaryCallable getWebhookCallable() { public final Webhook createWebhook(AgentName parent, Webhook webhook) { CreateWebhookRequest request = CreateWebhookRequest.newBuilder() - .setParent(parent == null ? null : parent.toString()) + .setParent(Objects.isNull(parent) ? null : parent.toString()) .setWebhook(webhook) .build(); return createWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   Webhook response = webhooksClient.createWebhook(parent.toString(), webhook);
-   * }
-   * 
- * * @param parent Required. The agent to create a webhook for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. * @param webhook Required. The webhook to create. @@ -428,24 +286,10 @@ public final Webhook createWebhook(String parent, Webhook webhook) { return createWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setWebhook(webhook)
-   *     .build();
-   *   Webhook response = webhooksClient.createWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -453,47 +297,23 @@ public final Webhook createWebhook(CreateWebhookRequest request) { return createWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a webhook in the specified agent. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   CreateWebhookRequest request = CreateWebhookRequest.newBuilder()
-   *     .setParent(parent.toString())
-   *     .setWebhook(webhook)
-   *     .build();
-   *   ApiFuture<Webhook> future = webhooksClient.createWebhookCallable().futureCall(request);
-   *   // Do something
-   *   Webhook response = future.get();
-   * }
-   * 
*/ public final UnaryCallable createWebhookCallable() { return stub.createWebhookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   FieldMask updateMask = FieldMask.newBuilder().build();
-   *   Webhook response = webhooksClient.updateWebhook(webhook, updateMask);
-   * }
-   * 
- * * @param webhook Required. The webhook to update. - * @param updateMask The mask to control which fields get updated. If the mask is not present, all - * fields will be updated. + * @param update_mask The mask to control which fields get updated. If the mask is not present, + * all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) { @@ -502,22 +322,10 @@ public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) { return updateWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
-   *     .setWebhook(webhook)
-   *     .build();
-   *   Webhook response = webhooksClient.updateWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -525,64 +333,36 @@ public final Webhook updateWebhook(UpdateWebhookRequest request) { return updateWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified webhook. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   Webhook webhook = Webhook.newBuilder().build();
-   *   UpdateWebhookRequest request = UpdateWebhookRequest.newBuilder()
-   *     .setWebhook(webhook)
-   *     .build();
-   *   ApiFuture<Webhook> future = webhooksClient.updateWebhookCallable().futureCall(request);
-   *   // Do something
-   *   Webhook response = future.get();
-   * }
-   * 
*/ public final UnaryCallable updateWebhookCallable() { return stub.updateWebhookCallable(); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   webhooksClient.deleteWebhook(name);
-   * }
-   * 
- * * @param name Required. The name of the webhook to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteWebhook(WebhookName name) { DeleteWebhookRequest request = - DeleteWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + DeleteWebhookRequest.newBuilder() + .setName(Objects.isNull(name) ? null : name.toString()) + .build(); deleteWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   webhooksClient.deleteWebhook(name.toString());
-   * }
-   * 
- * * @param name Required. The name of the webhook to delete. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>/webhooks/<Webhook ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails @@ -592,22 +372,10 @@ public final void deleteWebhook(String name) { deleteWebhook(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * - *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   webhooksClient.deleteWebhook(request);
-   * }
-   * 
- * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -615,23 +383,11 @@ public final void deleteWebhook(DeleteWebhookRequest request) { deleteWebhookCallable().call(request); } - // AUTO-GENERATED DOCUMENTATION AND METHOD + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes the specified webhook. * *

Sample code: - * - *


-   * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
-   *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
-   *   DeleteWebhookRequest request = DeleteWebhookRequest.newBuilder()
-   *     .setName(name.toString())
-   *     .build();
-   *   ApiFuture<Void> future = webhooksClient.deleteWebhookCallable().futureCall(request);
-   *   // Do something
-   *   future.get();
-   * }
-   * 
*/ public final UnaryCallable deleteWebhookCallable() { return stub.deleteWebhookCallable(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksSettings.java index e4545ff91..adeba06d0 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; @@ -34,7 +35,7 @@ import java.util.List; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link WebhooksClient}. * @@ -51,23 +52,23 @@ * *

For example, to set the total timeout of getWebhook to 30 seconds: * - *

- * 
- * WebhooksSettings.Builder webhooksSettingsBuilder =
- *     WebhooksSettings.newBuilder();
+ * 
{@code
+ * WebhooksSettings.Builder webhooksSettingsBuilder = WebhooksSettings.newBuilder();
  * webhooksSettingsBuilder
  *     .getWebhookSettings()
  *     .setRetrySettings(
- *         webhooksSettingsBuilder.getWebhookSettings().getRetrySettings().toBuilder()
+ *         webhooksSettingsBuilder
+ *             .getWebhookSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * WebhooksSettings webhooksSettings = webhooksSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") -@BetaApi +@Generated("by gapic-generator-java") public class WebhooksSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listWebhooks. */ public PagedCallSettings listWebhooksSettings() { @@ -153,18 +154,15 @@ protected WebhooksSettings(Builder settingsBuilder) throws IOException { /** Builder for WebhooksSettings. */ public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { super(WebhooksStubSettings.newBuilder(clientContext)); } - private static Builder createDefault() { - return new Builder(WebhooksStubSettings.newBuilder()); - } - protected Builder(WebhooksSettings settings) { super(settings.getStubSettings().toBuilder()); } @@ -173,11 +171,15 @@ protected Builder(WebhooksStubSettings.Builder stubSettings) { super(stubSettings); } + private static Builder createDefault() { + return new Builder(WebhooksStubSettings.newBuilder()); + } + public WebhooksStubSettings.Builder getStubSettingsBuilder() { return ((WebhooksStubSettings.Builder) getStubSettings()); } - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/package-info.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/package-info.java index 69e3355f5..c91a900f2 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/package-info.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/package-info.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,121 +15,48 @@ */ /** - * A client to Dialogflow API. + * The interfaces provided are listed below, along with usage samples. * - *

The interfaces provided are listed below, along with usage samples. - * - *

=========== PagesClient =========== - * - *

Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. - * - *

Sample for PagesClient: - * - *

- * 
- * try (PagesClient pagesClient = PagesClient.create()) {
- *   PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]");
- *   Page response = pagesClient.getPage(name);
- * }
- * 
- * 
- * - * =========== FlowsClient =========== - * - *

Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. - * - *

Sample for FlowsClient: - * - *

- * 
- * try (FlowsClient flowsClient = FlowsClient.create()) {
- *   AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Flow flow = Flow.newBuilder().build();
- *   Flow response = flowsClient.createFlow(parent, flow);
- * }
- * 
- * 
- * - * ============ AgentsClient ============ + *

======================= AgentsClient ======================= * *

Service Description: Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent]. * *

Sample for AgentsClient: * - *

- * 
- * try (AgentsClient agentsClient = AgentsClient.create()) {
- *   AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
- *   Agent response = agentsClient.getAgent(name);
- * }
- * 
- * 
- * - * ================= EntityTypesClient ================= + *

======================= EntityTypesClient ======================= * *

Service Description: Service for managing * [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType]. * *

Sample for EntityTypesClient: * - *

- * 
- * try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
- *   EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]");
- *   EntityType response = entityTypesClient.getEntityType(name);
- * }
- * 
- * 
- * - * ================== EnvironmentsClient ================== + *

======================= EnvironmentsClient ======================= * *

Service Description: Service for managing * [Environments][google.cloud.dialogflow.cx.v3beta1.Environment]. * *

Sample for EnvironmentsClient: * - *

- * 
- * try (EnvironmentsClient environmentsClient = EnvironmentsClient.create()) {
- *   EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
- *   Environment response = environmentsClient.getEnvironment(name);
- * }
- * 
- * 
+ *

======================= FlowsClient ======================= + * + *

Service Description: Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow]. * - * ============= IntentsClient ============= + *

Sample for FlowsClient: + * + *

======================= IntentsClient ======================= * *

Service Description: Service for managing * [Intents][google.cloud.dialogflow.cx.v3beta1.Intent]. * *

Sample for IntentsClient: * - *

- * 
- * try (IntentsClient intentsClient = IntentsClient.create()) {
- *   IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]");
- *   Intent response = intentsClient.getIntent(name);
- * }
- * 
- * 
- * - * ======================== SessionEntityTypesClient ======================== - * - *

Service Description: Service for managing - * [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. + *

======================= PagesClient ======================= * - *

Sample for SessionEntityTypesClient: + *

Service Description: Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page]. * - *

- * 
- * try (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
- *   SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]");
- *   SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
- * }
- * 
- * 
+ *

Sample for PagesClient: * - * ============== SessionsClient ============== + *

======================= SessionsClient ======================= * *

Service Description: A session represents an interaction with a user. You retrieve user input * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] @@ -137,69 +64,35 @@ * *

Sample for SessionsClient: * - *

- * 
- * try (SessionsClient sessionsClient = SessionsClient.create()) {
- *   SessionName session = SessionName.ofProjectLocationAgentSessionName("[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]");
- *   QueryInput queryInput = QueryInput.newBuilder().build();
- *   DetectIntentRequest request = DetectIntentRequest.newBuilder()
- *     .setSession(session.toString())
- *     .setQueryInput(queryInput)
- *     .build();
- *   DetectIntentResponse response = sessionsClient.detectIntent(request);
- * }
- * 
- * 
- * - * =========================== TransitionRouteGroupsClient =========================== + *

======================= SessionEntityTypesClient ======================= + * + *

Service Description: Service for managing + * [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType]. + * + *

Sample for SessionEntityTypesClient: + * + *

======================= TransitionRouteGroupsClient ======================= * *

Service Description: Service for managing * [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * *

Sample for TransitionRouteGroupsClient: * - *

- * 
- * try (TransitionRouteGroupsClient transitionRouteGroupsClient = TransitionRouteGroupsClient.create()) {
- *   TransitionRouteGroupName name = TransitionRouteGroupName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]");
- *   TransitionRouteGroup response = transitionRouteGroupsClient.getTransitionRouteGroup(name);
- * }
- * 
- * 
- * - * ============== VersionsClient ============== + *

======================= VersionsClient ======================= * *

Service Description: Service for managing * [Versions][google.cloud.dialogflow.cx.v3beta1.Version]. * *

Sample for VersionsClient: * - *

- * 
- * try (VersionsClient versionsClient = VersionsClient.create()) {
- *   VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]");
- *   Version response = versionsClient.getVersion(name);
- * }
- * 
- * 
- * - * ============== WebhooksClient ============== + *

======================= WebhooksClient ======================= * *

Service Description: Service for managing * [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook]. * *

Sample for WebhooksClient: - * - *

- * 
- * try (WebhooksClient webhooksClient = WebhooksClient.create()) {
- *   WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]");
- *   Webhook response = webhooksClient.getWebhook(name);
- * }
- * 
- * 
*/ -@Generated("by gapic-generator") +@Generated("by gapic-generator-java") package com.google.cloud.dialogflow.cx.v3beta1; import javax.annotation.Generated; diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStub.java index f325d0fde..371879a85 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -37,17 +37,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Agents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class AgentsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -76,7 +74,6 @@ public UnaryCallable deleteAgentCallable() { throw new UnsupportedOperationException("Not implemented: deleteAgentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable exportAgentOperationCallable() { throw new UnsupportedOperationException("Not implemented: exportAgentOperationCallable()"); @@ -86,7 +83,6 @@ public UnaryCallable exportAgentCallable() { throw new UnsupportedOperationException("Not implemented: exportAgentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable restoreAgentOperationCallable() { throw new UnsupportedOperationException("Not implemented: restoreAgentOperationCallable()"); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java index 44b17e650..a85b671d0 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; @@ -62,10 +63,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link AgentsStub}. * @@ -82,22 +84,22 @@ * *

For example, to set the total timeout of getAgent to 30 seconds: * - *

- * 
- * AgentsStubSettings.Builder agentsSettingsBuilder =
- *     AgentsStubSettings.newBuilder();
+ * 
{@code
+ * AgentsStubSettings.Builder agentsSettingsBuilder = AgentsStubSettings.newBuilder();
  * agentsSettingsBuilder
  *     .getAgentSettings()
  *     .setRetrySettings(
- *         agentsSettingsBuilder.getAgentSettings().getRetrySettings().toBuilder()
+ *         agentsSettingsBuilder
+ *             .getAgentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * AgentsStubSettings agentsSettings = agentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class AgentsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -119,6 +121,59 @@ public class AgentsStubSettings extends StubSettings { private final OperationCallSettings restoreAgentOperationSettings; + private static final PagedListDescriptor + LIST_AGENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAgentsRequest injectToken(ListAgentsRequest payload, String token) { + return ListAgentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAgentsRequest injectPageSize(ListAgentsRequest payload, int pageSize) { + return ListAgentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAgentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAgentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAgentsResponse payload) { + return Objects.isNull(payload.getAgentsList()) + ? ImmutableList.of() + : payload.getAgentsList(); + } + }; + + private static final PagedListResponseFactory< + ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> + LIST_AGENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAgentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_AGENTS_PAGE_STR_DESC, request, context); + return ListAgentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listAgents. */ public PagedCallSettings listAgentsSettings() { @@ -151,7 +206,6 @@ public UnaryCallSettings exportAgentSettings() { } /** Returns the object with the settings used for calls to exportAgent. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings exportAgentOperationSettings() { return exportAgentOperationSettings; @@ -163,7 +217,6 @@ public UnaryCallSettings restoreAgentSettings() } /** Returns the object with the settings used for calls to restoreAgent. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings restoreAgentOperationSettings() { return restoreAgentOperationSettings; } @@ -174,10 +227,10 @@ public AgentsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcAgentsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -247,63 +300,9 @@ protected AgentsStubSettings(Builder settingsBuilder) throws IOException { restoreAgentOperationSettings = settingsBuilder.restoreAgentOperationSettings().build(); } - private static final PagedListDescriptor - LIST_AGENTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListAgentsRequest injectToken(ListAgentsRequest payload, String token) { - return ListAgentsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListAgentsRequest injectPageSize(ListAgentsRequest payload, int pageSize) { - return ListAgentsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListAgentsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListAgentsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListAgentsResponse payload) { - return payload.getAgentsList() != null - ? payload.getAgentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> - LIST_AGENTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListAgentsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_AGENTS_PAGE_STR_DESC, request, context); - return ListAgentsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for AgentsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListAgentsRequest, ListAgentsResponse, ListAgentsPagedResponse> listAgentsSettings; @@ -317,7 +316,6 @@ public static class Builder extends StubSettings.Builder restoreAgentSettings; private final OperationCallSettings.Builder restoreAgentOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -325,14 +323,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -351,54 +343,25 @@ public static class Builder extends StubSettings.Builder>of( + listAgentsSettings, + getAgentSettings, + createAgentSettings, + updateAgentSettings, + deleteAgentSettings, + exportAgentSettings, + restoreAgentSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listAgentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .exportAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .restoreAgentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .exportAgentOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(ExportAgentResponse.class)) @@ -473,21 +461,22 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .restoreAgentOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -496,43 +485,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(AgentsStubSettings settings) { - super(settings); - - listAgentsSettings = settings.listAgentsSettings.toBuilder(); - getAgentSettings = settings.getAgentSettings.toBuilder(); - createAgentSettings = settings.createAgentSettings.toBuilder(); - updateAgentSettings = settings.updateAgentSettings.toBuilder(); - deleteAgentSettings = settings.deleteAgentSettings.toBuilder(); - exportAgentSettings = settings.exportAgentSettings.toBuilder(); - exportAgentOperationSettings = settings.exportAgentOperationSettings.toBuilder(); - restoreAgentSettings = settings.restoreAgentSettings.toBuilder(); - restoreAgentOperationSettings = settings.restoreAgentOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listAgentsSettings, - getAgentSettings, - createAgentSettings, - updateAgentSettings, - deleteAgentSettings, - exportAgentSettings, - restoreAgentSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java index 8794c681d..54cabdc2f 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the EntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class EntityTypesStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java index e5f50a738..beb629541 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EntityTypesStub}. * @@ -73,22 +75,23 @@ * *

For example, to set the total timeout of getEntityType to 30 seconds: * - *

- * 
+ * 
{@code
  * EntityTypesStubSettings.Builder entityTypesSettingsBuilder =
  *     EntityTypesStubSettings.newBuilder();
  * entityTypesSettingsBuilder
  *     .getEntityTypeSettings()
  *     .setRetrySettings(
- *         entityTypesSettingsBuilder.getEntityTypeSettings().getRetrySettings().toBuilder()
+ *         entityTypesSettingsBuilder
+ *             .getEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EntityTypesStubSettings entityTypesSettings = entityTypesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class EntityTypesStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -105,6 +108,62 @@ public class EntityTypesStubSettings extends StubSettings updateEntityTypeSettings; private final UnaryCallSettings deleteEntityTypeSettings; + private static final PagedListDescriptor< + ListEntityTypesRequest, ListEntityTypesResponse, EntityType> + LIST_ENTITY_TYPES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEntityTypesRequest injectToken( + ListEntityTypesRequest payload, String token) { + return ListEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEntityTypesRequest injectPageSize( + ListEntityTypesRequest payload, int pageSize) { + return ListEntityTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEntityTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEntityTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEntityTypesResponse payload) { + return Objects.isNull(payload.getEntityTypesList()) + ? ImmutableList.of() + : payload.getEntityTypesList(); + } + }; + + private static final PagedListResponseFactory< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> + LIST_ENTITY_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEntityTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ENTITY_TYPES_PAGE_STR_DESC, request, context); + return ListEntityTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listEntityTypes. */ public PagedCallSettings< ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> @@ -138,10 +197,10 @@ public EntityTypesStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcEntityTypesStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -208,66 +267,9 @@ protected EntityTypesStubSettings(Builder settingsBuilder) throws IOException { deleteEntityTypeSettings = settingsBuilder.deleteEntityTypeSettings().build(); } - private static final PagedListDescriptor< - ListEntityTypesRequest, ListEntityTypesResponse, EntityType> - LIST_ENTITY_TYPES_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListEntityTypesRequest injectToken( - ListEntityTypesRequest payload, String token) { - return ListEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListEntityTypesRequest injectPageSize( - ListEntityTypesRequest payload, int pageSize) { - return ListEntityTypesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListEntityTypesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListEntityTypesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListEntityTypesResponse payload) { - return payload.getEntityTypesList() != null - ? payload.getEntityTypesList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> - LIST_ENTITY_TYPES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListEntityTypesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_ENTITY_TYPES_PAGE_STR_DESC, request, context); - return ListEntityTypesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for EntityTypesStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListEntityTypesRequest, ListEntityTypesResponse, ListEntityTypesPagedResponse> listEntityTypesSettings; @@ -278,7 +280,6 @@ public static class Builder extends StubSettings.Builder deleteEntityTypeSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -286,14 +287,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -312,46 +307,21 @@ public static class Builder extends StubSettings.Builder>of( + listEntityTypesSettings, + getEntityTypeSettings, + createEntityTypeSettings, + updateEntityTypeSettings, + deleteEntityTypeSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listEntityTypesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(EntityTypesStubSettings settings) { - super(settings); - - listEntityTypesSettings = settings.listEntityTypesSettings.toBuilder(); - getEntityTypeSettings = settings.getEntityTypeSettings.toBuilder(); - createEntityTypeSettings = settings.createEntityTypeSettings.toBuilder(); - updateEntityTypeSettings = settings.updateEntityTypeSettings.toBuilder(); - deleteEntityTypeSettings = settings.deleteEntityTypeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listEntityTypesSettings, - getEntityTypeSettings, - createEntityTypeSettings, - updateEntityTypeSettings, - deleteEntityTypeSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStub.java index 6064a2c57..5e12d39aa 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -37,17 +37,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Environments service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class EnvironmentsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -66,7 +64,6 @@ public UnaryCallable getEnvironmentCallable( throw new UnsupportedOperationException("Not implemented: getEnvironmentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createEnvironmentOperationCallable() { throw new UnsupportedOperationException( @@ -77,7 +74,6 @@ public UnaryCallable createEnvironmentCalla throw new UnsupportedOperationException("Not implemented: createEnvironmentCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable updateEnvironmentOperationCallable() { throw new UnsupportedOperationException( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java index 38a1c5d99..6900d2b78 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; @@ -62,10 +63,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link EnvironmentsStub}. * @@ -82,22 +84,23 @@ * *

For example, to set the total timeout of getEnvironment to 30 seconds: * - *

- * 
+ * 
{@code
  * EnvironmentsStubSettings.Builder environmentsSettingsBuilder =
  *     EnvironmentsStubSettings.newBuilder();
  * environmentsSettingsBuilder
  *     .getEnvironmentSettings()
  *     .setRetrySettings(
- *         environmentsSettingsBuilder.getEnvironmentSettings().getRetrySettings().toBuilder()
+ *         environmentsSettingsBuilder
+ *             .getEnvironmentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * EnvironmentsStubSettings environmentsSettings = environmentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class EnvironmentsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -123,6 +126,137 @@ public class EnvironmentsStubSettings extends StubSettings lookupEnvironmentHistorySettings; + private static final PagedListDescriptor< + ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> + LIST_ENVIRONMENTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListEnvironmentsRequest, ListEnvironmentsResponse, Environment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListEnvironmentsRequest injectToken( + ListEnvironmentsRequest payload, String token) { + return ListEnvironmentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListEnvironmentsRequest injectPageSize( + ListEnvironmentsRequest payload, int pageSize) { + return ListEnvironmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListEnvironmentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListEnvironmentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListEnvironmentsResponse payload) { + return Objects.isNull(payload.getEnvironmentsList()) + ? ImmutableList.of() + : payload.getEnvironmentsList(); + } + }; + + private static final PagedListDescriptor< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment> + LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC = + new PagedListDescriptor< + LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public LookupEnvironmentHistoryRequest injectToken( + LookupEnvironmentHistoryRequest payload, String token) { + return LookupEnvironmentHistoryRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public LookupEnvironmentHistoryRequest injectPageSize( + LookupEnvironmentHistoryRequest payload, int pageSize) { + return LookupEnvironmentHistoryRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(LookupEnvironmentHistoryRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(LookupEnvironmentHistoryResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + LookupEnvironmentHistoryResponse payload) { + return Objects.isNull(payload.getEnvironmentsList()) + ? ImmutableList.of() + : payload.getEnvironmentsList(); + } + }; + + private static final PagedListResponseFactory< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> + LIST_ENVIRONMENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListEnvironmentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_ENVIRONMENTS_PAGE_STR_DESC, request, context); + return ListEnvironmentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse> + LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_FACT = + new PagedListResponseFactory< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + LookupEnvironmentHistoryPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + LookupEnvironmentHistoryRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + LookupEnvironmentHistoryRequest, + LookupEnvironmentHistoryResponse, + Environment> + pageContext = + PageContext.create( + callable, LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC, request, context); + return LookupEnvironmentHistoryPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listEnvironments. */ public PagedCallSettings< ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> @@ -141,7 +275,6 @@ public UnaryCallSettings createEnvironmentS } /** Returns the object with the settings used for calls to createEnvironment. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings createEnvironmentOperationSettings() { return createEnvironmentOperationSettings; @@ -153,7 +286,6 @@ public UnaryCallSettings updateEnvironmentS } /** Returns the object with the settings used for calls to updateEnvironment. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings updateEnvironmentOperationSettings() { return updateEnvironmentOperationSettings; @@ -179,10 +311,10 @@ public EnvironmentsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcEnvironmentsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -254,141 +386,9 @@ protected EnvironmentsStubSettings(Builder settingsBuilder) throws IOException { lookupEnvironmentHistorySettings = settingsBuilder.lookupEnvironmentHistorySettings().build(); } - private static final PagedListDescriptor< - ListEnvironmentsRequest, ListEnvironmentsResponse, Environment> - LIST_ENVIRONMENTS_PAGE_STR_DESC = - new PagedListDescriptor< - ListEnvironmentsRequest, ListEnvironmentsResponse, Environment>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListEnvironmentsRequest injectToken( - ListEnvironmentsRequest payload, String token) { - return ListEnvironmentsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListEnvironmentsRequest injectPageSize( - ListEnvironmentsRequest payload, int pageSize) { - return ListEnvironmentsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListEnvironmentsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListEnvironmentsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListEnvironmentsResponse payload) { - return payload.getEnvironmentsList() != null - ? payload.getEnvironmentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListDescriptor< - LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment> - LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC = - new PagedListDescriptor< - LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse, Environment>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public LookupEnvironmentHistoryRequest injectToken( - LookupEnvironmentHistoryRequest payload, String token) { - return LookupEnvironmentHistoryRequest.newBuilder(payload) - .setPageToken(token) - .build(); - } - - @Override - public LookupEnvironmentHistoryRequest injectPageSize( - LookupEnvironmentHistoryRequest payload, int pageSize) { - return LookupEnvironmentHistoryRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(LookupEnvironmentHistoryRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(LookupEnvironmentHistoryResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - LookupEnvironmentHistoryResponse payload) { - return payload.getEnvironmentsList() != null - ? payload.getEnvironmentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> - LIST_ENVIRONMENTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListEnvironmentsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext - pageContext = - PageContext.create( - callable, LIST_ENVIRONMENTS_PAGE_STR_DESC, request, context); - return ListEnvironmentsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - - private static final PagedListResponseFactory< - LookupEnvironmentHistoryRequest, - LookupEnvironmentHistoryResponse, - LookupEnvironmentHistoryPagedResponse> - LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_FACT = - new PagedListResponseFactory< - LookupEnvironmentHistoryRequest, - LookupEnvironmentHistoryResponse, - LookupEnvironmentHistoryPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - LookupEnvironmentHistoryRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - LookupEnvironmentHistoryRequest, - LookupEnvironmentHistoryResponse, - Environment> - pageContext = - PageContext.create( - callable, LOOKUP_ENVIRONMENT_HISTORY_PAGE_STR_DESC, request, context); - return LookupEnvironmentHistoryPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for EnvironmentsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListEnvironmentsRequest, ListEnvironmentsResponse, ListEnvironmentsPagedResponse> listEnvironmentsSettings; @@ -409,7 +409,6 @@ public static class Builder extends StubSettings.Builder lookupEnvironmentHistorySettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -417,14 +416,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -443,52 +436,24 @@ public static class Builder extends StubSettings.Builder>of( + listEnvironmentsSettings, + getEnvironmentSettings, + createEnvironmentSettings, + updateEnvironmentSettings, + deleteEnvironmentSettings, + lookupEnvironmentHistorySettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listEnvironmentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteEnvironmentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .lookupEnvironmentHistorySettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createEnvironmentOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) @@ -559,21 +547,22 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .updateEnvironmentOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Environment.class)) @@ -582,41 +571,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(EnvironmentsStubSettings settings) { - super(settings); - - listEnvironmentsSettings = settings.listEnvironmentsSettings.toBuilder(); - getEnvironmentSettings = settings.getEnvironmentSettings.toBuilder(); - createEnvironmentSettings = settings.createEnvironmentSettings.toBuilder(); - createEnvironmentOperationSettings = settings.createEnvironmentOperationSettings.toBuilder(); - updateEnvironmentSettings = settings.updateEnvironmentSettings.toBuilder(); - updateEnvironmentOperationSettings = settings.updateEnvironmentOperationSettings.toBuilder(); - deleteEnvironmentSettings = settings.deleteEnvironmentSettings.toBuilder(); - lookupEnvironmentHistorySettings = settings.lookupEnvironmentHistorySettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listEnvironmentsSettings, - getEnvironmentSettings, - createEnvironmentSettings, - updateEnvironmentSettings, - deleteEnvironmentSettings, - lookupEnvironmentHistorySettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStub.java index 37148c1c0..9669af249 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -35,17 +35,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Flows service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class FlowsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -74,7 +72,6 @@ public UnaryCallable updateFlowCallable() { throw new UnsupportedOperationException("Not implemented: updateFlowCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable trainFlowOperationCallable() { throw new UnsupportedOperationException("Not implemented: trainFlowOperationCallable()"); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java index 7ca8bf58a..b8626367b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; @@ -60,10 +61,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link FlowsStub}. * @@ -80,22 +82,22 @@ * *

For example, to set the total timeout of createFlow to 30 seconds: * - *

- * 
- * FlowsStubSettings.Builder flowsSettingsBuilder =
- *     FlowsStubSettings.newBuilder();
+ * 
{@code
+ * FlowsStubSettings.Builder flowsSettingsBuilder = FlowsStubSettings.newBuilder();
  * flowsSettingsBuilder
  *     .createFlowSettings()
  *     .setRetrySettings(
- *         flowsSettingsBuilder.createFlowSettings().getRetrySettings().toBuilder()
+ *         flowsSettingsBuilder
+ *             .createFlowSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * FlowsStubSettings flowsSettings = flowsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class FlowsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -113,6 +115,59 @@ public class FlowsStubSettings extends StubSettings { private final UnaryCallSettings trainFlowSettings; private final OperationCallSettings trainFlowOperationSettings; + private static final PagedListDescriptor + LIST_FLOWS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFlowsRequest injectToken(ListFlowsRequest payload, String token) { + return ListFlowsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFlowsRequest injectPageSize(ListFlowsRequest payload, int pageSize) { + return ListFlowsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFlowsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFlowsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFlowsResponse payload) { + return Objects.isNull(payload.getFlowsList()) + ? ImmutableList.of() + : payload.getFlowsList(); + } + }; + + private static final PagedListResponseFactory< + ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse> + LIST_FLOWS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFlowsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FLOWS_PAGE_STR_DESC, request, context); + return ListFlowsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to createFlow. */ public UnaryCallSettings createFlowSettings() { return createFlowSettings; @@ -145,7 +200,6 @@ public UnaryCallSettings trainFlowSettings() { } /** Returns the object with the settings used for calls to trainFlow. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings trainFlowOperationSettings() { return trainFlowOperationSettings; } @@ -156,10 +210,10 @@ public FlowsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcFlowsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -227,63 +281,9 @@ protected FlowsStubSettings(Builder settingsBuilder) throws IOException { trainFlowOperationSettings = settingsBuilder.trainFlowOperationSettings().build(); } - private static final PagedListDescriptor - LIST_FLOWS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListFlowsRequest injectToken(ListFlowsRequest payload, String token) { - return ListFlowsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListFlowsRequest injectPageSize(ListFlowsRequest payload, int pageSize) { - return ListFlowsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListFlowsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListFlowsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListFlowsResponse payload) { - return payload.getFlowsList() != null - ? payload.getFlowsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse> - LIST_FLOWS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListFlowsRequest, ListFlowsResponse, ListFlowsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListFlowsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_FLOWS_PAGE_STR_DESC, request, context); - return ListFlowsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for FlowsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder createFlowSettings; private final UnaryCallSettings.Builder deleteFlowSettings; private final PagedCallSettings.Builder< @@ -294,7 +294,6 @@ public static class Builder extends StubSettings.Builder trainFlowSettings; private final OperationCallSettings.Builder trainFlowOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -302,14 +301,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -328,50 +321,23 @@ public static class Builder extends StubSettings.Builder>of( + createFlowSettings, + deleteFlowSettings, + listFlowsSettings, + getFlowSettings, + updateFlowSettings, + trainFlowSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .createFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .listFlowsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .trainFlowSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .trainFlowOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -440,40 +428,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(FlowsStubSettings settings) { - super(settings); - - createFlowSettings = settings.createFlowSettings.toBuilder(); - deleteFlowSettings = settings.deleteFlowSettings.toBuilder(); - listFlowsSettings = settings.listFlowsSettings.toBuilder(); - getFlowSettings = settings.getFlowSettings.toBuilder(); - updateFlowSettings = settings.updateFlowSettings.toBuilder(); - trainFlowSettings = settings.trainFlowSettings.toBuilder(); - trainFlowOperationSettings = settings.trainFlowOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - createFlowSettings, - deleteFlowSettings, - listFlowsSettings, - getFlowSettings, - updateFlowSettings, - trainFlowSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsCallableFactory.java index 89e559871..a4bd45952 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Agents service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcAgentsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java index ae15184d4..c5b505c9f 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -48,16 +48,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Agents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcAgentsStub extends AgentsStub { - private static final MethodDescriptor listAgentsMethodDescriptor = MethodDescriptor.newBuilder() @@ -66,6 +64,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(ListAgentsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListAgentsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -73,6 +72,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) .build(); + private static final MethodDescriptor createAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -80,6 +80,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) .build(); + private static final MethodDescriptor updateAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -87,6 +88,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdateAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Agent.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -94,6 +96,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor exportAgentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -101,6 +104,7 @@ public class GrpcAgentsStub extends AgentsStub { .setRequestMarshaller(ProtoUtils.marshaller(ExportAgentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor restoreAgentMethodDescriptor = MethodDescriptor.newBuilder() @@ -110,9 +114,6 @@ public class GrpcAgentsStub extends AgentsStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable listAgentsCallable; private final UnaryCallable listAgentsPagedCallable; private final UnaryCallable getAgentCallable; @@ -125,6 +126,8 @@ public class GrpcAgentsStub extends AgentsStub { private final UnaryCallable restoreAgentCallable; private final OperationCallable restoreAgentOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcAgentsStub create(AgentsStubSettings settings) throws IOException { @@ -141,19 +144,11 @@ public static final GrpcAgentsStub create( AgentsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcAgentsStub(AgentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcAgentsCallableFactory()); } - /** - * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcAgentsStub( AgentsStubSettings settings, ClientContext clientContext, @@ -280,7 +275,7 @@ public Map extract(RestoreAgentRequest request) { exportAgentTransportSettings, settings.exportAgentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.restoreAgentCallable = callableFactory.createUnaryCallable( restoreAgentTransportSettings, settings.restoreAgentSettings(), clientContext); @@ -289,24 +284,24 @@ public Map extract(RestoreAgentRequest request) { restoreAgentTransportSettings, settings.restoreAgentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable listAgentsPagedCallable() { - return listAgentsPagedCallable; - } - public UnaryCallable listAgentsCallable() { return listAgentsCallable; } + public UnaryCallable listAgentsPagedCallable() { + return listAgentsPagedCallable; + } + public UnaryCallable getAgentCallable() { return getAgentCallable; } @@ -323,25 +318,23 @@ public UnaryCallable deleteAgentCallable() { return deleteAgentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable exportAgentCallable() { + return exportAgentCallable; + } + public OperationCallable exportAgentOperationCallable() { return exportAgentOperationCallable; } - public UnaryCallable exportAgentCallable() { - return exportAgentCallable; + public UnaryCallable restoreAgentCallable() { + return restoreAgentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable restoreAgentOperationCallable() { return restoreAgentOperationCallable; } - public UnaryCallable restoreAgentCallable() { - return restoreAgentCallable; - } - @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesCallableFactory.java index d6497a060..3302312a0 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the EntityTypes service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcEntityTypesCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java index ae1cfb1a5..8117758d2 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse; import com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the EntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcEntityTypesStub extends EntityTypesStub { - private static final MethodDescriptor listEntityTypesMethodDescriptor = MethodDescriptor.newBuilder() @@ -61,6 +60,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { .setResponseMarshaller( ProtoUtils.marshaller(ListEntityTypesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -70,6 +70,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { ProtoUtils.marshaller(GetEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor createEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -79,6 +80,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { ProtoUtils.marshaller(CreateEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor updateEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -88,6 +90,7 @@ public class GrpcEntityTypesStub extends EntityTypesStub { ProtoUtils.marshaller(UpdateEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(EntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -98,8 +101,6 @@ public class GrpcEntityTypesStub extends EntityTypesStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listEntityTypesCallable; private final UnaryCallable @@ -109,6 +110,8 @@ public class GrpcEntityTypesStub extends EntityTypesStub { private final UnaryCallable updateEntityTypeCallable; private final UnaryCallable deleteEntityTypeCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcEntityTypesStub create(EntityTypesStubSettings settings) @@ -126,27 +129,18 @@ public static final GrpcEntityTypesStub create( EntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEntityTypesStub(EntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEntityTypesCallableFactory()); } - /** - * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEntityTypesStub( EntityTypesStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listEntityTypesTransportSettings = @@ -235,18 +229,23 @@ public Map extract(DeleteEntityTypeRequest request) { callableFactory.createUnaryCallable( deleteEntityTypeTransportSettings, settings.deleteEntityTypeSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable - listEntityTypesPagedCallable() { - return listEntityTypesPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listEntityTypesCallable() { return listEntityTypesCallable; } + public UnaryCallable + listEntityTypesPagedCallable() { + return listEntityTypesPagedCallable; + } + public UnaryCallable getEntityTypeCallable() { return getEntityTypeCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsCallableFactory.java index f1a353163..b48d0203d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Environments service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcEnvironmentsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java index 2a5593435..739c3d4c1 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.LookupEnvironmentHistoryPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -48,16 +48,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Environments service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcEnvironmentsStub extends EnvironmentsStub { - private static final MethodDescriptor listEnvironmentsMethodDescriptor = MethodDescriptor.newBuilder() @@ -68,6 +66,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListEnvironmentsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -77,6 +76,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(GetEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Environment.getDefaultInstance())) .build(); + private static final MethodDescriptor createEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -87,6 +87,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(CreateEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor updateEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -97,6 +98,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(UpdateEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteEnvironmentMethodDescriptor = MethodDescriptor.newBuilder() @@ -107,6 +109,7 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(DeleteEnvironmentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor< LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryResponse> lookupEnvironmentHistoryMethodDescriptor = @@ -121,9 +124,6 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { ProtoUtils.marshaller(LookupEnvironmentHistoryResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable listEnvironmentsCallable; private final UnaryCallable @@ -142,6 +142,8 @@ public class GrpcEnvironmentsStub extends EnvironmentsStub { LookupEnvironmentHistoryRequest, LookupEnvironmentHistoryPagedResponse> lookupEnvironmentHistoryPagedCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcEnvironmentsStub create(EnvironmentsStubSettings settings) @@ -159,21 +161,11 @@ public static final GrpcEnvironmentsStub create( EnvironmentsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEnvironmentsStub(EnvironmentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEnvironmentsCallableFactory()); } - /** - * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so - * that it is easy to make a subclass, but otherwise, the static factory methods should be - * preferred. - */ protected GrpcEnvironmentsStub( EnvironmentsStubSettings settings, ClientContext clientContext, @@ -284,7 +276,7 @@ public Map extract(LookupEnvironmentHistoryRequest request) { createEnvironmentTransportSettings, settings.createEnvironmentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.updateEnvironmentCallable = callableFactory.createUnaryCallable( updateEnvironmentTransportSettings, @@ -295,7 +287,7 @@ public Map extract(LookupEnvironmentHistoryRequest request) { updateEnvironmentTransportSettings, settings.updateEnvironmentOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.deleteEnvironmentCallable = callableFactory.createUnaryCallable( deleteEnvironmentTransportSettings, @@ -312,62 +304,60 @@ public Map extract(LookupEnvironmentHistoryRequest request) { settings.lookupEnvironmentHistorySettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable - listEnvironmentsPagedCallable() { - return listEnvironmentsPagedCallable; - } - public UnaryCallable listEnvironmentsCallable() { return listEnvironmentsCallable; } + public UnaryCallable + listEnvironmentsPagedCallable() { + return listEnvironmentsPagedCallable; + } + public UnaryCallable getEnvironmentCallable() { return getEnvironmentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable createEnvironmentCallable() { + return createEnvironmentCallable; + } + public OperationCallable createEnvironmentOperationCallable() { return createEnvironmentOperationCallable; } - public UnaryCallable createEnvironmentCallable() { - return createEnvironmentCallable; + public UnaryCallable updateEnvironmentCallable() { + return updateEnvironmentCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable updateEnvironmentOperationCallable() { return updateEnvironmentOperationCallable; } - public UnaryCallable updateEnvironmentCallable() { - return updateEnvironmentCallable; - } - public UnaryCallable deleteEnvironmentCallable() { return deleteEnvironmentCallable; } - public UnaryCallable - lookupEnvironmentHistoryPagedCallable() { - return lookupEnvironmentHistoryPagedCallable; - } - public UnaryCallable lookupEnvironmentHistoryCallable() { return lookupEnvironmentHistoryCallable; } + public UnaryCallable + lookupEnvironmentHistoryPagedCallable() { + return lookupEnvironmentHistoryPagedCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsCallableFactory.java index a8da24a56..baa6a1bb1 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Flows service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcFlowsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java index ce59e63cf..cea391dfb 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -46,16 +46,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Flows service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcFlowsStub extends FlowsStub { - private static final MethodDescriptor createFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -63,6 +61,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -70,6 +69,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor listFlowsMethodDescriptor = MethodDescriptor.newBuilder() @@ -78,6 +78,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(ListFlowsRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListFlowsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -85,6 +86,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) .build(); + private static final MethodDescriptor updateFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -92,6 +94,7 @@ public class GrpcFlowsStub extends FlowsStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdateFlowRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance())) .build(); + private static final MethodDescriptor trainFlowMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -100,9 +103,6 @@ public class GrpcFlowsStub extends FlowsStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable createFlowCallable; private final UnaryCallable deleteFlowCallable; private final UnaryCallable listFlowsCallable; @@ -112,6 +112,8 @@ public class GrpcFlowsStub extends FlowsStub { private final UnaryCallable trainFlowCallable; private final OperationCallable trainFlowOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcFlowsStub create(FlowsStubSettings settings) throws IOException { @@ -128,19 +130,11 @@ public static final GrpcFlowsStub create( FlowsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcFlowsStub(FlowsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcFlowsCallableFactory()); } - /** - * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcFlowsStub( FlowsStubSettings settings, ClientContext clientContext, @@ -254,12 +248,12 @@ public Map extract(TrainFlowRequest request) { trainFlowTransportSettings, settings.trainFlowOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } @@ -272,14 +266,14 @@ public UnaryCallable deleteFlowCallable() { return deleteFlowCallable; } - public UnaryCallable listFlowsPagedCallable() { - return listFlowsPagedCallable; - } - public UnaryCallable listFlowsCallable() { return listFlowsCallable; } + public UnaryCallable listFlowsPagedCallable() { + return listFlowsPagedCallable; + } + public UnaryCallable getFlowCallable() { return getFlowCallable; } @@ -288,15 +282,14 @@ public UnaryCallable updateFlowCallable() { return updateFlowCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable trainFlowOperationCallable() { - return trainFlowOperationCallable; - } - public UnaryCallable trainFlowCallable() { return trainFlowCallable; } + public OperationCallable trainFlowOperationCallable() { + return trainFlowOperationCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsCallableFactory.java index 60ad87cf6..806346858 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Intents service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcIntentsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java index cffb6c868..85f225fd5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse; import com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Intents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcIntentsStub extends IntentsStub { - private static final MethodDescriptor listIntentsMethodDescriptor = MethodDescriptor.newBuilder() @@ -60,6 +59,7 @@ public class GrpcIntentsStub extends IntentsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListIntentsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -67,6 +67,7 @@ public class GrpcIntentsStub extends IntentsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetIntentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) .build(); + private static final MethodDescriptor createIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -74,6 +75,7 @@ public class GrpcIntentsStub extends IntentsStub { .setRequestMarshaller(ProtoUtils.marshaller(CreateIntentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) .build(); + private static final MethodDescriptor updateIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -81,6 +83,7 @@ public class GrpcIntentsStub extends IntentsStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdateIntentRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Intent.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteIntentMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -89,8 +92,6 @@ public class GrpcIntentsStub extends IntentsStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listIntentsCallable; private final UnaryCallable listIntentsPagedCallable; @@ -99,6 +100,8 @@ public class GrpcIntentsStub extends IntentsStub { private final UnaryCallable updateIntentCallable; private final UnaryCallable deleteIntentCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcIntentsStub create(IntentsStubSettings settings) throws IOException { @@ -115,25 +118,18 @@ public static final GrpcIntentsStub create( IntentsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcIntentsStub(IntentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcIntentsCallableFactory()); } - /** - * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcIntentsStub( IntentsStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listIntentsTransportSettings = GrpcCallSettings.newBuilder() @@ -220,17 +216,22 @@ public Map extract(DeleteIntentRequest request) { callableFactory.createUnaryCallable( deleteIntentTransportSettings, settings.deleteIntentSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable listIntentsPagedCallable() { - return listIntentsPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listIntentsCallable() { return listIntentsCallable; } + public UnaryCallable listIntentsPagedCallable() { + return listIntentsPagedCallable; + } + public UnaryCallable getIntentCallable() { return getIntentCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesCallableFactory.java index 2f4206067..3ff0e65e9 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Pages service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcPagesCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java index b9caf90ba..710e7d633 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.Page; import com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Pages service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcPagesStub extends PagesStub { - private static final MethodDescriptor listPagesMethodDescriptor = MethodDescriptor.newBuilder() @@ -59,6 +58,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(ListPagesRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(ListPagesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getPageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -66,6 +66,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(GetPageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) .build(); + private static final MethodDescriptor createPageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -73,6 +74,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(CreatePageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) .build(); + private static final MethodDescriptor updatePageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -80,6 +82,7 @@ public class GrpcPagesStub extends PagesStub { .setRequestMarshaller(ProtoUtils.marshaller(UpdatePageRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Page.getDefaultInstance())) .build(); + private static final MethodDescriptor deletePageMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -88,8 +91,6 @@ public class GrpcPagesStub extends PagesStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listPagesCallable; private final UnaryCallable listPagesPagedCallable; private final UnaryCallable getPageCallable; @@ -97,6 +98,8 @@ public class GrpcPagesStub extends PagesStub { private final UnaryCallable updatePageCallable; private final UnaryCallable deletePageCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcPagesStub create(PagesStubSettings settings) throws IOException { @@ -113,25 +116,18 @@ public static final GrpcPagesStub create( PagesStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcPagesStub(PagesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcPagesCallableFactory()); } - /** - * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it - * is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcPagesStub( PagesStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listPagesTransportSettings = GrpcCallSettings.newBuilder() @@ -218,17 +214,22 @@ public Map extract(DeletePageRequest request) { callableFactory.createUnaryCallable( deletePageTransportSettings, settings.deletePageSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable listPagesPagedCallable() { - return listPagesPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listPagesCallable() { return listPagesCallable; } + public UnaryCallable listPagesPagedCallable() { + return listPagesPagedCallable; + } + public UnaryCallable getPageCallable() { return getPageCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesCallableFactory.java index 27ec996d6..1e5906d46 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the SessionEntityTypes service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcSessionEntityTypesCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java index 5476c267c..cc747bb8a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType; import com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the SessionEntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { - private static final MethodDescriptor< ListSessionEntityTypesRequest, ListSessionEntityTypesResponse> listSessionEntityTypesMethodDescriptor = @@ -64,6 +63,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { .setResponseMarshaller( ProtoUtils.marshaller(ListSessionEntityTypesResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -74,6 +74,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { ProtoUtils.marshaller(GetSessionEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor createSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -84,6 +85,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { ProtoUtils.marshaller(CreateSessionEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor updateSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -94,6 +96,7 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { ProtoUtils.marshaller(UpdateSessionEntityTypeRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(SessionEntityType.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteSessionEntityTypeMethodDescriptor = MethodDescriptor.newBuilder() @@ -105,8 +108,6 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listSessionEntityTypesCallable; private final UnaryCallable @@ -120,6 +121,8 @@ public class GrpcSessionEntityTypesStub extends SessionEntityTypesStub { private final UnaryCallable deleteSessionEntityTypeCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcSessionEntityTypesStub create(SessionEntityTypesStubSettings settings) @@ -139,27 +142,18 @@ public static final GrpcSessionEntityTypesStub create( SessionEntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionEntityTypesCallableFactory()); } - /** - * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listSessionEntityTypesTransportSettings = @@ -266,12 +260,12 @@ public Map extract(DeleteSessionEntityTypeRequest request) { settings.deleteSessionEntityTypeSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable - listSessionEntityTypesPagedCallable() { - return listSessionEntityTypesPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable @@ -279,6 +273,11 @@ public Map extract(DeleteSessionEntityTypeRequest request) { return listSessionEntityTypesCallable; } + public UnaryCallable + listSessionEntityTypesPagedCallable() { + return listSessionEntityTypesPagedCallable; + } + public UnaryCallable getSessionEntityTypeCallable() { return getSessionEntityTypeCallable; diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsCallableFactory.java index 47122b3da..66381e99a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Sessions service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcSessionsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java index 79c41c521..94945987c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest; import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -40,16 +41,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Sessions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcSessionsStub extends SessionsStub { - private static final MethodDescriptor detectIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -59,6 +58,7 @@ public class GrpcSessionsStub extends SessionsStub { .setResponseMarshaller( ProtoUtils.marshaller(DetectIntentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor streamingDetectIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -70,6 +70,7 @@ public class GrpcSessionsStub extends SessionsStub { .setResponseMarshaller( ProtoUtils.marshaller(StreamingDetectIntentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor matchIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -79,6 +80,7 @@ public class GrpcSessionsStub extends SessionsStub { .setResponseMarshaller( ProtoUtils.marshaller(MatchIntentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor fulfillIntentMethodDescriptor = MethodDescriptor.newBuilder() @@ -90,14 +92,14 @@ public class GrpcSessionsStub extends SessionsStub { ProtoUtils.marshaller(FulfillIntentResponse.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable detectIntentCallable; private final BidiStreamingCallable streamingDetectIntentCallable; private final UnaryCallable matchIntentCallable; private final UnaryCallable fulfillIntentCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcSessionsStub create(SessionsStubSettings settings) throws IOException { @@ -114,25 +116,18 @@ public static final GrpcSessionsStub create( SessionsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcSessionsStub(SessionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionsCallableFactory()); } - /** - * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcSessionsStub( SessionsStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings detectIntentTransportSettings = GrpcCallSettings.newBuilder() @@ -197,7 +192,12 @@ public Map extract(FulfillIntentRequest request) { callableFactory.createUnaryCallable( fulfillIntentTransportSettings, settings.fulfillIntentSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable detectIntentCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsCallableFactory.java index c2368b6e1..5954fb5a2 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the TransitionRouteGroups service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcTransitionRouteGroupsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java index 25cf8b708..91fb5d1ab 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup; import com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the TransitionRouteGroups service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { - private static final MethodDescriptor< ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse> listTransitionRouteGroupsMethodDescriptor = @@ -64,6 +63,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListTransitionRouteGroupsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -75,6 +75,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) .build(); + private static final MethodDescriptor createTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -86,6 +87,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) .build(); + private static final MethodDescriptor updateTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -97,6 +99,7 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller( ProtoUtils.marshaller(TransitionRouteGroup.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteTransitionRouteGroupMethodDescriptor = MethodDescriptor.newBuilder() @@ -108,8 +111,6 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listTransitionRouteGroupsCallable; private final UnaryCallable< @@ -124,6 +125,8 @@ public class GrpcTransitionRouteGroupsStub extends TransitionRouteGroupsStub { private final UnaryCallable deleteTransitionRouteGroupCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcTransitionRouteGroupsStub create( @@ -143,27 +146,18 @@ public static final GrpcTransitionRouteGroupsStub create( TransitionRouteGroupsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcTransitionRouteGroupsCallableFactory()); } - /** - * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is - * protected so that it is easy to make a subclass, but otherwise, the static factory methods - * should be preferred. - */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listTransitionRouteGroupsTransportSettings = @@ -273,12 +267,12 @@ public Map extract( settings.deleteTransitionRouteGroupSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable - listTransitionRouteGroupsPagedCallable() { - return listTransitionRouteGroupsPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable @@ -286,6 +280,11 @@ public Map extract( return listTransitionRouteGroupsCallable; } + public UnaryCallable + listTransitionRouteGroupsPagedCallable() { + return listTransitionRouteGroupsPagedCallable; + } + public UnaryCallable getTransitionRouteGroupCallable() { return getTransitionRouteGroupCallable; diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsCallableFactory.java index a91c079f5..0417c5478 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Versions service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcVersionsCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java index c3d8e22f0..258ebc0f6 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -47,16 +47,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Versions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcVersionsStub extends VersionsStub { - private static final MethodDescriptor listVersionsMethodDescriptor = MethodDescriptor.newBuilder() @@ -66,6 +64,7 @@ public class GrpcVersionsStub extends VersionsStub { .setResponseMarshaller( ProtoUtils.marshaller(ListVersionsResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -73,6 +72,7 @@ public class GrpcVersionsStub extends VersionsStub { .setRequestMarshaller(ProtoUtils.marshaller(GetVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) .build(); + private static final MethodDescriptor createVersionMethodDescriptor = MethodDescriptor.newBuilder() @@ -82,6 +82,7 @@ public class GrpcVersionsStub extends VersionsStub { ProtoUtils.marshaller(CreateVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); + private static final MethodDescriptor updateVersionMethodDescriptor = MethodDescriptor.newBuilder() @@ -91,6 +92,7 @@ public class GrpcVersionsStub extends VersionsStub { ProtoUtils.marshaller(UpdateVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Version.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -98,6 +100,7 @@ public class GrpcVersionsStub extends VersionsStub { .setRequestMarshaller(ProtoUtils.marshaller(DeleteVersionRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor loadVersionMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -106,9 +109,6 @@ public class GrpcVersionsStub extends VersionsStub { .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final GrpcOperationsStub operationsStub; - private final UnaryCallable listVersionsCallable; private final UnaryCallable listVersionsPagedCallable; @@ -121,6 +121,8 @@ public class GrpcVersionsStub extends VersionsStub { private final UnaryCallable loadVersionCallable; private final OperationCallable loadVersionOperationCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcVersionsStub create(VersionsStubSettings settings) throws IOException { @@ -137,19 +139,11 @@ public static final GrpcVersionsStub create( VersionsStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcVersionsStub(VersionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcVersionsCallableFactory()); } - /** - * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcVersionsStub( VersionsStubSettings settings, ClientContext clientContext, @@ -254,7 +248,7 @@ public Map extract(LoadVersionRequest request) { createVersionTransportSettings, settings.createVersionOperationSettings(), clientContext, - this.operationsStub); + operationsStub); this.updateVersionCallable = callableFactory.createUnaryCallable( updateVersionTransportSettings, settings.updateVersionSettings(), clientContext); @@ -269,38 +263,37 @@ public Map extract(LoadVersionRequest request) { loadVersionTransportSettings, settings.loadVersionOperationSettings(), clientContext, - this.operationsStub); + operationsStub); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public GrpcOperationsStub getOperationsStub() { return operationsStub; } - public UnaryCallable listVersionsPagedCallable() { - return listVersionsPagedCallable; - } - public UnaryCallable listVersionsCallable() { return listVersionsCallable; } + public UnaryCallable listVersionsPagedCallable() { + return listVersionsPagedCallable; + } + public UnaryCallable getVersionCallable() { return getVersionCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public UnaryCallable createVersionCallable() { + return createVersionCallable; + } + public OperationCallable createVersionOperationCallable() { return createVersionOperationCallable; } - public UnaryCallable createVersionCallable() { - return createVersionCallable; - } - public UnaryCallable updateVersionCallable() { return updateVersionCallable; } @@ -309,15 +302,14 @@ public UnaryCallable deleteVersionCallable() { return deleteVersionCallable; } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") - public OperationCallable loadVersionOperationCallable() { - return loadVersionOperationCallable; - } - public UnaryCallable loadVersionCallable() { return loadVersionCallable; } + public OperationCallable loadVersionOperationCallable() { + return loadVersionOperationCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksCallableFactory.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksCallableFactory.java index cc82f36f9..583717c7b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksCallableFactory.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksCallableFactory.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.grpc.GrpcCallSettings; import com.google.api.gax.grpc.GrpcCallableFactory; import com.google.api.gax.grpc.GrpcStubCallableFactory; @@ -31,18 +31,19 @@ import com.google.api.gax.rpc.StreamingCallSettings; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; import com.google.longrunning.stub.OperationsStub; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC callable factory implementation for Dialogflow API. + * gRPC callable factory implementation for the Webhooks service API. * *

This class is for advanced usage. */ @Generated("by gapic-generator") -@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public class GrpcWebhooksCallableFactory implements GrpcStubCallableFactory { + @Override public UnaryCallable createUnaryCallable( GrpcCallSettings grpcCallSettings, @@ -55,61 +56,58 @@ public UnaryCallable createUnaryCalla public UnaryCallable createPagedCallable( GrpcCallSettings grpcCallSettings, - PagedCallSettings pagedCallSettings, + PagedCallSettings callSettings, ClientContext clientContext) { - return GrpcCallableFactory.createPagedCallable( - grpcCallSettings, pagedCallSettings, clientContext); + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); } @Override public UnaryCallable createBatchingCallable( GrpcCallSettings grpcCallSettings, - BatchingCallSettings batchingCallSettings, + BatchingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBatchingCallable( - grpcCallSettings, batchingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } - @BetaApi( - "The surface for long-running operations is not stable yet and may change in the future.") @Override public OperationCallable createOperationCallable( - GrpcCallSettings grpcCallSettings, - OperationCallSettings operationCallSettings, + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, ClientContext clientContext, OperationsStub operationsStub) { return GrpcCallableFactory.createOperationCallable( - grpcCallSettings, operationCallSettings, clientContext, operationsStub); + grpcCallSettings, callSettings, clientContext, operationsStub); } @Override public BidiStreamingCallable createBidiStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createBidiStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ServerStreamingCallable createServerStreamingCallable( GrpcCallSettings grpcCallSettings, - ServerStreamingCallSettings streamingCallSettings, + ServerStreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createServerStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } @Override public ClientStreamingCallable createClientStreamingCallable( GrpcCallSettings grpcCallSettings, - StreamingCallSettings streamingCallSettings, + StreamingCallSettings callSettings, ClientContext clientContext) { return GrpcCallableFactory.createClientStreamingCallable( - grpcCallSettings, streamingCallSettings, clientContext); + grpcCallSettings, callSettings, clientContext); } } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java index b61fe2afd..faa226bfa 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; import com.google.api.gax.grpc.GrpcCallSettings; @@ -33,6 +33,7 @@ import com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest; import com.google.cloud.dialogflow.cx.v3beta1.Webhook; import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; @@ -41,16 +42,14 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * gRPC stub implementation for Dialogflow API. + * gRPC stub implementation for the Webhooks service API. * *

This class is for advanced usage and reflects the underlying API directly. */ -@Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +@Generated("by gapic-generator-java") public class GrpcWebhooksStub extends WebhooksStub { - private static final MethodDescriptor listWebhooksMethodDescriptor = MethodDescriptor.newBuilder() @@ -60,6 +59,7 @@ public class GrpcWebhooksStub extends WebhooksStub { .setResponseMarshaller( ProtoUtils.marshaller(ListWebhooksResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor getWebhookMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -67,6 +67,7 @@ public class GrpcWebhooksStub extends WebhooksStub { .setRequestMarshaller(ProtoUtils.marshaller(GetWebhookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) .build(); + private static final MethodDescriptor createWebhookMethodDescriptor = MethodDescriptor.newBuilder() @@ -76,6 +77,7 @@ public class GrpcWebhooksStub extends WebhooksStub { ProtoUtils.marshaller(CreateWebhookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) .build(); + private static final MethodDescriptor updateWebhookMethodDescriptor = MethodDescriptor.newBuilder() @@ -85,6 +87,7 @@ public class GrpcWebhooksStub extends WebhooksStub { ProtoUtils.marshaller(UpdateWebhookRequest.getDefaultInstance())) .setResponseMarshaller(ProtoUtils.marshaller(Webhook.getDefaultInstance())) .build(); + private static final MethodDescriptor deleteWebhookMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.UNARY) @@ -93,8 +96,6 @@ public class GrpcWebhooksStub extends WebhooksStub { .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); - private final BackgroundResource backgroundResources; - private final UnaryCallable listWebhooksCallable; private final UnaryCallable listWebhooksPagedCallable; @@ -103,6 +104,8 @@ public class GrpcWebhooksStub extends WebhooksStub { private final UnaryCallable updateWebhookCallable; private final UnaryCallable deleteWebhookCallable; + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; private final GrpcStubCallableFactory callableFactory; public static final GrpcWebhooksStub create(WebhooksStubSettings settings) throws IOException { @@ -119,25 +122,18 @@ public static final GrpcWebhooksStub create( WebhooksStubSettings.newBuilder().build(), clientContext, callableFactory); } - /** - * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcWebhooksStub(WebhooksStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcWebhooksCallableFactory()); } - /** - * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that - * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. - */ protected GrpcWebhooksStub( WebhooksStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); GrpcCallSettings listWebhooksTransportSettings = GrpcCallSettings.newBuilder() @@ -224,17 +220,22 @@ public Map extract(DeleteWebhookRequest request) { callableFactory.createUnaryCallable( deleteWebhookTransportSettings, settings.deleteWebhookSettings(), clientContext); - backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } - public UnaryCallable listWebhooksPagedCallable() { - return listWebhooksPagedCallable; + public GrpcOperationsStub getOperationsStub() { + return operationsStub; } public UnaryCallable listWebhooksCallable() { return listWebhooksCallable; } + public UnaryCallable listWebhooksPagedCallable() { + return listWebhooksPagedCallable; + } + public UnaryCallable getWebhookCallable() { return getWebhookCallable; } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStub.java index 5c3af36e6..f27d4655c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Intents service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class IntentsStub implements BackgroundResource { public UnaryCallable listIntentsPagedCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java index 9627f555c..c37ce3912 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link IntentsStub}. * @@ -73,22 +75,22 @@ * *

For example, to set the total timeout of getIntent to 30 seconds: * - *

- * 
- * IntentsStubSettings.Builder intentsSettingsBuilder =
- *     IntentsStubSettings.newBuilder();
+ * 
{@code
+ * IntentsStubSettings.Builder intentsSettingsBuilder = IntentsStubSettings.newBuilder();
  * intentsSettingsBuilder
  *     .getIntentSettings()
  *     .setRetrySettings(
- *         intentsSettingsBuilder.getIntentSettings().getRetrySettings().toBuilder()
+ *         intentsSettingsBuilder
+ *             .getIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * IntentsStubSettings intentsSettings = intentsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class IntentsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -104,6 +106,59 @@ public class IntentsStubSettings extends StubSettings { private final UnaryCallSettings updateIntentSettings; private final UnaryCallSettings deleteIntentSettings; + private static final PagedListDescriptor + LIST_INTENTS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListIntentsRequest injectToken(ListIntentsRequest payload, String token) { + return ListIntentsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListIntentsRequest injectPageSize(ListIntentsRequest payload, int pageSize) { + return ListIntentsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListIntentsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListIntentsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListIntentsResponse payload) { + return Objects.isNull(payload.getIntentsList()) + ? ImmutableList.of() + : payload.getIntentsList(); + } + }; + + private static final PagedListResponseFactory< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> + LIST_INTENTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListIntentsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INTENTS_PAGE_STR_DESC, request, context); + return ListIntentsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listIntents. */ public PagedCallSettings listIntentsSettings() { @@ -136,10 +191,10 @@ public IntentsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcIntentsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -205,63 +260,9 @@ protected IntentsStubSettings(Builder settingsBuilder) throws IOException { deleteIntentSettings = settingsBuilder.deleteIntentSettings().build(); } - private static final PagedListDescriptor - LIST_INTENTS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListIntentsRequest injectToken(ListIntentsRequest payload, String token) { - return ListIntentsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListIntentsRequest injectPageSize(ListIntentsRequest payload, int pageSize) { - return ListIntentsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListIntentsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListIntentsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListIntentsResponse payload) { - return payload.getIntentsList() != null - ? payload.getIntentsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> - LIST_INTENTS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListIntentsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_INTENTS_PAGE_STR_DESC, request, context); - return ListIntentsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for IntentsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListIntentsRequest, ListIntentsResponse, ListIntentsPagedResponse> listIntentsSettings; @@ -269,7 +270,6 @@ public static class Builder extends StubSettings.Builder createIntentSettings; private final UnaryCallSettings.Builder updateIntentSettings; private final UnaryCallSettings.Builder deleteIntentSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -277,14 +277,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -303,46 +297,21 @@ public static class Builder extends StubSettings.Builder>of( + listIntentsSettings, + getIntentSettings, + createIntentSettings, + updateIntentSettings, + deleteIntentSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listIntentsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(IntentsStubSettings settings) { - super(settings); - - listIntentsSettings = settings.listIntentsSettings.toBuilder(); - getIntentSettings = settings.getIntentSettings.toBuilder(); - createIntentSettings = settings.createIntentSettings.toBuilder(); - updateIntentSettings = settings.updateIntentSettings.toBuilder(); - deleteIntentSettings = settings.deleteIntentSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listIntentsSettings, - getIntentSettings, - createIntentSettings, - updateIntentSettings, - deleteIntentSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStub.java index 205752417..8ca9d09ea 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Pages service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class PagesStub implements BackgroundResource { public UnaryCallable listPagesPagedCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java index 4041228e7..bf42997f8 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link PagesStub}. * @@ -73,22 +75,22 @@ * *

For example, to set the total timeout of getPage to 30 seconds: * - *

- * 
- * PagesStubSettings.Builder pagesSettingsBuilder =
- *     PagesStubSettings.newBuilder();
+ * 
{@code
+ * PagesStubSettings.Builder pagesSettingsBuilder = PagesStubSettings.newBuilder();
  * pagesSettingsBuilder
  *     .getPageSettings()
  *     .setRetrySettings(
- *         pagesSettingsBuilder.getPageSettings().getRetrySettings().toBuilder()
+ *         pagesSettingsBuilder
+ *             .getPageSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * PagesStubSettings pagesSettings = pagesSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class PagesStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -104,6 +106,59 @@ public class PagesStubSettings extends StubSettings { private final UnaryCallSettings updatePageSettings; private final UnaryCallSettings deletePageSettings; + private static final PagedListDescriptor + LIST_PAGES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListPagesRequest injectToken(ListPagesRequest payload, String token) { + return ListPagesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListPagesRequest injectPageSize(ListPagesRequest payload, int pageSize) { + return ListPagesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListPagesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListPagesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListPagesResponse payload) { + return Objects.isNull(payload.getPagesList()) + ? ImmutableList.of() + : payload.getPagesList(); + } + }; + + private static final PagedListResponseFactory< + ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> + LIST_PAGES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListPagesRequest, ListPagesResponse, ListPagesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListPagesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_PAGES_PAGE_STR_DESC, request, context); + return ListPagesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listPages. */ public PagedCallSettings listPagesSettings() { @@ -136,10 +191,10 @@ public PagesStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcPagesStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -205,63 +260,9 @@ protected PagesStubSettings(Builder settingsBuilder) throws IOException { deletePageSettings = settingsBuilder.deletePageSettings().build(); } - private static final PagedListDescriptor - LIST_PAGES_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListPagesRequest injectToken(ListPagesRequest payload, String token) { - return ListPagesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListPagesRequest injectPageSize(ListPagesRequest payload, int pageSize) { - return ListPagesRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListPagesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListPagesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListPagesResponse payload) { - return payload.getPagesList() != null - ? payload.getPagesList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> - LIST_PAGES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListPagesRequest, ListPagesResponse, ListPagesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListPagesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_PAGES_PAGE_STR_DESC, request, context); - return ListPagesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for PagesStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListPagesRequest, ListPagesResponse, ListPagesPagedResponse> listPagesSettings; @@ -269,7 +270,6 @@ public static class Builder extends StubSettings.Builder createPageSettings; private final UnaryCallSettings.Builder updatePageSettings; private final UnaryCallSettings.Builder deletePageSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -277,14 +277,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -303,46 +297,21 @@ public static class Builder extends StubSettings.Builder>of( + listPagesSettings, + getPageSettings, + createPageSettings, + updatePageSettings, + deletePageSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listPagesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getPageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createPageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updatePageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deletePageSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(PagesStubSettings settings) { - super(settings); - - listPagesSettings = settings.listPagesSettings.toBuilder(); - getPageSettings = settings.getPageSettings.toBuilder(); - createPageSettings = settings.createPageSettings.toBuilder(); - updatePageSettings = settings.updatePageSettings.toBuilder(); - deletePageSettings = settings.deletePageSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listPagesSettings, - getPageSettings, - createPageSettings, - updatePageSettings, - deletePageSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStub.java index 768ad88bb..8949b964e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the SessionEntityTypes service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SessionEntityTypesStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java index 65d27cf0e..1a27251ce 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionEntityTypesStub}. * @@ -73,22 +75,24 @@ * *

For example, to set the total timeout of getSessionEntityType to 30 seconds: * - *

- * 
+ * 
{@code
  * SessionEntityTypesStubSettings.Builder sessionEntityTypesSettingsBuilder =
  *     SessionEntityTypesStubSettings.newBuilder();
  * sessionEntityTypesSettingsBuilder
  *     .getSessionEntityTypeSettings()
  *     .setRetrySettings(
- *         sessionEntityTypesSettingsBuilder.getSessionEntityTypeSettings().getRetrySettings().toBuilder()
+ *         sessionEntityTypesSettingsBuilder
+ *             .getSessionEntityTypeSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * SessionEntityTypesStubSettings sessionEntityTypesSettings = sessionEntityTypesSettingsBuilder.build();
- * 
- * 
+ * SessionEntityTypesStubSettings sessionEntityTypesSettings = + * sessionEntityTypesSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class SessionEntityTypesStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -111,6 +115,76 @@ public class SessionEntityTypesStubSettings extends StubSettings deleteSessionEntityTypeSettings; + private static final PagedListDescriptor< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> + LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC = + new PagedListDescriptor< + ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListSessionEntityTypesRequest injectToken( + ListSessionEntityTypesRequest payload, String token) { + return ListSessionEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListSessionEntityTypesRequest injectPageSize( + ListSessionEntityTypesRequest payload, int pageSize) { + return ListSessionEntityTypesRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListSessionEntityTypesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListSessionEntityTypesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListSessionEntityTypesResponse payload) { + return Objects.isNull(payload.getSessionEntityTypesList()) + ? ImmutableList.of() + : payload.getSessionEntityTypesList(); + } + }; + + private static final PagedListResponseFactory< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse> + LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + ListSessionEntityTypesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListSessionEntityTypesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListSessionEntityTypesRequest, + ListSessionEntityTypesResponse, + SessionEntityType> + pageContext = + PageContext.create( + callable, LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC, request, context); + return ListSessionEntityTypesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listSessionEntityTypes. */ public PagedCallSettings< ListSessionEntityTypesRequest, @@ -150,10 +224,10 @@ public SessionEntityTypesStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcSessionEntityTypesStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -220,81 +294,10 @@ protected SessionEntityTypesStubSettings(Builder settingsBuilder) throws IOExcep deleteSessionEntityTypeSettings = settingsBuilder.deleteSessionEntityTypeSettings().build(); } - private static final PagedListDescriptor< - ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType> - LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC = - new PagedListDescriptor< - ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, SessionEntityType>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListSessionEntityTypesRequest injectToken( - ListSessionEntityTypesRequest payload, String token) { - return ListSessionEntityTypesRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListSessionEntityTypesRequest injectPageSize( - ListSessionEntityTypesRequest payload, int pageSize) { - return ListSessionEntityTypesRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(ListSessionEntityTypesRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListSessionEntityTypesResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - ListSessionEntityTypesResponse payload) { - return payload.getSessionEntityTypesList() != null - ? payload.getSessionEntityTypesList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListSessionEntityTypesRequest, - ListSessionEntityTypesResponse, - ListSessionEntityTypesPagedResponse> - LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT = - new PagedListResponseFactory< - ListSessionEntityTypesRequest, - ListSessionEntityTypesResponse, - ListSessionEntityTypesPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - ListSessionEntityTypesRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - ListSessionEntityTypesRequest, - ListSessionEntityTypesResponse, - SessionEntityType> - pageContext = - PageContext.create( - callable, LIST_SESSION_ENTITY_TYPES_PAGE_STR_DESC, request, context); - return ListSessionEntityTypesPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for SessionEntityTypesStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListSessionEntityTypesRequest, ListSessionEntityTypesResponse, @@ -308,7 +311,6 @@ public static class Builder updateSessionEntityTypeSettings; private final UnaryCallSettings.Builder deleteSessionEntityTypeSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -316,14 +318,8 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -342,33 +338,12 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_1_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("retry_policy_2_params", settings); - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("no_retry_1_params", settings); + definitions.put("retry_policy_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { @@ -376,13 +351,9 @@ protected Builder(ClientContext clientContext) { listSessionEntityTypesSettings = PagedCallSettings.newBuilder(LIST_SESSION_ENTITY_TYPES_PAGE_STR_FACT); - getSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteSessionEntityTypeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = @@ -392,68 +363,68 @@ protected Builder(ClientContext clientContext) { createSessionEntityTypeSettings, updateSessionEntityTypeSettings, deleteSessionEntityTypeSettings); - initDefaults(this); } + protected Builder(SessionEntityTypesStubSettings settings) { + super(settings); + + listSessionEntityTypesSettings = settings.listSessionEntityTypesSettings.toBuilder(); + getSessionEntityTypeSettings = settings.getSessionEntityTypeSettings.toBuilder(); + createSessionEntityTypeSettings = settings.createSessionEntityTypeSettings.toBuilder(); + updateSessionEntityTypeSettings = settings.updateSessionEntityTypeSettings.toBuilder(); + deleteSessionEntityTypeSettings = settings.deleteSessionEntityTypeSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listSessionEntityTypesSettings, + getSessionEntityTypeSettings, + createSessionEntityTypeSettings, + updateSessionEntityTypeSettings, + deleteSessionEntityTypeSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listSessionEntityTypesSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteSessionEntityTypeSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(SessionEntityTypesStubSettings settings) { - super(settings); - - listSessionEntityTypesSettings = settings.listSessionEntityTypesSettings.toBuilder(); - getSessionEntityTypeSettings = settings.getSessionEntityTypeSettings.toBuilder(); - createSessionEntityTypeSettings = settings.createSessionEntityTypeSettings.toBuilder(); - updateSessionEntityTypeSettings = settings.updateSessionEntityTypeSettings.toBuilder(); - deleteSessionEntityTypeSettings = settings.deleteSessionEntityTypeSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listSessionEntityTypesSettings, - getSessionEntityTypeSettings, - createSessionEntityTypeSettings, - updateSessionEntityTypeSettings, - deleteSessionEntityTypeSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStub.java index 40d767ef6..19d6b2a03 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -29,14 +29,13 @@ import com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentResponse; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Sessions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class SessionsStub implements BackgroundResource { public UnaryCallable detectIntentCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStubSettings.java index 9e8f7c58b..944973044 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import com.google.api.core.ApiFunction; @@ -48,7 +49,7 @@ import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link SessionsStub}. * @@ -65,22 +66,22 @@ * *

For example, to set the total timeout of detectIntent to 30 seconds: * - *

- * 
- * SessionsStubSettings.Builder sessionsSettingsBuilder =
- *     SessionsStubSettings.newBuilder();
+ * 
{@code
+ * SessionsStubSettings.Builder sessionsSettingsBuilder = SessionsStubSettings.newBuilder();
  * sessionsSettingsBuilder
  *     .detectIntentSettings()
  *     .setRetrySettings(
- *         sessionsSettingsBuilder.detectIntentSettings().getRetrySettings().toBuilder()
+ *         sessionsSettingsBuilder
+ *             .detectIntentSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * SessionsStubSettings sessionsSettings = sessionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class SessionsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -123,10 +124,10 @@ public SessionsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcSessionsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -194,7 +195,6 @@ protected SessionsStubSettings(Builder settingsBuilder) throws IOException { /** Builder for SessionsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final UnaryCallSettings.Builder detectIntentSettings; private final StreamingCallSettings.Builder< @@ -204,7 +204,6 @@ public static class Builder extends StubSettings.Builder fulfillIntentSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -214,12 +213,11 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -233,101 +231,96 @@ public static class Builder extends StubSettings.Builder>of( detectIntentSettings, matchIntentSettings, fulfillIntentSettings); - initDefaults(this); } + protected Builder(SessionsStubSettings settings) { + super(settings); + + detectIntentSettings = settings.detectIntentSettings.toBuilder(); + streamingDetectIntentSettings = settings.streamingDetectIntentSettings.toBuilder(); + matchIntentSettings = settings.matchIntentSettings.toBuilder(); + fulfillIntentSettings = settings.fulfillIntentSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + detectIntentSettings, matchIntentSettings, fulfillIntentSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .detectIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_2_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_2_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); builder .matchIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .fulfillIntentSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(SessionsStubSettings settings) { - super(settings); - - detectIntentSettings = settings.detectIntentSettings.toBuilder(); - streamingDetectIntentSettings = settings.streamingDetectIntentSettings.toBuilder(); - matchIntentSettings = settings.matchIntentSettings.toBuilder(); - fulfillIntentSettings = settings.fulfillIntentSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - detectIntentSettings, matchIntentSettings, fulfillIntentSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStub.java index f0ea471c4..50025957a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the TransitionRouteGroups service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class TransitionRouteGroupsStub implements BackgroundResource { public UnaryCallable diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java index b33052338..b737a48fe 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link TransitionRouteGroupsStub}. * @@ -73,22 +75,24 @@ * *

For example, to set the total timeout of getTransitionRouteGroup to 30 seconds: * - *

- * 
+ * 
{@code
  * TransitionRouteGroupsStubSettings.Builder transitionRouteGroupsSettingsBuilder =
  *     TransitionRouteGroupsStubSettings.newBuilder();
  * transitionRouteGroupsSettingsBuilder
  *     .getTransitionRouteGroupSettings()
  *     .setRetrySettings(
- *         transitionRouteGroupsSettingsBuilder.getTransitionRouteGroupSettings().getRetrySettings().toBuilder()
+ *         transitionRouteGroupsSettingsBuilder
+ *             .getTransitionRouteGroupSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
- * TransitionRouteGroupsStubSettings transitionRouteGroupsSettings = transitionRouteGroupsSettingsBuilder.build();
- * 
- * 
+ * TransitionRouteGroupsStubSettings transitionRouteGroupsSettings = + * transitionRouteGroupsSettingsBuilder.build(); + * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class TransitionRouteGroupsStubSettings extends StubSettings { /** The default scopes of the service. */ @@ -112,6 +116,81 @@ public class TransitionRouteGroupsStubSettings private final UnaryCallSettings deleteTransitionRouteGroupSettings; + private static final PagedListDescriptor< + ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse, TransitionRouteGroup> + LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC = + new PagedListDescriptor< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListTransitionRouteGroupsRequest injectToken( + ListTransitionRouteGroupsRequest payload, String token) { + return ListTransitionRouteGroupsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListTransitionRouteGroupsRequest injectPageSize( + ListTransitionRouteGroupsRequest payload, int pageSize) { + return ListTransitionRouteGroupsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListTransitionRouteGroupsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListTransitionRouteGroupsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListTransitionRouteGroupsResponse payload) { + return Objects.isNull(payload.getTransitionRouteGroupsList()) + ? ImmutableList.of() + : payload.getTransitionRouteGroupsList(); + } + }; + + private static final PagedListResponseFactory< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse> + LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + ListTransitionRouteGroupsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListTransitionRouteGroupsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListTransitionRouteGroupsRequest, + ListTransitionRouteGroupsResponse, + TransitionRouteGroup> + pageContext = + PageContext.create( + callable, LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC, request, context); + return ListTransitionRouteGroupsPagedResponse.createAsync( + pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listTransitionRouteGroups. */ public PagedCallSettings< ListTransitionRouteGroupsRequest, @@ -151,10 +230,10 @@ public TransitionRouteGroupsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcTransitionRouteGroupsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -224,86 +303,10 @@ protected TransitionRouteGroupsStubSettings(Builder settingsBuilder) throws IOEx settingsBuilder.deleteTransitionRouteGroupSettings().build(); } - private static final PagedListDescriptor< - ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse, TransitionRouteGroup> - LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC = - new PagedListDescriptor< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - TransitionRouteGroup>() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListTransitionRouteGroupsRequest injectToken( - ListTransitionRouteGroupsRequest payload, String token) { - return ListTransitionRouteGroupsRequest.newBuilder(payload) - .setPageToken(token) - .build(); - } - - @Override - public ListTransitionRouteGroupsRequest injectPageSize( - ListTransitionRouteGroupsRequest payload, int pageSize) { - return ListTransitionRouteGroupsRequest.newBuilder(payload) - .setPageSize(pageSize) - .build(); - } - - @Override - public Integer extractPageSize(ListTransitionRouteGroupsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListTransitionRouteGroupsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources( - ListTransitionRouteGroupsResponse payload) { - return payload.getTransitionRouteGroupsList() != null - ? payload.getTransitionRouteGroupsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - ListTransitionRouteGroupsPagedResponse> - LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - ListTransitionRouteGroupsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable - callable, - ListTransitionRouteGroupsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext< - ListTransitionRouteGroupsRequest, - ListTransitionRouteGroupsResponse, - TransitionRouteGroup> - pageContext = - PageContext.create( - callable, LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_DESC, request, context); - return ListTransitionRouteGroupsPagedResponse.createAsync( - pageContext, futureResponse); - } - }; - /** Builder for TransitionRouteGroupsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListTransitionRouteGroupsRequest, ListTransitionRouteGroupsResponse, @@ -317,7 +320,6 @@ public static class Builder updateTransitionRouteGroupSettings; private final UnaryCallSettings.Builder deleteTransitionRouteGroupSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -325,14 +327,8 @@ public static class Builder ImmutableMap.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -351,33 +347,12 @@ public static class Builder .setMaxRpcTimeout(Duration.ofMillis(60000L)) .setTotalTimeout(Duration.ofMillis(60000L)) .build(); - definitions.put("retry_policy_1_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("retry_policy_2_params", settings); - settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); - definitions.put("no_retry_params", settings); - settings = - RetrySettings.newBuilder() - .setInitialRpcTimeout(Duration.ofMillis(220000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(220000L)) - .setTotalTimeout(Duration.ofMillis(220000L)) - .build(); - definitions.put("no_retry_1_params", settings); + definitions.put("retry_policy_0_params", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } protected Builder() { - this((ClientContext) null); + this(((ClientContext) null)); } protected Builder(ClientContext clientContext) { @@ -385,13 +360,9 @@ protected Builder(ClientContext clientContext) { listTransitionRouteGroupsSettings = PagedCallSettings.newBuilder(LIST_TRANSITION_ROUTE_GROUPS_PAGE_STR_FACT); - getTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - createTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - updateTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); - deleteTransitionRouteGroupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); unaryMethodSettingsBuilders = @@ -401,68 +372,68 @@ protected Builder(ClientContext clientContext) { createTransitionRouteGroupSettings, updateTransitionRouteGroupSettings, deleteTransitionRouteGroupSettings); - initDefaults(this); } + protected Builder(TransitionRouteGroupsStubSettings settings) { + super(settings); + + listTransitionRouteGroupsSettings = settings.listTransitionRouteGroupsSettings.toBuilder(); + getTransitionRouteGroupSettings = settings.getTransitionRouteGroupSettings.toBuilder(); + createTransitionRouteGroupSettings = settings.createTransitionRouteGroupSettings.toBuilder(); + updateTransitionRouteGroupSettings = settings.updateTransitionRouteGroupSettings.toBuilder(); + deleteTransitionRouteGroupSettings = settings.deleteTransitionRouteGroupSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listTransitionRouteGroupsSettings, + getTransitionRouteGroupSettings, + createTransitionRouteGroupSettings, + updateTransitionRouteGroupSettings, + deleteTransitionRouteGroupSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listTransitionRouteGroupsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteTransitionRouteGroupSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(TransitionRouteGroupsStubSettings settings) { - super(settings); - - listTransitionRouteGroupsSettings = settings.listTransitionRouteGroupsSettings.toBuilder(); - getTransitionRouteGroupSettings = settings.getTransitionRouteGroupSettings.toBuilder(); - createTransitionRouteGroupSettings = settings.createTransitionRouteGroupSettings.toBuilder(); - updateTransitionRouteGroupSettings = settings.updateTransitionRouteGroupSettings.toBuilder(); - deleteTransitionRouteGroupSettings = settings.deleteTransitionRouteGroupSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listTransitionRouteGroupsSettings, - getTransitionRouteGroupSettings, - createTransitionRouteGroupSettings, - updateTransitionRouteGroupSettings, - deleteTransitionRouteGroupSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStub.java index c8f517ae4..3dcc0eb39 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.UnaryCallable; @@ -36,17 +36,15 @@ import com.google.protobuf.Struct; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Versions service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class VersionsStub implements BackgroundResource { - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationsStub getOperationsStub() { throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); } @@ -63,7 +61,6 @@ public UnaryCallable getVersionCallable() { throw new UnsupportedOperationException("Not implemented: getVersionCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable createVersionOperationCallable() { throw new UnsupportedOperationException("Not implemented: createVersionOperationCallable()"); @@ -81,7 +78,6 @@ public UnaryCallable deleteVersionCallable() { throw new UnsupportedOperationException("Not implemented: deleteVersionCallable()"); } - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallable loadVersionOperationCallable() { throw new UnsupportedOperationException("Not implemented: loadVersionOperationCallable()"); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java index ea2ee7465..47be991f8 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; @@ -61,10 +62,11 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link VersionsStub}. * @@ -81,22 +83,22 @@ * *

For example, to set the total timeout of getVersion to 30 seconds: * - *

- * 
- * VersionsStubSettings.Builder versionsSettingsBuilder =
- *     VersionsStubSettings.newBuilder();
+ * 
{@code
+ * VersionsStubSettings.Builder versionsSettingsBuilder = VersionsStubSettings.newBuilder();
  * versionsSettingsBuilder
  *     .getVersionSettings()
  *     .setRetrySettings(
- *         versionsSettingsBuilder.getVersionSettings().getRetrySettings().toBuilder()
+ *         versionsSettingsBuilder
+ *             .getVersionSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * VersionsStubSettings versionsSettings = versionsSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class VersionsStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -118,6 +120,59 @@ public class VersionsStubSettings extends StubSettings { private final OperationCallSettings loadVersionOperationSettings; + private static final PagedListDescriptor + LIST_VERSIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListVersionsRequest injectToken(ListVersionsRequest payload, String token) { + return ListVersionsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListVersionsRequest injectPageSize(ListVersionsRequest payload, int pageSize) { + return ListVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListVersionsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListVersionsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListVersionsResponse payload) { + return Objects.isNull(payload.getVersionsList()) + ? ImmutableList.of() + : payload.getVersionsList(); + } + }; + + private static final PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> + LIST_VERSIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListVersionsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_VERSIONS_PAGE_STR_DESC, request, context); + return ListVersionsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listVersions. */ public PagedCallSettings listVersionsSettings() { @@ -135,7 +190,6 @@ public UnaryCallSettings createVersionSettings( } /** Returns the object with the settings used for calls to createVersion. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings createVersionOperationSettings() { return createVersionOperationSettings; @@ -157,7 +211,6 @@ public UnaryCallSettings loadVersionSettings() { } /** Returns the object with the settings used for calls to loadVersion. */ - @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") public OperationCallSettings loadVersionOperationSettings() { return loadVersionOperationSettings; } @@ -168,10 +221,10 @@ public VersionsStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcVersionsStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -240,63 +293,9 @@ protected VersionsStubSettings(Builder settingsBuilder) throws IOException { loadVersionOperationSettings = settingsBuilder.loadVersionOperationSettings().build(); } - private static final PagedListDescriptor - LIST_VERSIONS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListVersionsRequest injectToken(ListVersionsRequest payload, String token) { - return ListVersionsRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListVersionsRequest injectPageSize(ListVersionsRequest payload, int pageSize) { - return ListVersionsRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListVersionsRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListVersionsResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListVersionsResponse payload) { - return payload.getVersionsList() != null - ? payload.getVersionsList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> - LIST_VERSIONS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListVersionsRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_VERSIONS_PAGE_STR_DESC, request, context); - return ListVersionsPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for VersionsStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListVersionsRequest, ListVersionsResponse, ListVersionsPagedResponse> listVersionsSettings; @@ -310,7 +309,6 @@ public static class Builder extends StubSettings.Builder loadVersionSettings; private final OperationCallSettings.Builder loadVersionOperationSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -318,14 +316,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -344,52 +336,24 @@ public static class Builder extends StubSettings.Builder>of( + listVersionsSettings, + getVersionSettings, + createVersionSettings, + updateVersionSettings, + deleteVersionSettings, + loadVersionSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listVersionsSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .loadVersionSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + builder .createVersionOperationSettings() .setInitialCallSettings( UnaryCallSettings .newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Version.class)) @@ -460,20 +447,21 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); + builder .loadVersionOperationSettings() .setInitialCallSettings( UnaryCallSettings.newUnaryCallSettingsBuilder() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) .build()) .setResponseTransformer( ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) @@ -482,41 +470,19 @@ private static Builder initDefaults(Builder builder) { .setPollingAlgorithm( OperationTimedPollAlgorithm.create( RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(500L)) + .setInitialRetryDelay(Duration.ofMillis(5000L)) .setRetryDelayMultiplier(1.5) - .setMaxRetryDelay(Duration.ofMillis(5000L)) - .setInitialRpcTimeout(Duration.ZERO) // ignored - .setRpcTimeoutMultiplier(1.0) // ignored - .setMaxRpcTimeout(Duration.ZERO) // ignored + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) .setTotalTimeout(Duration.ofMillis(300000L)) .build())); return builder; } - protected Builder(VersionsStubSettings settings) { - super(settings); - - listVersionsSettings = settings.listVersionsSettings.toBuilder(); - getVersionSettings = settings.getVersionSettings.toBuilder(); - createVersionSettings = settings.createVersionSettings.toBuilder(); - createVersionOperationSettings = settings.createVersionOperationSettings.toBuilder(); - updateVersionSettings = settings.updateVersionSettings.toBuilder(); - deleteVersionSettings = settings.deleteVersionSettings.toBuilder(); - loadVersionSettings = settings.loadVersionSettings.toBuilder(); - loadVersionOperationSettings = settings.loadVersionOperationSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listVersionsSettings, - getVersionSettings, - createVersionSettings, - updateVersionSettings, - deleteVersionSettings, - loadVersionSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStub.java index e0c1fdeb4..cd7ddb77a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStub.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; -import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest; @@ -30,14 +30,13 @@ import com.google.protobuf.Empty; import javax.annotation.Generated; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * Base stub class for Dialogflow API. + * Base stub class for the Webhooks service API. * *

This class is for advanced usage and reflects the underlying API directly. */ @Generated("by gapic-generator") -@BetaApi("A restructuring of stub classes is planned, so this may break in the future") public abstract class WebhooksStub implements BackgroundResource { public UnaryCallable listWebhooksPagedCallable() { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java index a898bec2d..3b300d6ce 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1.stub; import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; @@ -53,10 +54,11 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; +import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; -// AUTO-GENERATED DOCUMENTATION AND CLASS +// AUTO-GENERATED DOCUMENTATION AND CLASS. /** * Settings class to configure an instance of {@link WebhooksStub}. * @@ -73,22 +75,22 @@ * *

For example, to set the total timeout of getWebhook to 30 seconds: * - *

- * 
- * WebhooksStubSettings.Builder webhooksSettingsBuilder =
- *     WebhooksStubSettings.newBuilder();
+ * 
{@code
+ * WebhooksStubSettings.Builder webhooksSettingsBuilder = WebhooksStubSettings.newBuilder();
  * webhooksSettingsBuilder
  *     .getWebhookSettings()
  *     .setRetrySettings(
- *         webhooksSettingsBuilder.getWebhookSettings().getRetrySettings().toBuilder()
+ *         webhooksSettingsBuilder
+ *             .getWebhookSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
  *             .setTotalTimeout(Duration.ofSeconds(30))
  *             .build());
  * WebhooksStubSettings webhooksSettings = webhooksSettingsBuilder.build();
- * 
- * 
+ * }
*/ -@Generated("by gapic-generator") @BetaApi +@Generated("by gapic-generator-java") public class WebhooksStubSettings extends StubSettings { /** The default scopes of the service. */ private static final ImmutableList DEFAULT_SERVICE_SCOPES = @@ -105,6 +107,59 @@ public class WebhooksStubSettings extends StubSettings { private final UnaryCallSettings updateWebhookSettings; private final UnaryCallSettings deleteWebhookSettings; + private static final PagedListDescriptor + LIST_WEBHOOKS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListWebhooksRequest injectToken(ListWebhooksRequest payload, String token) { + return ListWebhooksRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListWebhooksRequest injectPageSize(ListWebhooksRequest payload, int pageSize) { + return ListWebhooksRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListWebhooksRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListWebhooksResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListWebhooksResponse payload) { + return Objects.isNull(payload.getWebhooksList()) + ? ImmutableList.of() + : payload.getWebhooksList(); + } + }; + + private static final PagedListResponseFactory< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> + LIST_WEBHOOKS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListWebhooksRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_WEBHOOKS_PAGE_STR_DESC, request, context); + return ListWebhooksPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Returns the object with the settings used for calls to listWebhooks. */ public PagedCallSettings listWebhooksSettings() { @@ -137,10 +192,10 @@ public WebhooksStub createStub() throws IOException { .getTransportName() .equals(GrpcTransportChannel.getGrpcTransportName())) { return GrpcWebhooksStub.create(this); - } else { - throw new UnsupportedOperationException( - "Transport not supported: " + getTransportChannelProvider().getTransportName()); } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); } /** Returns a builder for the default ExecutorProvider for this service. */ @@ -206,63 +261,9 @@ protected WebhooksStubSettings(Builder settingsBuilder) throws IOException { deleteWebhookSettings = settingsBuilder.deleteWebhookSettings().build(); } - private static final PagedListDescriptor - LIST_WEBHOOKS_PAGE_STR_DESC = - new PagedListDescriptor() { - @Override - public String emptyToken() { - return ""; - } - - @Override - public ListWebhooksRequest injectToken(ListWebhooksRequest payload, String token) { - return ListWebhooksRequest.newBuilder(payload).setPageToken(token).build(); - } - - @Override - public ListWebhooksRequest injectPageSize(ListWebhooksRequest payload, int pageSize) { - return ListWebhooksRequest.newBuilder(payload).setPageSize(pageSize).build(); - } - - @Override - public Integer extractPageSize(ListWebhooksRequest payload) { - return payload.getPageSize(); - } - - @Override - public String extractNextToken(ListWebhooksResponse payload) { - return payload.getNextPageToken(); - } - - @Override - public Iterable extractResources(ListWebhooksResponse payload) { - return payload.getWebhooksList() != null - ? payload.getWebhooksList() - : ImmutableList.of(); - } - }; - - private static final PagedListResponseFactory< - ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> - LIST_WEBHOOKS_PAGE_STR_FACT = - new PagedListResponseFactory< - ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse>() { - @Override - public ApiFuture getFuturePagedResponse( - UnaryCallable callable, - ListWebhooksRequest request, - ApiCallContext context, - ApiFuture futureResponse) { - PageContext pageContext = - PageContext.create(callable, LIST_WEBHOOKS_PAGE_STR_DESC, request, context); - return ListWebhooksPagedResponse.createAsync(pageContext, futureResponse); - } - }; - /** Builder for WebhooksStubSettings. */ public static class Builder extends StubSettings.Builder { private final ImmutableList> unaryMethodSettingsBuilders; - private final PagedCallSettings.Builder< ListWebhooksRequest, ListWebhooksResponse, ListWebhooksPagedResponse> listWebhooksSettings; @@ -270,7 +271,6 @@ public static class Builder extends StubSettings.Builder createWebhookSettings; private final UnaryCallSettings.Builder updateWebhookSettings; private final UnaryCallSettings.Builder deleteWebhookSettings; - private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -278,14 +278,8 @@ public static class Builder extends StubSettings.Builder> definitions = ImmutableMap.builder(); definitions.put( - "retry_policy_1_codes", + "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); - definitions.put( - "retry_policy_2_codes", - ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); - definitions.put( - "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -304,46 +298,21 @@ public static class Builder extends StubSettings.Builder>of( + listWebhooksSettings, + getWebhookSettings, + createWebhookSettings, + updateWebhookSettings, + deleteWebhookSettings); + } + private static Builder createDefault() { - Builder builder = new Builder((ClientContext) null); + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); } private static Builder initDefaults(Builder builder) { - builder .listWebhooksSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .getWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .createWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .updateWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); builder .deleteWebhookSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_1_codes")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_1_params")); + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); return builder; } - protected Builder(WebhooksStubSettings settings) { - super(settings); - - listWebhooksSettings = settings.listWebhooksSettings.toBuilder(); - getWebhookSettings = settings.getWebhookSettings.toBuilder(); - createWebhookSettings = settings.createWebhookSettings.toBuilder(); - updateWebhookSettings = settings.updateWebhookSettings.toBuilder(); - deleteWebhookSettings = settings.deleteWebhookSettings.toBuilder(); - - unaryMethodSettingsBuilders = - ImmutableList.>of( - listWebhooksSettings, - getWebhookSettings, - createWebhookSettings, - updateWebhookSettings, - deleteWebhookSettings); - } - - // NEXT_MAJOR_VER: remove 'throws Exception' + // NEXT_MAJOR_VER: remove 'throws Exception'. /** * Applies the given settings updater function to all of the unary API methods in this service. * diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java index 0e7a52d60..588e7da9c 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.AgentsClient.ListAgentsPagedResponse; @@ -31,13 +32,13 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,66 +46,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class AgentsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private AgentsClient client; + private static MockAgents mockAgents; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockAgents)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); AgentsSettings settings = AgentsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -119,15 +85,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listAgentsTest() { - String nextPageToken = ""; - Agent agentsElement = Agent.newBuilder().build(); - List agents = Arrays.asList(agentsElement); + public void listAgentsTest() throws Exception { + Agent responsesElement = Agent.newBuilder().build(); ListAgentsResponse expectedResponse = ListAgentsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllAgents(agents) + .setNextPageToken("") + .addAllAgents(Arrays.asList(responsesElement)) .build(); mockAgents.addResponse(expectedResponse); @@ -136,14 +99,15 @@ public void listAgentsTest() { ListAgentsPagedResponse pagedListResponse = client.listAgents(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getAgentsList().get(0), resources.get(0)); List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListAgentsRequest actualRequest = (ListAgentsRequest) actualRequests.get(0); + ListAgentsRequest actualRequest = ((ListAgentsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -151,44 +115,77 @@ public void listAgentsTest() { } @Test - @SuppressWarnings("all") public void listAgentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAgents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAgentsTest2() throws Exception { + Agent responsesElement = Agent.newBuilder().build(); + ListAgentsResponse expectedResponse = + ListAgentsResponse.newBuilder() + .setNextPageToken("") + .addAllAgents(Arrays.asList(responsesElement)) + .build(); + mockAgents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAgentsPagedResponse pagedListResponse = client.listAgents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAgentsList().get(0), resources.get(0)); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAgentsRequest actualRequest = ((ListAgentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAgentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + try { + String parent = "parent-995424086"; client.listAgents(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getAgentTest() { - AgentName name2 = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - String displayName = "displayName1615086568"; - String defaultLanguageCode = "defaultLanguageCode856575222"; - String timeZone = "timeZone36848094"; - String description = "description-1724546052"; - String avatarUri = "avatarUri-402824826"; - FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - boolean enableStackdriverLogging = true; - boolean enableSpellCorrection = false; + public void getAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDefaultLanguageCode(defaultLanguageCode) - .setTimeZone(timeZone) - .setDescription(description) - .setAvatarUri(avatarUri) - .setStartFlow(startFlow.toString()) - .setEnableStackdriverLogging(enableStackdriverLogging) - .setEnableSpellCorrection(enableSpellCorrection) + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) .build(); mockAgents.addResponse(expectedResponse); @@ -199,9 +196,9 @@ public void getAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetAgentRequest actualRequest = (GetAgentRequest) actualRequests.get(0); + GetAgentRequest actualRequest = ((GetAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -209,44 +206,80 @@ public void getAgentTest() { } @Test - @SuppressWarnings("all") public void getAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.getAgent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getAgentTest2() throws Exception { + Agent expectedResponse = + Agent.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) + .build(); + mockAgents.addResponse(expectedResponse); + + String name = "name3373707"; + + Agent actualResponse = client.getAgent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAgentRequest actualRequest = ((GetAgentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAgentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + String name = "name3373707"; client.getAgent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createAgentTest() { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - String displayName = "displayName1615086568"; - String defaultLanguageCode = "defaultLanguageCode856575222"; - String timeZone = "timeZone36848094"; - String description = "description-1724546052"; - String avatarUri = "avatarUri-402824826"; - FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - boolean enableStackdriverLogging = true; - boolean enableSpellCorrection = false; + public void createAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDefaultLanguageCode(defaultLanguageCode) - .setTimeZone(timeZone) - .setDescription(description) - .setAvatarUri(avatarUri) - .setStartFlow(startFlow.toString()) - .setEnableStackdriverLogging(enableStackdriverLogging) - .setEnableSpellCorrection(enableSpellCorrection) + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) .build(); mockAgents.addResponse(expectedResponse); @@ -258,9 +291,9 @@ public void createAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateAgentRequest actualRequest = (CreateAgentRequest) actualRequests.get(0); + CreateAgentRequest actualRequest = ((CreateAgentRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(agent, actualRequest.getAgent()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -269,45 +302,84 @@ public void createAgentTest() { } @Test - @SuppressWarnings("all") public void createAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Agent agent = Agent.newBuilder().build(); + client.createAgent(parent, agent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void createAgentTest2() throws Exception { + Agent expectedResponse = + Agent.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) + .build(); + mockAgents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Agent agent = Agent.newBuilder().build(); + + Agent actualResponse = client.createAgent(parent, agent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAgentRequest actualRequest = ((CreateAgentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(agent, actualRequest.getAgent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAgentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + String parent = "parent-995424086"; + Agent agent = Agent.newBuilder().build(); client.createAgent(parent, agent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateAgentTest() { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - String displayName = "displayName1615086568"; - String defaultLanguageCode = "defaultLanguageCode856575222"; - String timeZone = "timeZone36848094"; - String description = "description-1724546052"; - String avatarUri = "avatarUri-402824826"; - FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - boolean enableStackdriverLogging = true; - boolean enableSpellCorrection = false; + public void updateAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDefaultLanguageCode(defaultLanguageCode) - .setTimeZone(timeZone) - .setDescription(description) - .setAvatarUri(avatarUri) - .setStartFlow(startFlow.toString()) - .setEnableStackdriverLogging(enableStackdriverLogging) - .setEnableSpellCorrection(enableSpellCorrection) + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) .build(); mockAgents.addResponse(expectedResponse); @@ -319,7 +391,7 @@ public void updateAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateAgentRequest actualRequest = (UpdateAgentRequest) actualRequests.get(0); + UpdateAgentRequest actualRequest = ((UpdateAgentRequest) actualRequests.get(0)); Assert.assertEquals(agent, actualRequest.getAgent()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -330,25 +402,22 @@ public void updateAgentTest() { } @Test - @SuppressWarnings("all") public void updateAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { Agent agent = Agent.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateAgent(agent, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteAgentTest() { + public void deleteAgentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockAgents.addResponse(expectedResponse); @@ -358,9 +427,9 @@ public void deleteAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteAgentRequest actualRequest = (DeleteAgentRequest) actualRequests.get(0); + DeleteAgentRequest actualRequest = ((DeleteAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -368,27 +437,56 @@ public void deleteAgentTest() { } @Test - @SuppressWarnings("all") public void deleteAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.deleteAgent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAgentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAgents.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteAgent(name); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAgentRequest actualRequest = ((DeleteAgentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAgentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + String name = "name3373707"; client.deleteAgent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void exportAgentTest() throws Exception { - String agentUri = "agentUri-1700713166"; - ExportAgentResponse expectedResponse = - ExportAgentResponse.newBuilder().setAgentUri(agentUri).build(); + ExportAgentResponse expectedResponse = ExportAgentResponse.newBuilder().build(); Operation resultOperation = Operation.newBuilder() .setName("exportAgentTest") @@ -397,17 +495,21 @@ public void exportAgentTest() throws Exception { .build(); mockAgents.addResponse(resultOperation); - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - ExportAgentRequest request = ExportAgentRequest.newBuilder().setName(name.toString()).build(); + ExportAgentRequest request = + ExportAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setAgentUri("agent_uri-1700713166") + .build(); ExportAgentResponse actualResponse = client.exportAgentAsync(request).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ExportAgentRequest actualRequest = (ExportAgentRequest) actualRequests.get(0); + ExportAgentRequest actualRequest = ((ExportAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAgentUri(), actualRequest.getAgentUri()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -415,26 +517,26 @@ public void exportAgentTest() throws Exception { } @Test - @SuppressWarnings("all") public void exportAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - ExportAgentRequest request = ExportAgentRequest.newBuilder().setName(name.toString()).build(); - + ExportAgentRequest request = + ExportAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setAgentUri("agent_uri-1700713166") + .build(); client.exportAgentAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") public void restoreAgentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = @@ -445,17 +547,20 @@ public void restoreAgentTest() throws Exception { .build(); mockAgents.addResponse(resultOperation); - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - RestoreAgentRequest request = RestoreAgentRequest.newBuilder().setName(name.toString()).build(); + RestoreAgentRequest request = + RestoreAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .build(); - Empty actualResponse = client.restoreAgentAsync(request).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.restoreAgentAsync(request).get(); List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - RestoreAgentRequest actualRequest = (RestoreAgentRequest) actualRequests.get(0); + RestoreAgentRequest actualRequest = ((RestoreAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAgentUri(), actualRequest.getAgentUri()); + Assert.assertEquals(request.getAgentContent(), actualRequest.getAgentContent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -463,21 +568,20 @@ public void restoreAgentTest() throws Exception { } @Test - @SuppressWarnings("all") public void restoreAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); RestoreAgentRequest request = - RestoreAgentRequest.newBuilder().setName(name.toString()).build(); - + RestoreAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .build(); client.restoreAgentAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java index 711920b2a..17aa5d6eb 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.EntityTypesClient.ListEntityTypesPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,66 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class EntityTypesClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private EntityTypesClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockEntityTypes)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); EntityTypesSettings settings = EntityTypesSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -115,15 +82,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listEntityTypesTest() { - String nextPageToken = ""; - EntityType entityTypesElement = EntityType.newBuilder().build(); - List entityTypes = Arrays.asList(entityTypesElement); + public void listEntityTypesTest() throws Exception { + EntityType responsesElement = EntityType.newBuilder().build(); ListEntityTypesResponse expectedResponse = ListEntityTypesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllEntityTypes(entityTypes) + .setNextPageToken("") + .addAllEntityTypes(Arrays.asList(responsesElement)) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -132,14 +96,15 @@ public void listEntityTypesTest() { ListEntityTypesPagedResponse pagedListResponse = client.listEntityTypes(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getEntityTypesList().get(0), resources.get(0)); List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListEntityTypesRequest actualRequest = (ListEntityTypesRequest) actualRequests.get(0); + ListEntityTypesRequest actualRequest = ((ListEntityTypesRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -147,32 +112,73 @@ public void listEntityTypesTest() { } @Test - @SuppressWarnings("all") public void listEntityTypesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listEntityTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntityTypesTest2() throws Exception { + EntityType responsesElement = EntityType.newBuilder().build(); + ListEntityTypesResponse expectedResponse = + ListEntityTypesResponse.newBuilder() + .setNextPageToken("") + .addAllEntityTypes(Arrays.asList(responsesElement)) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEntityTypesPagedResponse pagedListResponse = client.listEntityTypes(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEntityTypesList().get(0), resources.get(0)); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEntityTypesRequest actualRequest = ((ListEntityTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEntityTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + String parent = "parent-995424086"; client.listEntityTypes(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getEntityTypeTest() { - EntityTypeName name2 = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); - String displayName = "displayName1615086568"; - boolean enableFuzzyExtraction = true; + public void getEntityTypeTest() throws Exception { EntityType expectedResponse = EntityType.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setEnableFuzzyExtraction(enableFuzzyExtraction) + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -183,9 +189,9 @@ public void getEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetEntityTypeRequest actualRequest = (GetEntityTypeRequest) actualRequests.get(0); + GetEntityTypeRequest actualRequest = ((GetEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, EntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -193,33 +199,73 @@ public void getEntityTypeTest() { } @Test - @SuppressWarnings("all") public void getEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + client.getEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEntityTypeTest2() throws Exception { + EntityType expectedResponse = + EntityType.newBuilder() + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + String name = "name3373707"; + + EntityType actualResponse = client.getEntityType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEntityTypeRequest actualRequest = ((GetEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + try { + String name = "name3373707"; client.getEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createEntityTypeTest() { - EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); - String displayName = "displayName1615086568"; - boolean enableFuzzyExtraction = true; + public void createEntityTypeTest() throws Exception { EntityType expectedResponse = EntityType.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setEnableFuzzyExtraction(enableFuzzyExtraction) + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -231,9 +277,9 @@ public void createEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateEntityTypeRequest actualRequest = (CreateEntityTypeRequest) actualRequests.get(0); + CreateEntityTypeRequest actualRequest = ((CreateEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(entityType, actualRequest.getEntityType()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -242,33 +288,76 @@ public void createEntityTypeTest() { } @Test - @SuppressWarnings("all") public void createEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); EntityType entityType = EntityType.newBuilder().build(); + client.createEntityType(parent, entityType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEntityTypeTest2() throws Exception { + EntityType expectedResponse = + EntityType.newBuilder() + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + EntityType entityType = EntityType.newBuilder().build(); + + EntityType actualResponse = client.createEntityType(parent, entityType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEntityTypeRequest actualRequest = ((CreateEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(entityType, actualRequest.getEntityType()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + try { + String parent = "parent-995424086"; + EntityType entityType = EntityType.newBuilder().build(); client.createEntityType(parent, entityType); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateEntityTypeTest() { - EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); - String displayName = "displayName1615086568"; - boolean enableFuzzyExtraction = true; + public void updateEntityTypeTest() throws Exception { EntityType expectedResponse = EntityType.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setEnableFuzzyExtraction(enableFuzzyExtraction) + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -280,7 +369,7 @@ public void updateEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateEntityTypeRequest actualRequest = (UpdateEntityTypeRequest) actualRequests.get(0); + UpdateEntityTypeRequest actualRequest = ((UpdateEntityTypeRequest) actualRequests.get(0)); Assert.assertEquals(entityType, actualRequest.getEntityType()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -291,25 +380,22 @@ public void updateEntityTypeTest() { } @Test - @SuppressWarnings("all") public void updateEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { EntityType entityType = EntityType.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateEntityType(entityType, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteEntityTypeTest() { + public void deleteEntityTypeTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockEntityTypes.addResponse(expectedResponse); @@ -319,9 +405,9 @@ public void deleteEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteEntityTypeRequest actualRequest = (DeleteEntityTypeRequest) actualRequests.get(0); + DeleteEntityTypeRequest actualRequest = ((DeleteEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, EntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -329,19 +415,51 @@ public void deleteEntityTypeTest() { } @Test - @SuppressWarnings("all") public void deleteEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + client.deleteEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEntityTypeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockEntityTypes.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteEntityType(name); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEntityTypeRequest actualRequest = ((DeleteEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + String name = "name3373707"; client.deleteEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java index d86a18eb2..200ffb7f3 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.EnvironmentsClient.ListEnvironmentsPagedResponse; @@ -32,13 +33,15 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -46,66 +49,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class EnvironmentsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private EnvironmentsClient client; + private static MockEnvironments mockEnvironments; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockEnvironments)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); EnvironmentsSettings settings = EnvironmentsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -120,15 +88,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listEnvironmentsTest() { - String nextPageToken = ""; - Environment environmentsElement = Environment.newBuilder().build(); - List environments = Arrays.asList(environmentsElement); + public void listEnvironmentsTest() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); ListEnvironmentsResponse expectedResponse = ListEnvironmentsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllEnvironments(environments) + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) .build(); mockEnvironments.addResponse(expectedResponse); @@ -137,14 +102,15 @@ public void listEnvironmentsTest() { ListEnvironmentsPagedResponse pagedListResponse = client.listEnvironments(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListEnvironmentsRequest actualRequest = (ListEnvironmentsRequest) actualRequests.get(0); + ListEnvironmentsRequest actualRequest = ((ListEnvironmentsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -152,33 +118,74 @@ public void listEnvironmentsTest() { } @Test - @SuppressWarnings("all") public void listEnvironmentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listEnvironments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEnvironmentsTest2() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); + ListEnvironmentsResponse expectedResponse = + ListEnvironmentsResponse.newBuilder() + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) + .build(); + mockEnvironments.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEnvironmentsPagedResponse pagedListResponse = client.listEnvironments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEnvironmentsRequest actualRequest = ((ListEnvironmentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void listEnvironmentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String parent = "parent-995424086"; client.listEnvironments(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getEnvironmentTest() { - EnvironmentName name2 = - EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void getEnvironmentTest() throws Exception { Environment expectedResponse = Environment.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); mockEnvironments.addResponse(expectedResponse); @@ -190,9 +197,9 @@ public void getEnvironmentTest() { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetEnvironmentRequest actualRequest = (GetEnvironmentRequest) actualRequests.get(0); + GetEnvironmentRequest actualRequest = ((GetEnvironmentRequest) actualRequests.get(0)); - Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -200,34 +207,75 @@ public void getEnvironmentTest() { } @Test - @SuppressWarnings("all") public void getEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + client.getEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getEnvironmentTest2() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockEnvironments.addResponse(expectedResponse); + + String name = "name3373707"; + + Environment actualResponse = client.getEnvironment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEnvironmentRequest actualRequest = ((GetEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnvironmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String name = "name3373707"; client.getEnvironment(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void createEnvironmentTest() throws Exception { - EnvironmentName name = - EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; Environment expectedResponse = Environment.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -245,9 +293,9 @@ public void createEnvironmentTest() throws Exception { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateEnvironmentRequest actualRequest = (CreateEnvironmentRequest) actualRequests.get(0); + CreateEnvironmentRequest actualRequest = ((CreateEnvironmentRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(environment, actualRequest.getEnvironment()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -256,36 +304,88 @@ public void createEnvironmentTest() throws Exception { } @Test - @SuppressWarnings("all") public void createEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Environment environment = Environment.newBuilder().build(); + client.createEnvironmentAsync(parent, environment).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createEnvironmentTest2() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEnvironments.addResponse(resultOperation); + + String parent = "parent-995424086"; + Environment environment = Environment.newBuilder().build(); + Environment actualResponse = client.createEnvironmentAsync(parent, environment).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEnvironmentRequest actualRequest = ((CreateEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(environment, actualRequest.getEnvironment()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEnvironmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String parent = "parent-995424086"; + Environment environment = Environment.newBuilder().build(); client.createEnvironmentAsync(parent, environment).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") public void updateEnvironmentTest() throws Exception { - EnvironmentName name = - EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; Environment expectedResponse = Environment.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -303,7 +403,7 @@ public void updateEnvironmentTest() throws Exception { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateEnvironmentRequest actualRequest = (UpdateEnvironmentRequest) actualRequests.get(0); + UpdateEnvironmentRequest actualRequest = ((UpdateEnvironmentRequest) actualRequests.get(0)); Assert.assertEquals(environment, actualRequest.getEnvironment()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -314,27 +414,24 @@ public void updateEnvironmentTest() throws Exception { } @Test - @SuppressWarnings("all") public void updateEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { Environment environment = Environment.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateEnvironmentAsync(environment, updateMask).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void deleteEnvironmentTest() { + public void deleteEnvironmentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockEnvironments.addResponse(expectedResponse); @@ -345,9 +442,9 @@ public void deleteEnvironmentTest() { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteEnvironmentRequest actualRequest = (DeleteEnvironmentRequest) actualRequests.get(0); + DeleteEnvironmentRequest actualRequest = ((DeleteEnvironmentRequest) actualRequests.get(0)); - Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -355,32 +452,61 @@ public void deleteEnvironmentTest() { } @Test - @SuppressWarnings("all") public void deleteEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + client.deleteEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEnvironmentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockEnvironments.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteEnvironment(name); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEnvironmentRequest actualRequest = ((DeleteEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void deleteEnvironmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String name = "name3373707"; client.deleteEnvironment(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void lookupEnvironmentHistoryTest() { - String nextPageToken = ""; - Environment environmentsElement = Environment.newBuilder().build(); - List environments = Arrays.asList(environmentsElement); + public void lookupEnvironmentHistoryTest() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); LookupEnvironmentHistoryResponse expectedResponse = LookupEnvironmentHistoryResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllEnvironments(environments) + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) .build(); mockEnvironments.addResponse(expectedResponse); @@ -390,15 +516,16 @@ public void lookupEnvironmentHistoryTest() { LookupEnvironmentHistoryPagedResponse pagedListResponse = client.lookupEnvironmentHistory(name); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); LookupEnvironmentHistoryRequest actualRequest = - (LookupEnvironmentHistoryRequest) actualRequests.get(0); + ((LookupEnvironmentHistoryRequest) actualRequests.get(0)); - Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -406,19 +533,62 @@ public void lookupEnvironmentHistoryTest() { } @Test - @SuppressWarnings("all") public void lookupEnvironmentHistoryExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + client.lookupEnvironmentHistory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupEnvironmentHistoryTest2() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); + LookupEnvironmentHistoryResponse expectedResponse = + LookupEnvironmentHistoryResponse.newBuilder() + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) + .build(); + mockEnvironments.addResponse(expectedResponse); + + String name = "name3373707"; + LookupEnvironmentHistoryPagedResponse pagedListResponse = client.lookupEnvironmentHistory(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupEnvironmentHistoryRequest actualRequest = + ((LookupEnvironmentHistoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupEnvironmentHistoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String name = "name3373707"; client.lookupEnvironmentHistory(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java index 4763fbc27..7792bffac 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.FlowsClient.ListFlowsPagedResponse; @@ -31,13 +32,14 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,66 +47,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class FlowsClientTest { - private static MockPages mockPages; + private static MockServiceHelper mockServiceHelper; private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; private FlowsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockFlows)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); FlowsSettings settings = FlowsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -119,16 +86,15 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void createFlowTest() { - FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void createFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) .build(); mockFlows.addResponse(expectedResponse); @@ -140,9 +106,9 @@ public void createFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateFlowRequest actualRequest = (CreateFlowRequest) actualRequests.get(0); + CreateFlowRequest actualRequest = ((CreateFlowRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(flow, actualRequest.getFlow()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -151,25 +117,68 @@ public void createFlowTest() { } @Test - @SuppressWarnings("all") public void createFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Flow flow = Flow.newBuilder().build(); + client.createFlow(parent, flow); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFlowTest2() throws Exception { + Flow expectedResponse = + Flow.newBuilder() + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) + .build(); + mockFlows.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Flow flow = Flow.newBuilder().build(); + Flow actualResponse = client.createFlow(parent, flow); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFlowRequest actualRequest = ((CreateFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(flow, actualRequest.getFlow()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String parent = "parent-995424086"; + Flow flow = Flow.newBuilder().build(); client.createFlow(parent, flow); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteFlowTest() { + public void deleteFlowTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockFlows.addResponse(expectedResponse); @@ -179,9 +188,9 @@ public void deleteFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteFlowRequest actualRequest = (DeleteFlowRequest) actualRequests.get(0); + DeleteFlowRequest actualRequest = ((DeleteFlowRequest) actualRequests.get(0)); - Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -189,29 +198,61 @@ public void deleteFlowTest() { } @Test - @SuppressWarnings("all") public void deleteFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.deleteFlow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void deleteFlowTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockFlows.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteFlow(name); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFlowRequest actualRequest = ((DeleteFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String name = "name3373707"; client.deleteFlow(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void listFlowsTest() { - String nextPageToken = ""; - Flow flowsElement = Flow.newBuilder().build(); - List flows = Arrays.asList(flowsElement); + public void listFlowsTest() throws Exception { + Flow responsesElement = Flow.newBuilder().build(); ListFlowsResponse expectedResponse = - ListFlowsResponse.newBuilder().setNextPageToken(nextPageToken).addAllFlows(flows).build(); + ListFlowsResponse.newBuilder() + .setNextPageToken("") + .addAllFlows(Arrays.asList(responsesElement)) + .build(); mockFlows.addResponse(expectedResponse); AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); @@ -219,14 +260,15 @@ public void listFlowsTest() { ListFlowsPagedResponse pagedListResponse = client.listFlows(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getFlowsList().get(0), resources.get(0)); List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListFlowsRequest actualRequest = (ListFlowsRequest) actualRequests.get(0); + ListFlowsRequest actualRequest = ((ListFlowsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -234,32 +276,73 @@ public void listFlowsTest() { } @Test - @SuppressWarnings("all") public void listFlowsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listFlows(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFlowsTest2() throws Exception { + Flow responsesElement = Flow.newBuilder().build(); + ListFlowsResponse expectedResponse = + ListFlowsResponse.newBuilder() + .setNextPageToken("") + .addAllFlows(Arrays.asList(responsesElement)) + .build(); + mockFlows.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListFlowsPagedResponse pagedListResponse = client.listFlows(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFlowsList().get(0), resources.get(0)); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFlowsRequest actualRequest = ((ListFlowsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void listFlowsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String parent = "parent-995424086"; client.listFlows(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getFlowTest() { - FlowName name2 = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void getFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) .build(); mockFlows.addResponse(expectedResponse); @@ -270,9 +353,9 @@ public void getFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetFlowRequest actualRequest = (GetFlowRequest) actualRequests.get(0); + GetFlowRequest actualRequest = ((GetFlowRequest) actualRequests.get(0)); - Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -280,32 +363,72 @@ public void getFlowTest() { } @Test - @SuppressWarnings("all") public void getFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.getFlow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getFlowTest2() throws Exception { + Flow expectedResponse = + Flow.newBuilder() + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) + .build(); + mockFlows.addResponse(expectedResponse); + + String name = "name3373707"; + + Flow actualResponse = client.getFlow(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFlowRequest actualRequest = ((GetFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String name = "name3373707"; client.getFlow(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateFlowTest() { - FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void updateFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) .build(); mockFlows.addResponse(expectedResponse); @@ -317,7 +440,7 @@ public void updateFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateFlowRequest actualRequest = (UpdateFlowRequest) actualRequests.get(0); + UpdateFlowRequest actualRequest = ((UpdateFlowRequest) actualRequests.get(0)); Assert.assertEquals(flow, actualRequest.getFlow()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -328,24 +451,21 @@ public void updateFlowTest() { } @Test - @SuppressWarnings("all") public void updateFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { Flow flow = Flow.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateFlow(flow, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void trainFlowTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = @@ -358,14 +478,13 @@ public void trainFlowTest() throws Exception { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - Empty actualResponse = client.trainFlowAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.trainFlowAsync(name).get(); List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - TrainFlowRequest actualRequest = (TrainFlowRequest) actualRequests.get(0); + TrainFlowRequest actualRequest = ((TrainFlowRequest) actualRequests.get(0)); - Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -373,19 +492,59 @@ public void trainFlowTest() throws Exception { } @Test - @SuppressWarnings("all") public void trainFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.trainFlowAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void trainFlowTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("trainFlowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFlows.addResponse(resultOperation); + + String name = "name3373707"; + client.trainFlowAsync(name).get(); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TrainFlowRequest actualRequest = ((TrainFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void trainFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String name = "name3373707"; client.trainFlowAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java index e6b9bf3e5..e5b8867c0 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.IntentsClient.ListIntentsPagedResponse; @@ -28,12 +29,14 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,66 +44,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class IntentsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; + private static MockServiceHelper mockServiceHelper; private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; private IntentsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockIntents)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); IntentsSettings settings = IntentsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -115,15 +83,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listIntentsTest() { - String nextPageToken = ""; - Intent intentsElement = Intent.newBuilder().build(); - List intents = Arrays.asList(intentsElement); + public void listIntentsTest() throws Exception { + Intent responsesElement = Intent.newBuilder().build(); ListIntentsResponse expectedResponse = ListIntentsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllIntents(intents) + .setNextPageToken("") + .addAllIntents(Arrays.asList(responsesElement)) .build(); mockIntents.addResponse(expectedResponse); @@ -132,14 +97,15 @@ public void listIntentsTest() { ListIntentsPagedResponse pagedListResponse = client.listIntents(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getIntentsList().get(0), resources.get(0)); List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListIntentsRequest actualRequest = (ListIntentsRequest) actualRequests.get(0); + ListIntentsRequest actualRequest = ((ListIntentsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -147,36 +113,75 @@ public void listIntentsTest() { } @Test - @SuppressWarnings("all") public void listIntentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listIntents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listIntentsTest2() throws Exception { + Intent responsesElement = Intent.newBuilder().build(); + ListIntentsResponse expectedResponse = + ListIntentsResponse.newBuilder() + .setNextPageToken("") + .addAllIntents(Arrays.asList(responsesElement)) + .build(); + mockIntents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListIntentsPagedResponse pagedListResponse = client.listIntents(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getIntentsList().get(0), resources.get(0)); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListIntentsRequest actualRequest = ((ListIntentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listIntentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + String parent = "parent-995424086"; client.listIntents(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getIntentTest() { - IntentName name2 = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); - String displayName = "displayName1615086568"; - int priority = 1165461084; - boolean isFallback = false; - String description = "description-1724546052"; + public void getIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setPriority(priority) - .setIsFallback(isFallback) - .setDescription(description) + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") .build(); mockIntents.addResponse(expectedResponse); @@ -187,9 +192,9 @@ public void getIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetIntentRequest actualRequest = (GetIntentRequest) actualRequests.get(0); + GetIntentRequest actualRequest = ((GetIntentRequest) actualRequests.get(0)); - Assert.assertEquals(name, IntentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -197,36 +202,76 @@ public void getIntentTest() { } @Test - @SuppressWarnings("all") public void getIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + client.getIntent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIntentTest2() throws Exception { + Intent expectedResponse = + Intent.newBuilder() + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockIntents.addResponse(expectedResponse); + + String name = "name3373707"; + + Intent actualResponse = client.getIntent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIntentRequest actualRequest = ((GetIntentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIntentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + try { + String name = "name3373707"; client.getIntent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createIntentTest() { - IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); - String displayName = "displayName1615086568"; - int priority = 1165461084; - boolean isFallback = false; - String description = "description-1724546052"; + public void createIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setPriority(priority) - .setIsFallback(isFallback) - .setDescription(description) + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") .build(); mockIntents.addResponse(expectedResponse); @@ -238,9 +283,9 @@ public void createIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateIntentRequest actualRequest = (CreateIntentRequest) actualRequests.get(0); + CreateIntentRequest actualRequest = ((CreateIntentRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(intent, actualRequest.getIntent()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -249,37 +294,80 @@ public void createIntentTest() { } @Test - @SuppressWarnings("all") public void createIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Intent intent = Intent.newBuilder().build(); + client.createIntent(parent, intent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createIntentTest2() throws Exception { + Intent expectedResponse = + Intent.newBuilder() + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockIntents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Intent intent = Intent.newBuilder().build(); + + Intent actualResponse = client.createIntent(parent, intent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateIntentRequest actualRequest = ((CreateIntentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(intent, actualRequest.getIntent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createIntentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + try { + String parent = "parent-995424086"; + Intent intent = Intent.newBuilder().build(); client.createIntent(parent, intent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateIntentTest() { - IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); - String displayName = "displayName1615086568"; - int priority = 1165461084; - boolean isFallback = false; - String description = "description-1724546052"; + public void updateIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setPriority(priority) - .setIsFallback(isFallback) - .setDescription(description) + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") .build(); mockIntents.addResponse(expectedResponse); @@ -291,7 +379,7 @@ public void updateIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateIntentRequest actualRequest = (UpdateIntentRequest) actualRequests.get(0); + UpdateIntentRequest actualRequest = ((UpdateIntentRequest) actualRequests.get(0)); Assert.assertEquals(intent, actualRequest.getIntent()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -302,25 +390,22 @@ public void updateIntentTest() { } @Test - @SuppressWarnings("all") public void updateIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { Intent intent = Intent.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateIntent(intent, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteIntentTest() { + public void deleteIntentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockIntents.addResponse(expectedResponse); @@ -330,9 +415,9 @@ public void deleteIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteIntentRequest actualRequest = (DeleteIntentRequest) actualRequests.get(0); + DeleteIntentRequest actualRequest = ((DeleteIntentRequest) actualRequests.get(0)); - Assert.assertEquals(name, IntentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -340,18 +425,50 @@ public void deleteIntentTest() { } @Test - @SuppressWarnings("all") public void deleteIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + client.deleteIntent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteIntentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIntents.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteIntent(name); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteIntentRequest actualRequest = ((DeleteIntentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteIntentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + String name = "name3373707"; client.deleteIntent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgents.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgents.java index f5a430929..e0d449274 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgents.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgents.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAgents implements MockGrpcService { private final MockAgentsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgentsImpl.java index 17d17fbf3..426b233e8 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgentsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockAgentsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAgentsImpl extends AgentsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listAgents( Object response = responses.remove(); if (response instanceof ListAgentsResponse) { requests.add(request); - responseObserver.onNext((ListAgentsResponse) response); + responseObserver.onNext(((ListAgentsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void getAgent(GetAgentRequest request, StreamObserver responseObse Object response = responses.remove(); if (response instanceof Agent) { requests.add(request); - responseObserver.onNext((Agent) response); + responseObserver.onNext(((Agent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -92,10 +94,10 @@ public void createAgent(CreateAgentRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Agent) { requests.add(request); - responseObserver.onNext((Agent) response); + responseObserver.onNext(((Agent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -106,10 +108,10 @@ public void updateAgent(UpdateAgentRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Agent) { requests.add(request); - responseObserver.onNext((Agent) response); + responseObserver.onNext(((Agent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -120,10 +122,10 @@ public void deleteAgent(DeleteAgentRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -134,10 +136,10 @@ public void exportAgent(ExportAgentRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -149,10 +151,10 @@ public void restoreAgent( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypes.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypes.java index 1570914a3..3bac14586 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypes.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypes.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEntityTypes implements MockGrpcService { private final MockEntityTypesImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypesImpl.java index 605eaef90..dd786e325 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypesImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEntityTypesImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEntityTypesImpl extends EntityTypesImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listEntityTypes( Object response = responses.remove(); if (response instanceof ListEntityTypesResponse) { requests.add(request); - responseObserver.onNext((ListEntityTypesResponse) response); + responseObserver.onNext(((ListEntityTypesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void getEntityType( Object response = responses.remove(); if (response instanceof EntityType) { requests.add(request); - responseObserver.onNext((EntityType) response); + responseObserver.onNext(((EntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -93,10 +95,10 @@ public void createEntityType( Object response = responses.remove(); if (response instanceof EntityType) { requests.add(request); - responseObserver.onNext((EntityType) response); + responseObserver.onNext(((EntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -108,10 +110,10 @@ public void updateEntityType( Object response = responses.remove(); if (response instanceof EntityType) { requests.add(request); - responseObserver.onNext((EntityType) response); + responseObserver.onNext(((EntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -123,10 +125,10 @@ public void deleteEntityType( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironments.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironments.java index 686bffbe8..de9027237 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironments.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironments.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEnvironments implements MockGrpcService { private final MockEnvironmentsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironmentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironmentsImpl.java index 27327036b..de4a9f76c 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironmentsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockEnvironmentsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEnvironmentsImpl extends EnvironmentsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listEnvironments( Object response = responses.remove(); if (response instanceof ListEnvironmentsResponse) { requests.add(request); - responseObserver.onNext((ListEnvironmentsResponse) response); + responseObserver.onNext(((ListEnvironmentsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -79,10 +81,10 @@ public void getEnvironment( Object response = responses.remove(); if (response instanceof Environment) { requests.add(request); - responseObserver.onNext((Environment) response); + responseObserver.onNext(((Environment) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -94,10 +96,10 @@ public void createEnvironment( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -109,10 +111,10 @@ public void updateEnvironment( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -124,10 +126,10 @@ public void deleteEnvironment( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -140,10 +142,10 @@ public void lookupEnvironmentHistory( Object response = responses.remove(); if (response instanceof LookupEnvironmentHistoryResponse) { requests.add(request); - responseObserver.onNext((LookupEnvironmentHistoryResponse) response); + responseObserver.onNext(((LookupEnvironmentHistoryResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlows.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlows.java index cc047fe72..99336db3a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlows.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlows.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockFlows implements MockGrpcService { private final MockFlowsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlowsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlowsImpl.java index c050524cc..766767054 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlowsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockFlowsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockFlowsImpl extends FlowsImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void createFlow(CreateFlowRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Flow) { requests.add(request); - responseObserver.onNext((Flow) response); + responseObserver.onNext(((Flow) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void deleteFlow(DeleteFlowRequest request, StreamObserver response Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -92,10 +94,10 @@ public void listFlows( Object response = responses.remove(); if (response instanceof ListFlowsResponse) { requests.add(request); - responseObserver.onNext((ListFlowsResponse) response); + responseObserver.onNext(((ListFlowsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -106,10 +108,10 @@ public void getFlow(GetFlowRequest request, StreamObserver responseObserve Object response = responses.remove(); if (response instanceof Flow) { requests.add(request); - responseObserver.onNext((Flow) response); + responseObserver.onNext(((Flow) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -120,10 +122,10 @@ public void updateFlow(UpdateFlowRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Flow) { requests.add(request); - responseObserver.onNext((Flow) response); + responseObserver.onNext(((Flow) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -134,10 +136,10 @@ public void trainFlow(TrainFlowRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntents.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntents.java index 34eede986..951d3e6f9 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntents.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntents.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockIntents implements MockGrpcService { private final MockIntentsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntentsImpl.java index 9fee4fd08..97f656563 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntentsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockIntentsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockIntentsImpl extends IntentsImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listIntents( Object response = responses.remove(); if (response instanceof ListIntentsResponse) { requests.add(request); - responseObserver.onNext((ListIntentsResponse) response); + responseObserver.onNext(((ListIntentsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void getIntent(GetIntentRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Intent) { requests.add(request); - responseObserver.onNext((Intent) response); + responseObserver.onNext(((Intent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -91,10 +93,10 @@ public void createIntent(CreateIntentRequest request, StreamObserver res Object response = responses.remove(); if (response instanceof Intent) { requests.add(request); - responseObserver.onNext((Intent) response); + responseObserver.onNext(((Intent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -105,10 +107,10 @@ public void updateIntent(UpdateIntentRequest request, StreamObserver res Object response = responses.remove(); if (response instanceof Intent) { requests.add(request); - responseObserver.onNext((Intent) response); + responseObserver.onNext(((Intent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -119,10 +121,10 @@ public void deleteIntent(DeleteIntentRequest request, StreamObserver resp Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPages.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPages.java index 55bfdb8cd..e5a106ff4 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPages.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPages.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockPages implements MockGrpcService { private final MockPagesImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPagesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPagesImpl.java index d776193ca..38854165f 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPagesImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockPagesImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockPagesImpl extends PagesImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listPages( Object response = responses.remove(); if (response instanceof ListPagesResponse) { requests.add(request); - responseObserver.onNext((ListPagesResponse) response); + responseObserver.onNext(((ListPagesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void getPage(GetPageRequest request, StreamObserver responseObserve Object response = responses.remove(); if (response instanceof Page) { requests.add(request); - responseObserver.onNext((Page) response); + responseObserver.onNext(((Page) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -91,10 +93,10 @@ public void createPage(CreatePageRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Page) { requests.add(request); - responseObserver.onNext((Page) response); + responseObserver.onNext(((Page) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -105,10 +107,10 @@ public void updatePage(UpdatePageRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Page) { requests.add(request); - responseObserver.onNext((Page) response); + responseObserver.onNext(((Page) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -119,10 +121,10 @@ public void deletePage(DeletePageRequest request, StreamObserver response Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsService.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsService.java index 49654edeb..81e7e15bb 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsService.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsService.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSecuritySettingsService implements MockGrpcService { private final MockSecuritySettingsServiceImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsServiceImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsServiceImpl.java index b0e4e984f..8a74c8fe3 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsServiceImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSecuritySettingsServiceImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSecuritySettingsServiceImpl extends SecuritySettingsServiceImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void createSecuritySettings( Object response = responses.remove(); if (response instanceof SecuritySettings) { requests.add(request); - responseObserver.onNext((SecuritySettings) response); + responseObserver.onNext(((SecuritySettings) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void getSecuritySettings( Object response = responses.remove(); if (response instanceof SecuritySettings) { requests.add(request); - responseObserver.onNext((SecuritySettings) response); + responseObserver.onNext(((SecuritySettings) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -93,10 +95,10 @@ public void updateSecuritySettings( Object response = responses.remove(); if (response instanceof SecuritySettings) { requests.add(request); - responseObserver.onNext((SecuritySettings) response); + responseObserver.onNext(((SecuritySettings) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -109,10 +111,10 @@ public void listSecuritySettings( Object response = responses.remove(); if (response instanceof ListSecuritySettingsResponse) { requests.add(request); - responseObserver.onNext((ListSecuritySettingsResponse) response); + responseObserver.onNext(((ListSecuritySettingsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -124,10 +126,10 @@ public void deleteSecuritySettings( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypes.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypes.java index ae8a34478..5d48f3dc1 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypes.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypes.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessionEntityTypes implements MockGrpcService { private final MockSessionEntityTypesImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypesImpl.java index 843fe9318..106b68f9d 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypesImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionEntityTypesImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessionEntityTypesImpl extends SessionEntityTypesImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listSessionEntityTypes( Object response = responses.remove(); if (response instanceof ListSessionEntityTypesResponse) { requests.add(request); - responseObserver.onNext((ListSessionEntityTypesResponse) response); + responseObserver.onNext(((ListSessionEntityTypesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -79,10 +81,10 @@ public void getSessionEntityType( Object response = responses.remove(); if (response instanceof SessionEntityType) { requests.add(request); - responseObserver.onNext((SessionEntityType) response); + responseObserver.onNext(((SessionEntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -94,10 +96,10 @@ public void createSessionEntityType( Object response = responses.remove(); if (response instanceof SessionEntityType) { requests.add(request); - responseObserver.onNext((SessionEntityType) response); + responseObserver.onNext(((SessionEntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -109,10 +111,10 @@ public void updateSessionEntityType( Object response = responses.remove(); if (response instanceof SessionEntityType) { requests.add(request); - responseObserver.onNext((SessionEntityType) response); + responseObserver.onNext(((SessionEntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -124,10 +126,10 @@ public void deleteSessionEntityType( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessions.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessions.java index 1841e00b0..9eb8cab4a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessions.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessions.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessions implements MockGrpcService { private final MockSessionsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionsImpl.java index b51d87b96..9767198e2 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockSessionsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -23,9 +24,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessionsImpl extends SessionsImplBase { private List requests; private Queue responses; @@ -62,10 +64,10 @@ public void detectIntent( Object response = responses.remove(); if (response instanceof DetectIntentResponse) { requests.add(request); - responseObserver.onNext((DetectIntentResponse) response); + responseObserver.onNext(((DetectIntentResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -81,9 +83,9 @@ public void onNext(StreamingDetectIntentRequest value) { requests.add(value); final Object response = responses.remove(); if (response instanceof StreamingDetectIntentResponse) { - responseObserver.onNext((StreamingDetectIntentResponse) response); + responseObserver.onNext(((StreamingDetectIntentResponse) response)); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -108,10 +110,10 @@ public void matchIntent( Object response = responses.remove(); if (response instanceof MatchIntentResponse) { requests.add(request); - responseObserver.onNext((MatchIntentResponse) response); + responseObserver.onNext(((MatchIntentResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -123,10 +125,10 @@ public void fulfillIntent( Object response = responses.remove(); if (response instanceof FulfillIntentResponse) { requests.add(request); - responseObserver.onNext((FulfillIntentResponse) response); + responseObserver.onNext(((FulfillIntentResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroups.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroups.java index bb461b792..3ae11fb2f 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroups.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroups.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockTransitionRouteGroups implements MockGrpcService { private final MockTransitionRouteGroupsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroupsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroupsImpl.java index d62d8ed9e..f259f4e7f 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroupsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockTransitionRouteGroupsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockTransitionRouteGroupsImpl extends TransitionRouteGroupsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listTransitionRouteGroups( Object response = responses.remove(); if (response instanceof ListTransitionRouteGroupsResponse) { requests.add(request); - responseObserver.onNext((ListTransitionRouteGroupsResponse) response); + responseObserver.onNext(((ListTransitionRouteGroupsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -80,10 +82,10 @@ public void getTransitionRouteGroup( Object response = responses.remove(); if (response instanceof TransitionRouteGroup) { requests.add(request); - responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onNext(((TransitionRouteGroup) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -96,10 +98,10 @@ public void createTransitionRouteGroup( Object response = responses.remove(); if (response instanceof TransitionRouteGroup) { requests.add(request); - responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onNext(((TransitionRouteGroup) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -112,10 +114,10 @@ public void updateTransitionRouteGroup( Object response = responses.remove(); if (response instanceof TransitionRouteGroup) { requests.add(request); - responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onNext(((TransitionRouteGroup) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -127,10 +129,10 @@ public void deleteTransitionRouteGroup( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersions.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersions.java index 8f1e58abf..394f636d9 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersions.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersions.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockVersions implements MockGrpcService { private final MockVersionsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersionsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersionsImpl.java index 96393b2c6..085ccb48a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersionsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockVersionsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockVersionsImpl extends VersionsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listVersions( Object response = responses.remove(); if (response instanceof ListVersionsResponse) { requests.add(request); - responseObserver.onNext((ListVersionsResponse) response); + responseObserver.onNext(((ListVersionsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void getVersion(GetVersionRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Version) { requests.add(request); - responseObserver.onNext((Version) response); + responseObserver.onNext(((Version) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -93,10 +95,10 @@ public void createVersion( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -108,10 +110,10 @@ public void updateVersion( Object response = responses.remove(); if (response instanceof Version) { requests.add(request); - responseObserver.onNext((Version) response); + responseObserver.onNext(((Version) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -122,10 +124,10 @@ public void deleteVersion(DeleteVersionRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -136,10 +138,10 @@ public void loadVersion(LoadVersionRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooks.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooks.java index 3f9ed7427..db8440a77 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooks.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooks.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockWebhooks implements MockGrpcService { private final MockWebhooksImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooksImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooksImpl.java index 441bdff4c..dc7411852 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooksImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/MockWebhooksImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockWebhooksImpl extends WebhooksImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listWebhooks( Object response = responses.remove(); if (response instanceof ListWebhooksResponse) { requests.add(request); - responseObserver.onNext((ListWebhooksResponse) response); + responseObserver.onNext(((ListWebhooksResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void getWebhook(GetWebhookRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Webhook) { requests.add(request); - responseObserver.onNext((Webhook) response); + responseObserver.onNext(((Webhook) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -92,10 +94,10 @@ public void createWebhook( Object response = responses.remove(); if (response instanceof Webhook) { requests.add(request); - responseObserver.onNext((Webhook) response); + responseObserver.onNext(((Webhook) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -107,10 +109,10 @@ public void updateWebhook( Object response = responses.remove(); if (response instanceof Webhook) { requests.add(request); - responseObserver.onNext((Webhook) response); + responseObserver.onNext(((Webhook) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -121,10 +123,10 @@ public void deleteWebhook(DeleteWebhookRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java index 0ae63db47..02bce500d 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.PagesClient.ListPagesPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,66 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class PagesClientTest { private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private PagesClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockPages)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); PagesSettings settings = PagesSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -115,13 +82,13 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listPagesTest() { - String nextPageToken = ""; - Page pagesElement = Page.newBuilder().build(); - List pages = Arrays.asList(pagesElement); + public void listPagesTest() throws Exception { + Page responsesElement = Page.newBuilder().build(); ListPagesResponse expectedResponse = - ListPagesResponse.newBuilder().setNextPageToken(nextPageToken).addAllPages(pages).build(); + ListPagesResponse.newBuilder() + .setNextPageToken("") + .addAllPages(Arrays.asList(responsesElement)) + .build(); mockPages.addResponse(expectedResponse); FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); @@ -129,14 +96,15 @@ public void listPagesTest() { ListPagesPagedResponse pagedListResponse = client.listPages(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getPagesList().get(0), resources.get(0)); List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPagesRequest actualRequest = (ListPagesRequest) actualRequests.get(0); + ListPagesRequest actualRequest = ((ListPagesRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -144,28 +112,76 @@ public void listPagesTest() { } @Test - @SuppressWarnings("all") public void listPagesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.listPages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPagesTest2() throws Exception { + Page responsesElement = Page.newBuilder().build(); + ListPagesResponse expectedResponse = + ListPagesResponse.newBuilder() + .setNextPageToken("") + .addAllPages(Arrays.asList(responsesElement)) + .build(); + mockPages.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPagesPagedResponse pagedListResponse = client.listPages(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPagesList().get(0), resources.get(0)); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPagesRequest actualRequest = ((ListPagesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPagesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + String parent = "parent-995424086"; client.listPages(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getPageTest() { - PageName name2 = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); - String displayName = "displayName1615086568"; + public void getPageTest() throws Exception { Page expectedResponse = - Page.newBuilder().setName(name2.toString()).setDisplayName(displayName).build(); + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); mockPages.addResponse(expectedResponse); PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); @@ -175,9 +191,9 @@ public void getPageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetPageRequest actualRequest = (GetPageRequest) actualRequests.get(0); + GetPageRequest actualRequest = ((GetPageRequest) actualRequests.get(0)); - Assert.assertEquals(name, PageName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -185,28 +201,77 @@ public void getPageTest() { } @Test - @SuppressWarnings("all") public void getPageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + client.getPage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPageTest2() throws Exception { + Page expectedResponse = + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); + mockPages.addResponse(expectedResponse); + + String name = "name3373707"; + + Page actualResponse = client.getPage(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPageRequest actualRequest = ((GetPageRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + try { + String name = "name3373707"; client.getPage(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createPageTest() { - PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); - String displayName = "displayName1615086568"; + public void createPageTest() throws Exception { Page expectedResponse = - Page.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); mockPages.addResponse(expectedResponse); FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); @@ -217,9 +282,9 @@ public void createPageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreatePageRequest actualRequest = (CreatePageRequest) actualRequests.get(0); + CreatePageRequest actualRequest = ((CreatePageRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(page, actualRequest.getPage()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -228,29 +293,81 @@ public void createPageTest() { } @Test - @SuppressWarnings("all") public void createPageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); Page page = Page.newBuilder().build(); + client.createPage(parent, page); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPageTest2() throws Exception { + Page expectedResponse = + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); + mockPages.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Page page = Page.newBuilder().build(); + + Page actualResponse = client.createPage(parent, page); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePageRequest actualRequest = ((CreatePageRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(page, actualRequest.getPage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + try { + String parent = "parent-995424086"; + Page page = Page.newBuilder().build(); client.createPage(parent, page); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updatePageTest() { - PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); - String displayName = "displayName1615086568"; + public void updatePageTest() throws Exception { Page expectedResponse = - Page.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); mockPages.addResponse(expectedResponse); Page page = Page.newBuilder().build(); @@ -261,7 +378,7 @@ public void updatePageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdatePageRequest actualRequest = (UpdatePageRequest) actualRequests.get(0); + UpdatePageRequest actualRequest = ((UpdatePageRequest) actualRequests.get(0)); Assert.assertEquals(page, actualRequest.getPage()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -272,25 +389,22 @@ public void updatePageTest() { } @Test - @SuppressWarnings("all") public void updatePageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { Page page = Page.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updatePage(page, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deletePageTest() { + public void deletePageTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockPages.addResponse(expectedResponse); @@ -300,9 +414,9 @@ public void deletePageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeletePageRequest actualRequest = (DeletePageRequest) actualRequests.get(0); + DeletePageRequest actualRequest = ((DeletePageRequest) actualRequests.get(0)); - Assert.assertEquals(name, PageName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -310,18 +424,50 @@ public void deletePageTest() { } @Test - @SuppressWarnings("all") public void deletePageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + client.deletePage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePageTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockPages.addResponse(expectedResponse); + + String name = "name3373707"; + client.deletePage(name); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePageRequest actualRequest = ((DeletePageRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + String name = "name3373707"; client.deletePage(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java index ed78b948d..16e596863 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.SecuritySettingsServiceClient.ListSecuritySettingsPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,66 +43,32 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class SecuritySettingsServiceClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private SecuritySettingsServiceClient client; + private static MockSecuritySettingsService mockSecuritySettingsService; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + Arrays.asList(mockSecuritySettingsService)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); SecuritySettingsServiceSettings settings = SecuritySettingsServiceSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -115,19 +83,15 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void createSecuritySettingsTest() { - SecuritySettingsName name = - SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"); - String displayName = "displayName1615086568"; - String inspectTemplate = "inspectTemplate-159468987"; - int retentionWindowDays = 810238885; + public void createSecuritySettingsTest() throws Exception { SecuritySettings expectedResponse = SecuritySettings.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setInspectTemplate(inspectTemplate) - .setRetentionWindowDays(retentionWindowDays) + .setName( + SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") + .toString()) + .setDisplayName("display_name1615086568") + .setInspectTemplate("inspect_template-159468987") + .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -140,9 +104,9 @@ public void createSecuritySettingsTest() { List actualRequests = mockSecuritySettingsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateSecuritySettingsRequest actualRequest = - (CreateSecuritySettingsRequest) actualRequests.get(0); + ((CreateSecuritySettingsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(securitySettings, actualRequest.getSecuritySettings()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -151,36 +115,77 @@ public void createSecuritySettingsTest() { } @Test - @SuppressWarnings("all") public void createSecuritySettingsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecuritySettingsService.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); SecuritySettings securitySettings = SecuritySettings.newBuilder().build(); + client.createSecuritySettings(parent, securitySettings); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createSecuritySettingsTest2() throws Exception { + SecuritySettings expectedResponse = + SecuritySettings.newBuilder() + .setName( + SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") + .toString()) + .setDisplayName("display_name1615086568") + .setInspectTemplate("inspect_template-159468987") + .addAllPurgeDataTypes(new ArrayList()) + .build(); + mockSecuritySettingsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + SecuritySettings securitySettings = SecuritySettings.newBuilder().build(); + + SecuritySettings actualResponse = client.createSecuritySettings(parent, securitySettings); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecuritySettingsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSecuritySettingsRequest actualRequest = + ((CreateSecuritySettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(securitySettings, actualRequest.getSecuritySettings()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void createSecuritySettingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecuritySettingsService.addException(exception); + + try { + String parent = "parent-995424086"; + SecuritySettings securitySettings = SecuritySettings.newBuilder().build(); client.createSecuritySettings(parent, securitySettings); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getSecuritySettingsTest() { - SecuritySettingsName name2 = - SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"); - String displayName = "displayName1615086568"; - String inspectTemplate = "inspectTemplate-159468987"; - int retentionWindowDays = 810238885; + public void getSecuritySettingsTest() throws Exception { SecuritySettings expectedResponse = SecuritySettings.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setInspectTemplate(inspectTemplate) - .setRetentionWindowDays(retentionWindowDays) + .setName( + SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") + .toString()) + .setDisplayName("display_name1615086568") + .setInspectTemplate("inspect_template-159468987") + .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -192,9 +197,9 @@ public void getSecuritySettingsTest() { List actualRequests = mockSecuritySettingsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetSecuritySettingsRequest actualRequest = (GetSecuritySettingsRequest) actualRequests.get(0); + GetSecuritySettingsRequest actualRequest = ((GetSecuritySettingsRequest) actualRequests.get(0)); - Assert.assertEquals(name, SecuritySettingsName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -202,36 +207,73 @@ public void getSecuritySettingsTest() { } @Test - @SuppressWarnings("all") public void getSecuritySettingsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecuritySettingsService.addException(exception); try { SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"); + client.getSecuritySettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSecuritySettingsTest2() throws Exception { + SecuritySettings expectedResponse = + SecuritySettings.newBuilder() + .setName( + SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") + .toString()) + .setDisplayName("display_name1615086568") + .setInspectTemplate("inspect_template-159468987") + .addAllPurgeDataTypes(new ArrayList()) + .build(); + mockSecuritySettingsService.addResponse(expectedResponse); + + String name = "name3373707"; + + SecuritySettings actualResponse = client.getSecuritySettings(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSecuritySettingsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSecuritySettingsRequest actualRequest = ((GetSecuritySettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSecuritySettingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecuritySettingsService.addException(exception); + try { + String name = "name3373707"; client.getSecuritySettings(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateSecuritySettingsTest() { - SecuritySettingsName name = - SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"); - String displayName = "displayName1615086568"; - String inspectTemplate = "inspectTemplate-159468987"; - int retentionWindowDays = 810238885; + public void updateSecuritySettingsTest() throws Exception { SecuritySettings expectedResponse = SecuritySettings.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setInspectTemplate(inspectTemplate) - .setRetentionWindowDays(retentionWindowDays) + .setName( + SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") + .toString()) + .setDisplayName("display_name1615086568") + .setInspectTemplate("inspect_template-159468987") + .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -244,7 +286,7 @@ public void updateSecuritySettingsTest() { List actualRequests = mockSecuritySettingsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateSecuritySettingsRequest actualRequest = - (UpdateSecuritySettingsRequest) actualRequests.get(0); + ((UpdateSecuritySettingsRequest) actualRequests.get(0)); Assert.assertEquals(securitySettings, actualRequest.getSecuritySettings()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -255,32 +297,27 @@ public void updateSecuritySettingsTest() { } @Test - @SuppressWarnings("all") public void updateSecuritySettingsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecuritySettingsService.addException(exception); try { SecuritySettings securitySettings = SecuritySettings.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateSecuritySettings(securitySettings, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void listSecuritySettingsTest() { - String nextPageToken = ""; - SecuritySettings securitySettingsElement = SecuritySettings.newBuilder().build(); - List securitySettings = Arrays.asList(securitySettingsElement); + public void listSecuritySettingsTest() throws Exception { + SecuritySettings responsesElement = SecuritySettings.newBuilder().build(); ListSecuritySettingsResponse expectedResponse = ListSecuritySettingsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllSecuritySettings(securitySettings) + .setNextPageToken("") + .addAllSecuritySettings(Arrays.asList(responsesElement)) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -289,14 +326,16 @@ public void listSecuritySettingsTest() { ListSecuritySettingsPagedResponse pagedListResponse = client.listSecuritySettings(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getSecuritySettingsList().get(0), resources.get(0)); List actualRequests = mockSecuritySettingsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListSecuritySettingsRequest actualRequest = (ListSecuritySettingsRequest) actualRequests.get(0); + ListSecuritySettingsRequest actualRequest = + ((ListSecuritySettingsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -304,24 +343,66 @@ public void listSecuritySettingsTest() { } @Test - @SuppressWarnings("all") public void listSecuritySettingsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecuritySettingsService.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listSecuritySettings(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSecuritySettingsTest2() throws Exception { + SecuritySettings responsesElement = SecuritySettings.newBuilder().build(); + ListSecuritySettingsResponse expectedResponse = + ListSecuritySettingsResponse.newBuilder() + .setNextPageToken("") + .addAllSecuritySettings(Arrays.asList(responsesElement)) + .build(); + mockSecuritySettingsService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSecuritySettingsPagedResponse pagedListResponse = client.listSecuritySettings(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSecuritySettingsList().get(0), resources.get(0)); + + List actualRequests = mockSecuritySettingsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSecuritySettingsRequest actualRequest = + ((ListSecuritySettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSecuritySettingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecuritySettingsService.addException(exception); + try { + String parent = "parent-995424086"; client.listSecuritySettings(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteSecuritySettingsTest() { + public void deleteSecuritySettingsTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -333,9 +414,9 @@ public void deleteSecuritySettingsTest() { List actualRequests = mockSecuritySettingsService.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteSecuritySettingsRequest actualRequest = - (DeleteSecuritySettingsRequest) actualRequests.get(0); + ((DeleteSecuritySettingsRequest) actualRequests.get(0)); - Assert.assertEquals(name, SecuritySettingsName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -343,19 +424,52 @@ public void deleteSecuritySettingsTest() { } @Test - @SuppressWarnings("all") public void deleteSecuritySettingsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSecuritySettingsService.addException(exception); try { SecuritySettingsName name = SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]"); + client.deleteSecuritySettings(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSecuritySettingsTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSecuritySettingsService.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteSecuritySettings(name); + + List actualRequests = mockSecuritySettingsService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSecuritySettingsRequest actualRequest = + ((DeleteSecuritySettingsRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSecuritySettingsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSecuritySettingsService.addException(exception); + + try { + String name = "name3373707"; client.deleteSecuritySettings(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClientTest.java index 52b051d9e..789a9b433 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,66 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class SessionEntityTypesClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private SessionEntityTypesClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockSessionEntityTypes)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); SessionEntityTypesSettings settings = SessionEntityTypesSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -115,15 +82,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listSessionEntityTypesTest() { - String nextPageToken = ""; - SessionEntityType sessionEntityTypesElement = SessionEntityType.newBuilder().build(); - List sessionEntityTypes = Arrays.asList(sessionEntityTypesElement); + public void listSessionEntityTypesTest() throws Exception { + SessionEntityType responsesElement = SessionEntityType.newBuilder().build(); ListSessionEntityTypesResponse expectedResponse = ListSessionEntityTypesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllSessionEntityTypes(sessionEntityTypes) + .setNextPageToken("") + .addAllSessionEntityTypes(Arrays.asList(responsesElement)) .build(); mockSessionEntityTypes.addResponse(expectedResponse); @@ -134,15 +98,16 @@ public void listSessionEntityTypesTest() { ListSessionEntityTypesPagedResponse pagedListResponse = client.listSessionEntityTypes(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getSessionEntityTypesList().get(0), resources.get(0)); List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListSessionEntityTypesRequest actualRequest = - (ListSessionEntityTypesRequest) actualRequests.get(0); + ((ListSessionEntityTypesRequest) actualRequests.get(0)); - Assert.assertEquals(parent, SessionName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -150,31 +115,76 @@ public void listSessionEntityTypesTest() { } @Test - @SuppressWarnings("all") public void listSessionEntityTypesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionName parent = SessionName.ofProjectLocationAgentSessionName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + client.listSessionEntityTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionEntityTypesTest2() throws Exception { + SessionEntityType responsesElement = SessionEntityType.newBuilder().build(); + ListSessionEntityTypesResponse expectedResponse = + ListSessionEntityTypesResponse.newBuilder() + .setNextPageToken("") + .addAllSessionEntityTypes(Arrays.asList(responsesElement)) + .build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSessionEntityTypesPagedResponse pagedListResponse = client.listSessionEntityTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionEntityTypesList().get(0), resources.get(0)); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionEntityTypesRequest actualRequest = + ((ListSessionEntityTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSessionEntityTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + try { + String parent = "parent-995424086"; client.listSessionEntityTypes(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getSessionEntityTypeTest() { - SessionEntityTypeName name2 = - SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + public void getSessionEntityTypeTest() throws Exception { SessionEntityType expectedResponse = - SessionEntityType.newBuilder().setName(name2.toString()).build(); + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); mockSessionEntityTypes.addResponse(expectedResponse); SessionEntityTypeName name = @@ -186,9 +196,10 @@ public void getSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetSessionEntityTypeRequest actualRequest = (GetSessionEntityTypeRequest) actualRequests.get(0); + GetSessionEntityTypeRequest actualRequest = + ((GetSessionEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, SessionEntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -196,31 +207,74 @@ public void getSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void getSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + client.getSessionEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionEntityTypeTest2() throws Exception { + SessionEntityType expectedResponse = + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); + mockSessionEntityTypes.addResponse(expectedResponse); + String name = "name3373707"; + + SessionEntityType actualResponse = client.getSessionEntityType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionEntityTypeRequest actualRequest = + ((GetSessionEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + String name = "name3373707"; client.getSessionEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createSessionEntityTypeTest() { - SessionEntityTypeName name = - SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + public void createSessionEntityTypeTest() throws Exception { SessionEntityType expectedResponse = - SessionEntityType.newBuilder().setName(name.toString()).build(); + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); mockSessionEntityTypes.addResponse(expectedResponse); SessionName parent = @@ -234,9 +288,9 @@ public void createSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateSessionEntityTypeRequest actualRequest = - (CreateSessionEntityTypeRequest) actualRequests.get(0); + ((CreateSessionEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(parent, SessionName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -245,9 +299,8 @@ public void createSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void createSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { @@ -255,22 +308,69 @@ public void createSessionEntityTypeExceptionTest() throws Exception { SessionName.ofProjectLocationAgentSessionName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + client.createSessionEntityType(parent, sessionEntityType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void createSessionEntityTypeTest2() throws Exception { + SessionEntityType expectedResponse = + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + + SessionEntityType actualResponse = client.createSessionEntityType(parent, sessionEntityType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionEntityTypeRequest actualRequest = + ((CreateSessionEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + String parent = "parent-995424086"; + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); client.createSessionEntityType(parent, sessionEntityType); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateSessionEntityTypeTest() { - SessionEntityTypeName name = - SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + public void updateSessionEntityTypeTest() throws Exception { SessionEntityType expectedResponse = - SessionEntityType.newBuilder().setName(name.toString()).build(); + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); mockSessionEntityTypes.addResponse(expectedResponse); SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); @@ -283,7 +383,7 @@ public void updateSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateSessionEntityTypeRequest actualRequest = - (UpdateSessionEntityTypeRequest) actualRequests.get(0); + ((UpdateSessionEntityTypeRequest) actualRequests.get(0)); Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -294,25 +394,22 @@ public void updateSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void updateSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateSessionEntityType(sessionEntityType, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteSessionEntityTypeTest() { + public void deleteSessionEntityTypeTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockSessionEntityTypes.addResponse(expectedResponse); @@ -325,9 +422,9 @@ public void deleteSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteSessionEntityTypeRequest actualRequest = - (DeleteSessionEntityTypeRequest) actualRequests.get(0); + ((DeleteSessionEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, SessionEntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -335,20 +432,53 @@ public void deleteSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void deleteSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + client.deleteSessionEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionEntityTypeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteSessionEntityType(name); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionEntityTypeRequest actualRequest = + ((DeleteSessionEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + String name = "name3373707"; client.deleteSessionEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java index 055337bc3..0414e62c1 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import com.google.api.gax.core.NoCredentialsProvider; @@ -28,13 +29,14 @@ import com.google.api.gax.rpc.StatusCode; import com.google.protobuf.AbstractMessage; import com.google.protobuf.ByteString; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -42,66 +44,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class SessionsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private SessionsClient client; private LocalChannelProvider channelProvider; + private static MockSessions mockSessions; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockSessions)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); SessionsSettings settings = SessionsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -116,25 +83,25 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void detectIntentTest() { - String responseId = "responseId1847552473"; - ByteString outputAudio = ByteString.copyFromUtf8("24"); + public void detectIntentTest() throws Exception { DetectIntentResponse expectedResponse = DetectIntentResponse.newBuilder() - .setResponseId(responseId) - .setOutputAudio(outputAudio) + .setResponseId("response_id1847552473") + .setQueryResult(QueryResult.newBuilder().build()) + .setOutputAudio(ByteString.EMPTY) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); mockSessions.addResponse(expectedResponse); - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); DetectIntentRequest request = DetectIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); DetectIntentResponse actualResponse = client.detectIntent(request); @@ -142,10 +109,12 @@ public void detectIntentTest() { List actualRequests = mockSessions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DetectIntentRequest actualRequest = (DetectIntentRequest) actualRequests.get(0); + DetectIntentRequest actualRequest = ((DetectIntentRequest) actualRequests.get(0)); - Assert.assertEquals(session, SessionName.parse(actualRequest.getSession())); - Assert.assertEquals(queryInput, actualRequest.getQueryInput()); + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertEquals(request.getQueryParams(), actualRequest.getQueryParams()); + Assert.assertEquals(request.getQueryInput(), actualRequest.getQueryInput()); + Assert.assertEquals(request.getOutputAudioConfig(), actualRequest.getOutputAudioConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -153,38 +122,43 @@ public void detectIntentTest() { } @Test - @SuppressWarnings("all") public void detectIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); try { - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); DetectIntentRequest request = DetectIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); - client.detectIntent(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void streamingDetectIntentTest() throws Exception { StreamingDetectIntentResponse expectedResponse = StreamingDetectIntentResponse.newBuilder().build(); mockSessions.addResponse(expectedResponse); - QueryInput queryInput = QueryInput.newBuilder().build(); StreamingDetectIntentRequest request = - StreamingDetectIntentRequest.newBuilder().setQueryInput(queryInput).build(); + StreamingDetectIntentRequest.newBuilder() + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -202,13 +176,19 @@ public void streamingDetectIntentTest() throws Exception { } @Test - @SuppressWarnings("all") public void streamingDetectIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); - QueryInput queryInput = QueryInput.newBuilder().build(); StreamingDetectIntentRequest request = - StreamingDetectIntentRequest.newBuilder().setQueryInput(queryInput).build(); + StreamingDetectIntentRequest.newBuilder() + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -224,26 +204,28 @@ public void streamingDetectIntentExceptionTest() throws Exception { Assert.fail("No exception thrown"); } catch (ExecutionException e) { Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void matchIntentTest() { - String text = "text3556653"; - MatchIntentResponse expectedResponse = MatchIntentResponse.newBuilder().setText(text).build(); + public void matchIntentTest() throws Exception { + MatchIntentResponse expectedResponse = + MatchIntentResponse.newBuilder() + .addAllMatches(new ArrayList()) + .setCurrentPage(Page.newBuilder().build()) + .build(); mockSessions.addResponse(expectedResponse); - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); MatchIntentRequest request = MatchIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) .build(); MatchIntentResponse actualResponse = client.matchIntent(request); @@ -251,10 +233,11 @@ public void matchIntentTest() { List actualRequests = mockSessions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MatchIntentRequest actualRequest = (MatchIntentRequest) actualRequests.get(0); + MatchIntentRequest actualRequest = ((MatchIntentRequest) actualRequests.get(0)); - Assert.assertEquals(session, SessionName.parse(actualRequest.getSession())); - Assert.assertEquals(queryInput, actualRequest.getQueryInput()); + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertEquals(request.getQueryParams(), actualRequest.getQueryParams()); + Assert.assertEquals(request.getQueryInput(), actualRequest.getQueryInput()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -262,50 +245,55 @@ public void matchIntentTest() { } @Test - @SuppressWarnings("all") public void matchIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); try { - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); MatchIntentRequest request = MatchIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) .build(); - client.matchIntent(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void fulfillIntentTest() { - String responseId = "responseId1847552473"; - ByteString outputAudio = ByteString.copyFromUtf8("24"); + public void fulfillIntentTest() throws Exception { FulfillIntentResponse expectedResponse = FulfillIntentResponse.newBuilder() - .setResponseId(responseId) - .setOutputAudio(outputAudio) + .setResponseId("response_id1847552473") + .setQueryResult(QueryResult.newBuilder().build()) + .setOutputAudio(ByteString.EMPTY) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); mockSessions.addResponse(expectedResponse); - FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build(); + FulfillIntentRequest request = + FulfillIntentRequest.newBuilder() + .setMatchIntentRequest(MatchIntentRequest.newBuilder().build()) + .setMatch(Match.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); FulfillIntentResponse actualResponse = client.fulfillIntent(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockSessions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - FulfillIntentRequest actualRequest = (FulfillIntentRequest) actualRequests.get(0); + FulfillIntentRequest actualRequest = ((FulfillIntentRequest) actualRequests.get(0)); + Assert.assertEquals(request.getMatchIntentRequest(), actualRequest.getMatchIntentRequest()); + Assert.assertEquals(request.getMatch(), actualRequest.getMatch()); + Assert.assertEquals(request.getOutputAudioConfig(), actualRequest.getOutputAudioConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -313,18 +301,21 @@ public void fulfillIntentTest() { } @Test - @SuppressWarnings("all") public void fulfillIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); try { - FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build(); - + FulfillIntentRequest request = + FulfillIntentRequest.newBuilder() + .setMatchIntentRequest(MatchIntentRequest.newBuilder().build()) + .setMatch(Match.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); client.fulfillIntent(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java index b5dc2fbf2..a84776e4e 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,66 +43,32 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class TransitionRouteGroupsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private TransitionRouteGroupsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + Arrays.asList(mockTransitionRouteGroups)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); TransitionRouteGroupsSettings settings = TransitionRouteGroupsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -115,15 +83,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listTransitionRouteGroupsTest() { - String nextPageToken = ""; - TransitionRouteGroup transitionRouteGroupsElement = TransitionRouteGroup.newBuilder().build(); - List transitionRouteGroups = Arrays.asList(transitionRouteGroupsElement); + public void listTransitionRouteGroupsTest() throws Exception { + TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build(); ListTransitionRouteGroupsResponse expectedResponse = ListTransitionRouteGroupsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllTransitionRouteGroups(transitionRouteGroups) + .setNextPageToken("") + .addAllTransitionRouteGroups(Arrays.asList(responsesElement)) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -133,15 +98,16 @@ public void listTransitionRouteGroupsTest() { client.listTransitionRouteGroups(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0)); List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListTransitionRouteGroupsRequest actualRequest = - (ListTransitionRouteGroupsRequest) actualRequests.get(0); + ((ListTransitionRouteGroupsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -149,32 +115,75 @@ public void listTransitionRouteGroupsTest() { } @Test - @SuppressWarnings("all") public void listTransitionRouteGroupsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.listTransitionRouteGroups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTransitionRouteGroupsTest2() throws Exception { + TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build(); + ListTransitionRouteGroupsResponse expectedResponse = + ListTransitionRouteGroupsResponse.newBuilder() + .setNextPageToken("") + .addAllTransitionRouteGroups(Arrays.asList(responsesElement)) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTransitionRouteGroupsPagedResponse pagedListResponse = + client.listTransitionRouteGroups(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0)); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTransitionRouteGroupsRequest actualRequest = + ((ListTransitionRouteGroupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTransitionRouteGroupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + String parent = "parent-995424086"; client.listTransitionRouteGroups(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getTransitionRouteGroupTest() { - TransitionRouteGroupName name2 = - TransitionRouteGroupName.of( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); - String displayName = "displayName1615086568"; + public void getTransitionRouteGroupTest() throws Exception { TransitionRouteGroup expectedResponse = TransitionRouteGroup.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -188,9 +197,9 @@ public void getTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetTransitionRouteGroupRequest actualRequest = - (GetTransitionRouteGroupRequest) actualRequests.get(0); + ((GetTransitionRouteGroupRequest) actualRequests.get(0)); - Assert.assertEquals(name, TransitionRouteGroupName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -198,34 +207,75 @@ public void getTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void getTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { TransitionRouteGroupName name = TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + client.getTransitionRouteGroup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getTransitionRouteGroupTest2() throws Exception { + TransitionRouteGroup expectedResponse = + TransitionRouteGroup.newBuilder() + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String name = "name3373707"; + + TransitionRouteGroup actualResponse = client.getTransitionRouteGroup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTransitionRouteGroupRequest actualRequest = + ((GetTransitionRouteGroupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTransitionRouteGroupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + String name = "name3373707"; client.getTransitionRouteGroup(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createTransitionRouteGroupTest() { - TransitionRouteGroupName name = - TransitionRouteGroupName.of( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); - String displayName = "displayName1615086568"; + public void createTransitionRouteGroupTest() throws Exception { TransitionRouteGroup expectedResponse = TransitionRouteGroup.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -239,9 +289,9 @@ public void createTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateTransitionRouteGroupRequest actualRequest = - (CreateTransitionRouteGroupRequest) actualRequests.get(0); + ((CreateTransitionRouteGroupRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -250,33 +300,78 @@ public void createTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void createTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + client.createTransitionRouteGroup(parent, transitionRouteGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTransitionRouteGroupTest2() throws Exception { + TransitionRouteGroup expectedResponse = + TransitionRouteGroup.newBuilder() + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String parent = "parent-995424086"; + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + + TransitionRouteGroup actualResponse = + client.createTransitionRouteGroup(parent, transitionRouteGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTransitionRouteGroupRequest actualRequest = + ((CreateTransitionRouteGroupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTransitionRouteGroupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + try { + String parent = "parent-995424086"; + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); client.createTransitionRouteGroup(parent, transitionRouteGroup); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateTransitionRouteGroupTest() { - TransitionRouteGroupName name = - TransitionRouteGroupName.of( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); - String displayName = "displayName1615086568"; + public void updateTransitionRouteGroupTest() throws Exception { TransitionRouteGroup expectedResponse = TransitionRouteGroup.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -290,7 +385,7 @@ public void updateTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateTransitionRouteGroupRequest actualRequest = - (UpdateTransitionRouteGroupRequest) actualRequests.get(0); + ((UpdateTransitionRouteGroupRequest) actualRequests.get(0)); Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -301,25 +396,22 @@ public void updateTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void updateTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateTransitionRouteGroup(transitionRouteGroup, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteTransitionRouteGroupTest() { + public void deleteTransitionRouteGroupTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -332,9 +424,9 @@ public void deleteTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteTransitionRouteGroupRequest actualRequest = - (DeleteTransitionRouteGroupRequest) actualRequests.get(0); + ((DeleteTransitionRouteGroupRequest) actualRequests.get(0)); - Assert.assertEquals(name, TransitionRouteGroupName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -342,20 +434,53 @@ public void deleteTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void deleteTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { TransitionRouteGroupName name = TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + client.deleteTransitionRouteGroup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTransitionRouteGroupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteTransitionRouteGroup(name); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTransitionRouteGroupRequest actualRequest = + ((DeleteTransitionRouteGroupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTransitionRouteGroupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + String name = "name3373707"; client.deleteTransitionRouteGroup(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java index 65a5b85c5..bfb195824 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.VersionsClient.ListVersionsPagedResponse; @@ -31,13 +32,14 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,66 +47,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class VersionsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private VersionsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockVersions)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); VersionsSettings settings = VersionsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -119,15 +86,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listVersionsTest() { - String nextPageToken = ""; - Version versionsElement = Version.newBuilder().build(); - List versions = Arrays.asList(versionsElement); + public void listVersionsTest() throws Exception { + Version responsesElement = Version.newBuilder().build(); ListVersionsResponse expectedResponse = ListVersionsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllVersions(versions) + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) .build(); mockVersions.addResponse(expectedResponse); @@ -136,14 +100,15 @@ public void listVersionsTest() { ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListVersionsRequest actualRequest = (ListVersionsRequest) actualRequests.get(0); + ListVersionsRequest actualRequest = ((ListVersionsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -151,32 +116,74 @@ public void listVersionsTest() { } @Test - @SuppressWarnings("all") public void listVersionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.listVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVersionsTest2() throws Exception { + Version responsesElement = Version.newBuilder().build(); + ListVersionsResponse expectedResponse = + ListVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) + .build(); + mockVersions.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListVersionsRequest actualRequest = ((ListVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String parent = "parent-995424086"; client.listVersions(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getVersionTest() { - VersionName name2 = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void getVersionTest() throws Exception { Version expectedResponse = Version.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) .build(); mockVersions.addResponse(expectedResponse); @@ -187,9 +194,9 @@ public void getVersionTest() { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetVersionRequest actualRequest = (GetVersionRequest) actualRequests.get(0); + GetVersionRequest actualRequest = ((GetVersionRequest) actualRequests.get(0)); - Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -197,33 +204,75 @@ public void getVersionTest() { } @Test - @SuppressWarnings("all") public void getVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + client.getVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockVersions.addResponse(expectedResponse); + + String name = "name3373707"; + + Version actualResponse = client.getVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVersionRequest actualRequest = ((GetVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String name = "name3373707"; client.getVersion(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void createVersionTest() throws Exception { - VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; Version expectedResponse = Version.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -241,9 +290,9 @@ public void createVersionTest() throws Exception { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateVersionRequest actualRequest = (CreateVersionRequest) actualRequests.get(0); + CreateVersionRequest actualRequest = ((CreateVersionRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(version, actualRequest.getVersion()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -252,35 +301,88 @@ public void createVersionTest() throws Exception { } @Test - @SuppressWarnings("all") public void createVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); Version version = Version.newBuilder().build(); + client.createVersionAsync(parent, version).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockVersions.addResponse(resultOperation); + + String parent = "parent-995424086"; + Version version = Version.newBuilder().build(); + + Version actualResponse = client.createVersionAsync(parent, version).get(); + Assert.assertEquals(expectedResponse, actualResponse); + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateVersionRequest actualRequest = ((CreateVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(version, actualRequest.getVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String parent = "parent-995424086"; + Version version = Version.newBuilder().build(); client.createVersionAsync(parent, version).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void updateVersionTest() { - VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void updateVersionTest() throws Exception { Version expectedResponse = Version.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) .build(); mockVersions.addResponse(expectedResponse); @@ -292,7 +394,7 @@ public void updateVersionTest() { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateVersionRequest actualRequest = (UpdateVersionRequest) actualRequests.get(0); + UpdateVersionRequest actualRequest = ((UpdateVersionRequest) actualRequests.get(0)); Assert.assertEquals(version, actualRequest.getVersion()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -303,25 +405,22 @@ public void updateVersionTest() { } @Test - @SuppressWarnings("all") public void updateVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { Version version = Version.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateVersion(version, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteVersionTest() { + public void deleteVersionTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockVersions.addResponse(expectedResponse); @@ -331,9 +430,9 @@ public void deleteVersionTest() { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteVersionRequest actualRequest = (DeleteVersionRequest) actualRequests.get(0); + DeleteVersionRequest actualRequest = ((DeleteVersionRequest) actualRequests.get(0)); - Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -341,24 +440,55 @@ public void deleteVersionTest() { } @Test - @SuppressWarnings("all") public void deleteVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + client.deleteVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockVersions.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteVersion(name); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteVersionRequest actualRequest = ((DeleteVersionRequest) actualRequests.get(0)); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String name = "name3373707"; client.deleteVersion(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void loadVersionTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = @@ -371,14 +501,13 @@ public void loadVersionTest() throws Exception { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - Empty actualResponse = client.loadVersionAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.loadVersionAsync(name).get(); List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - LoadVersionRequest actualRequest = (LoadVersionRequest) actualRequests.get(0); + LoadVersionRequest actualRequest = ((LoadVersionRequest) actualRequests.get(0)); - Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -386,20 +515,60 @@ public void loadVersionTest() throws Exception { } @Test - @SuppressWarnings("all") public void loadVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + client.loadVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void loadVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("loadVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockVersions.addResponse(resultOperation); + + String name = "name3373707"; + + client.loadVersionAsync(name).get(); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LoadVersionRequest actualRequest = ((LoadVersionRequest) actualRequests.get(0)); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void loadVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String name = "name3373707"; client.loadVersionAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java index ea3cd9ad4..daf085640 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3; import static com.google.cloud.dialogflow.cx.v3.WebhooksClient.ListWebhooksPagedResponse; @@ -26,14 +27,15 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.common.collect.Lists; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,66 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class WebhooksClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSecuritySettingsService mockSecuritySettingsService; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private WebhooksClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSecuritySettingsService = new MockSecuritySettingsService(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSecuritySettingsService, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockWebhooks)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); WebhooksSettings settings = WebhooksSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -115,15 +82,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listWebhooksTest() { - String nextPageToken = ""; - Webhook webhooksElement = Webhook.newBuilder().build(); - List webhooks = Arrays.asList(webhooksElement); + public void listWebhooksTest() throws Exception { + Webhook responsesElement = Webhook.newBuilder().build(); ListWebhooksResponse expectedResponse = ListWebhooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllWebhooks(webhooks) + .setNextPageToken("") + .addAllWebhooks(Arrays.asList(responsesElement)) .build(); mockWebhooks.addResponse(expectedResponse); @@ -132,14 +96,15 @@ public void listWebhooksTest() { ListWebhooksPagedResponse pagedListResponse = client.listWebhooks(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getWebhooksList().get(0), resources.get(0)); List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListWebhooksRequest actualRequest = (ListWebhooksRequest) actualRequests.get(0); + ListWebhooksRequest actualRequest = ((ListWebhooksRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -147,32 +112,71 @@ public void listWebhooksTest() { } @Test - @SuppressWarnings("all") public void listWebhooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listWebhooks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWebhooksTest2() throws Exception { + Webhook responsesElement = Webhook.newBuilder().build(); + ListWebhooksResponse expectedResponse = + ListWebhooksResponse.newBuilder() + .setNextPageToken("") + .addAllWebhooks(Arrays.asList(responsesElement)) + .build(); + mockWebhooks.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWebhooksPagedResponse pagedListResponse = client.listWebhooks(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWebhooksList().get(0), resources.get(0)); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWebhooksRequest actualRequest = ((ListWebhooksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWebhooksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + String parent = "parent-995424086"; client.listWebhooks(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getWebhookTest() { - WebhookName name2 = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); - String displayName = "displayName1615086568"; - boolean disabled = true; + public void getWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDisabled(disabled) + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) .build(); mockWebhooks.addResponse(expectedResponse); @@ -183,9 +187,9 @@ public void getWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetWebhookRequest actualRequest = (GetWebhookRequest) actualRequests.get(0); + GetWebhookRequest actualRequest = ((GetWebhookRequest) actualRequests.get(0)); - Assert.assertEquals(name, WebhookName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -193,32 +197,68 @@ public void getWebhookTest() { } @Test - @SuppressWarnings("all") public void getWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + client.getWebhook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWebhookTest2() throws Exception { + Webhook expectedResponse = + Webhook.newBuilder() + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) + .build(); + mockWebhooks.addResponse(expectedResponse); + + String name = "name3373707"; + + Webhook actualResponse = client.getWebhook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWebhookRequest actualRequest = ((GetWebhookRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWebhookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + try { + String name = "name3373707"; client.getWebhook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createWebhookTest() { - WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); - String displayName = "displayName1615086568"; - boolean disabled = true; + public void createWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDisabled(disabled) + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) .build(); mockWebhooks.addResponse(expectedResponse); @@ -230,9 +270,9 @@ public void createWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateWebhookRequest actualRequest = (CreateWebhookRequest) actualRequests.get(0); + CreateWebhookRequest actualRequest = ((CreateWebhookRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(webhook, actualRequest.getWebhook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -241,33 +281,72 @@ public void createWebhookTest() { } @Test - @SuppressWarnings("all") public void createWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Webhook webhook = Webhook.newBuilder().build(); + client.createWebhook(parent, webhook); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWebhookTest2() throws Exception { + Webhook expectedResponse = + Webhook.newBuilder() + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) + .build(); + mockWebhooks.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Webhook webhook = Webhook.newBuilder().build(); + + Webhook actualResponse = client.createWebhook(parent, webhook); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWebhookRequest actualRequest = ((CreateWebhookRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(webhook, actualRequest.getWebhook()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWebhookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + try { + String parent = "parent-995424086"; + Webhook webhook = Webhook.newBuilder().build(); client.createWebhook(parent, webhook); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateWebhookTest() { - WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); - String displayName = "displayName1615086568"; - boolean disabled = true; + public void updateWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDisabled(disabled) + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) .build(); mockWebhooks.addResponse(expectedResponse); @@ -279,7 +358,7 @@ public void updateWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateWebhookRequest actualRequest = (UpdateWebhookRequest) actualRequests.get(0); + UpdateWebhookRequest actualRequest = ((UpdateWebhookRequest) actualRequests.get(0)); Assert.assertEquals(webhook, actualRequest.getWebhook()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -290,25 +369,22 @@ public void updateWebhookTest() { } @Test - @SuppressWarnings("all") public void updateWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { Webhook webhook = Webhook.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateWebhook(webhook, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteWebhookTest() { + public void deleteWebhookTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockWebhooks.addResponse(expectedResponse); @@ -318,9 +394,9 @@ public void deleteWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteWebhookRequest actualRequest = (DeleteWebhookRequest) actualRequests.get(0); + DeleteWebhookRequest actualRequest = ((DeleteWebhookRequest) actualRequests.get(0)); - Assert.assertEquals(name, WebhookName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -328,18 +404,50 @@ public void deleteWebhookTest() { } @Test - @SuppressWarnings("all") public void deleteWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + client.deleteWebhook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteWebhookTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockWebhooks.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteWebhook(name); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWebhookRequest actualRequest = ((DeleteWebhookRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWebhookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + String name = "name3373707"; client.deleteWebhook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java index fca8adb89..a9ad800d1 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.AgentsClient.ListAgentsPagedResponse; @@ -31,13 +32,13 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,63 +46,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class AgentsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private AgentsClient client; + private static MockAgents mockAgents; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockAgents)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); AgentsSettings settings = AgentsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -116,15 +85,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listAgentsTest() { - String nextPageToken = ""; - Agent agentsElement = Agent.newBuilder().build(); - List agents = Arrays.asList(agentsElement); + public void listAgentsTest() throws Exception { + Agent responsesElement = Agent.newBuilder().build(); ListAgentsResponse expectedResponse = ListAgentsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllAgents(agents) + .setNextPageToken("") + .addAllAgents(Arrays.asList(responsesElement)) .build(); mockAgents.addResponse(expectedResponse); @@ -133,14 +99,15 @@ public void listAgentsTest() { ListAgentsPagedResponse pagedListResponse = client.listAgents(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getAgentsList().get(0), resources.get(0)); List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListAgentsRequest actualRequest = (ListAgentsRequest) actualRequests.get(0); + ListAgentsRequest actualRequest = ((ListAgentsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -148,44 +115,77 @@ public void listAgentsTest() { } @Test - @SuppressWarnings("all") public void listAgentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listAgents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listAgentsTest2() throws Exception { + Agent responsesElement = Agent.newBuilder().build(); + ListAgentsResponse expectedResponse = + ListAgentsResponse.newBuilder() + .setNextPageToken("") + .addAllAgents(Arrays.asList(responsesElement)) + .build(); + mockAgents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListAgentsPagedResponse pagedListResponse = client.listAgents(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAgentsList().get(0), resources.get(0)); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAgentsRequest actualRequest = ((ListAgentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listAgentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + try { + String parent = "parent-995424086"; client.listAgents(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getAgentTest() { - AgentName name2 = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - String displayName = "displayName1615086568"; - String defaultLanguageCode = "defaultLanguageCode856575222"; - String timeZone = "timeZone36848094"; - String description = "description-1724546052"; - String avatarUri = "avatarUri-402824826"; - FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - boolean enableStackdriverLogging = true; - boolean enableSpellCorrection = false; + public void getAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDefaultLanguageCode(defaultLanguageCode) - .setTimeZone(timeZone) - .setDescription(description) - .setAvatarUri(avatarUri) - .setStartFlow(startFlow.toString()) - .setEnableStackdriverLogging(enableStackdriverLogging) - .setEnableSpellCorrection(enableSpellCorrection) + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) .build(); mockAgents.addResponse(expectedResponse); @@ -196,9 +196,9 @@ public void getAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetAgentRequest actualRequest = (GetAgentRequest) actualRequests.get(0); + GetAgentRequest actualRequest = ((GetAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -206,44 +206,80 @@ public void getAgentTest() { } @Test - @SuppressWarnings("all") public void getAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.getAgent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getAgentTest2() throws Exception { + Agent expectedResponse = + Agent.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) + .build(); + mockAgents.addResponse(expectedResponse); + + String name = "name3373707"; + + Agent actualResponse = client.getAgent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetAgentRequest actualRequest = ((GetAgentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getAgentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + String name = "name3373707"; client.getAgent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createAgentTest() { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - String displayName = "displayName1615086568"; - String defaultLanguageCode = "defaultLanguageCode856575222"; - String timeZone = "timeZone36848094"; - String description = "description-1724546052"; - String avatarUri = "avatarUri-402824826"; - FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - boolean enableStackdriverLogging = true; - boolean enableSpellCorrection = false; + public void createAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDefaultLanguageCode(defaultLanguageCode) - .setTimeZone(timeZone) - .setDescription(description) - .setAvatarUri(avatarUri) - .setStartFlow(startFlow.toString()) - .setEnableStackdriverLogging(enableStackdriverLogging) - .setEnableSpellCorrection(enableSpellCorrection) + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) .build(); mockAgents.addResponse(expectedResponse); @@ -255,9 +291,9 @@ public void createAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateAgentRequest actualRequest = (CreateAgentRequest) actualRequests.get(0); + CreateAgentRequest actualRequest = ((CreateAgentRequest) actualRequests.get(0)); - Assert.assertEquals(parent, LocationName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(agent, actualRequest.getAgent()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -266,45 +302,84 @@ public void createAgentTest() { } @Test - @SuppressWarnings("all") public void createAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Agent agent = Agent.newBuilder().build(); + client.createAgent(parent, agent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void createAgentTest2() throws Exception { + Agent expectedResponse = + Agent.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) + .build(); + mockAgents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Agent agent = Agent.newBuilder().build(); + + Agent actualResponse = client.createAgent(parent, agent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAgentRequest actualRequest = ((CreateAgentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(agent, actualRequest.getAgent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createAgentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + String parent = "parent-995424086"; + Agent agent = Agent.newBuilder().build(); client.createAgent(parent, agent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateAgentTest() { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - String displayName = "displayName1615086568"; - String defaultLanguageCode = "defaultLanguageCode856575222"; - String timeZone = "timeZone36848094"; - String description = "description-1724546052"; - String avatarUri = "avatarUri-402824826"; - FlowName startFlow = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - boolean enableStackdriverLogging = true; - boolean enableSpellCorrection = false; + public void updateAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDefaultLanguageCode(defaultLanguageCode) - .setTimeZone(timeZone) - .setDescription(description) - .setAvatarUri(avatarUri) - .setStartFlow(startFlow.toString()) - .setEnableStackdriverLogging(enableStackdriverLogging) - .setEnableSpellCorrection(enableSpellCorrection) + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setDisplayName("display_name1615086568") + .setDefaultLanguageCode("default_language_code856575222") + .setTimeZone("time_zone36848094") + .setDescription("description-1724546052") + .setAvatarUri("avatar_uri-402824826") + .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) + .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setEnableStackdriverLogging(true) + .setEnableSpellCorrection(true) .build(); mockAgents.addResponse(expectedResponse); @@ -316,7 +391,7 @@ public void updateAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateAgentRequest actualRequest = (UpdateAgentRequest) actualRequests.get(0); + UpdateAgentRequest actualRequest = ((UpdateAgentRequest) actualRequests.get(0)); Assert.assertEquals(agent, actualRequest.getAgent()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -327,25 +402,22 @@ public void updateAgentTest() { } @Test - @SuppressWarnings("all") public void updateAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { Agent agent = Agent.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateAgent(agent, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteAgentTest() { + public void deleteAgentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockAgents.addResponse(expectedResponse); @@ -355,9 +427,9 @@ public void deleteAgentTest() { List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteAgentRequest actualRequest = (DeleteAgentRequest) actualRequests.get(0); + DeleteAgentRequest actualRequest = ((DeleteAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -365,27 +437,56 @@ public void deleteAgentTest() { } @Test - @SuppressWarnings("all") public void deleteAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.deleteAgent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteAgentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockAgents.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteAgent(name); + + List actualRequests = mockAgents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteAgentRequest actualRequest = ((DeleteAgentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteAgentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAgents.addException(exception); + + try { + String name = "name3373707"; client.deleteAgent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void exportAgentTest() throws Exception { - String agentUri = "agentUri-1700713166"; - ExportAgentResponse expectedResponse = - ExportAgentResponse.newBuilder().setAgentUri(agentUri).build(); + ExportAgentResponse expectedResponse = ExportAgentResponse.newBuilder().build(); Operation resultOperation = Operation.newBuilder() .setName("exportAgentTest") @@ -394,17 +495,21 @@ public void exportAgentTest() throws Exception { .build(); mockAgents.addResponse(resultOperation); - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - ExportAgentRequest request = ExportAgentRequest.newBuilder().setName(name.toString()).build(); + ExportAgentRequest request = + ExportAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setAgentUri("agent_uri-1700713166") + .build(); ExportAgentResponse actualResponse = client.exportAgentAsync(request).get(); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ExportAgentRequest actualRequest = (ExportAgentRequest) actualRequests.get(0); + ExportAgentRequest actualRequest = ((ExportAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAgentUri(), actualRequest.getAgentUri()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -412,26 +517,26 @@ public void exportAgentTest() throws Exception { } @Test - @SuppressWarnings("all") public void exportAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - ExportAgentRequest request = ExportAgentRequest.newBuilder().setName(name.toString()).build(); - + ExportAgentRequest request = + ExportAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .setAgentUri("agent_uri-1700713166") + .build(); client.exportAgentAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") public void restoreAgentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = @@ -442,17 +547,20 @@ public void restoreAgentTest() throws Exception { .build(); mockAgents.addResponse(resultOperation); - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); - RestoreAgentRequest request = RestoreAgentRequest.newBuilder().setName(name.toString()).build(); + RestoreAgentRequest request = + RestoreAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .build(); - Empty actualResponse = client.restoreAgentAsync(request).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.restoreAgentAsync(request).get(); List actualRequests = mockAgents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - RestoreAgentRequest actualRequest = (RestoreAgentRequest) actualRequests.get(0); + RestoreAgentRequest actualRequest = ((RestoreAgentRequest) actualRequests.get(0)); - Assert.assertEquals(name, AgentName.parse(actualRequest.getName())); + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getAgentUri(), actualRequest.getAgentUri()); + Assert.assertEquals(request.getAgentContent(), actualRequest.getAgentContent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -460,21 +568,20 @@ public void restoreAgentTest() throws Exception { } @Test - @SuppressWarnings("all") public void restoreAgentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockAgents.addException(exception); try { - AgentName name = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); RestoreAgentRequest request = - RestoreAgentRequest.newBuilder().setName(name.toString()).build(); - + RestoreAgentRequest.newBuilder() + .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + .build(); client.restoreAgentAsync(request).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java index dc208f801..eeddf4172 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.EntityTypesClient.ListEntityTypesPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,63 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class EntityTypesClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private EntityTypesClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockEntityTypes)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); EntityTypesSettings settings = EntityTypesSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -112,15 +82,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listEntityTypesTest() { - String nextPageToken = ""; - EntityType entityTypesElement = EntityType.newBuilder().build(); - List entityTypes = Arrays.asList(entityTypesElement); + public void listEntityTypesTest() throws Exception { + EntityType responsesElement = EntityType.newBuilder().build(); ListEntityTypesResponse expectedResponse = ListEntityTypesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllEntityTypes(entityTypes) + .setNextPageToken("") + .addAllEntityTypes(Arrays.asList(responsesElement)) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -129,14 +96,15 @@ public void listEntityTypesTest() { ListEntityTypesPagedResponse pagedListResponse = client.listEntityTypes(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getEntityTypesList().get(0), resources.get(0)); List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListEntityTypesRequest actualRequest = (ListEntityTypesRequest) actualRequests.get(0); + ListEntityTypesRequest actualRequest = ((ListEntityTypesRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -144,32 +112,73 @@ public void listEntityTypesTest() { } @Test - @SuppressWarnings("all") public void listEntityTypesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listEntityTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEntityTypesTest2() throws Exception { + EntityType responsesElement = EntityType.newBuilder().build(); + ListEntityTypesResponse expectedResponse = + ListEntityTypesResponse.newBuilder() + .setNextPageToken("") + .addAllEntityTypes(Arrays.asList(responsesElement)) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEntityTypesPagedResponse pagedListResponse = client.listEntityTypes(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEntityTypesList().get(0), resources.get(0)); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEntityTypesRequest actualRequest = ((ListEntityTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listEntityTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + String parent = "parent-995424086"; client.listEntityTypes(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getEntityTypeTest() { - EntityTypeName name2 = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); - String displayName = "displayName1615086568"; - boolean enableFuzzyExtraction = true; + public void getEntityTypeTest() throws Exception { EntityType expectedResponse = EntityType.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setEnableFuzzyExtraction(enableFuzzyExtraction) + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -180,9 +189,9 @@ public void getEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetEntityTypeRequest actualRequest = (GetEntityTypeRequest) actualRequests.get(0); + GetEntityTypeRequest actualRequest = ((GetEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, EntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -190,33 +199,73 @@ public void getEntityTypeTest() { } @Test - @SuppressWarnings("all") public void getEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + client.getEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getEntityTypeTest2() throws Exception { + EntityType expectedResponse = + EntityType.newBuilder() + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + String name = "name3373707"; + + EntityType actualResponse = client.getEntityType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEntityTypeRequest actualRequest = ((GetEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + try { + String name = "name3373707"; client.getEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createEntityTypeTest() { - EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); - String displayName = "displayName1615086568"; - boolean enableFuzzyExtraction = true; + public void createEntityTypeTest() throws Exception { EntityType expectedResponse = EntityType.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setEnableFuzzyExtraction(enableFuzzyExtraction) + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -228,9 +277,9 @@ public void createEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateEntityTypeRequest actualRequest = (CreateEntityTypeRequest) actualRequests.get(0); + CreateEntityTypeRequest actualRequest = ((CreateEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(entityType, actualRequest.getEntityType()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -239,33 +288,76 @@ public void createEntityTypeTest() { } @Test - @SuppressWarnings("all") public void createEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); EntityType entityType = EntityType.newBuilder().build(); + client.createEntityType(parent, entityType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createEntityTypeTest2() throws Exception { + EntityType expectedResponse = + EntityType.newBuilder() + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) + .build(); + mockEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + EntityType entityType = EntityType.newBuilder().build(); + + EntityType actualResponse = client.createEntityType(parent, entityType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEntityTypeRequest actualRequest = ((CreateEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(entityType, actualRequest.getEntityType()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + try { + String parent = "parent-995424086"; + EntityType entityType = EntityType.newBuilder().build(); client.createEntityType(parent, entityType); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateEntityTypeTest() { - EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); - String displayName = "displayName1615086568"; - boolean enableFuzzyExtraction = true; + public void updateEntityTypeTest() throws Exception { EntityType expectedResponse = EntityType.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setEnableFuzzyExtraction(enableFuzzyExtraction) + .setName( + EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) + .setDisplayName("display_name1615086568") + .addAllEntities(new ArrayList()) + .addAllExcludedPhrases(new ArrayList()) + .setEnableFuzzyExtraction(true) .build(); mockEntityTypes.addResponse(expectedResponse); @@ -277,7 +369,7 @@ public void updateEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateEntityTypeRequest actualRequest = (UpdateEntityTypeRequest) actualRequests.get(0); + UpdateEntityTypeRequest actualRequest = ((UpdateEntityTypeRequest) actualRequests.get(0)); Assert.assertEquals(entityType, actualRequest.getEntityType()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -288,25 +380,22 @@ public void updateEntityTypeTest() { } @Test - @SuppressWarnings("all") public void updateEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { EntityType entityType = EntityType.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateEntityType(entityType, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteEntityTypeTest() { + public void deleteEntityTypeTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockEntityTypes.addResponse(expectedResponse); @@ -316,9 +405,9 @@ public void deleteEntityTypeTest() { List actualRequests = mockEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteEntityTypeRequest actualRequest = (DeleteEntityTypeRequest) actualRequests.get(0); + DeleteEntityTypeRequest actualRequest = ((DeleteEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, EntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -326,19 +415,51 @@ public void deleteEntityTypeTest() { } @Test - @SuppressWarnings("all") public void deleteEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEntityTypes.addException(exception); try { EntityTypeName name = EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]"); + client.deleteEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEntityTypeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockEntityTypes.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteEntityType(name); + + List actualRequests = mockEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEntityTypeRequest actualRequest = ((DeleteEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEntityTypes.addException(exception); + + try { + String name = "name3373707"; client.deleteEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java index ff913cbb0..1d0aa0739 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListEnvironmentsPagedResponse; @@ -32,13 +33,15 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -46,63 +49,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class EnvironmentsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private EnvironmentsClient client; + private static MockEnvironments mockEnvironments; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockEnvironments)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); EnvironmentsSettings settings = EnvironmentsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -117,15 +88,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listEnvironmentsTest() { - String nextPageToken = ""; - Environment environmentsElement = Environment.newBuilder().build(); - List environments = Arrays.asList(environmentsElement); + public void listEnvironmentsTest() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); ListEnvironmentsResponse expectedResponse = ListEnvironmentsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllEnvironments(environments) + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) .build(); mockEnvironments.addResponse(expectedResponse); @@ -134,14 +102,15 @@ public void listEnvironmentsTest() { ListEnvironmentsPagedResponse pagedListResponse = client.listEnvironments(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListEnvironmentsRequest actualRequest = (ListEnvironmentsRequest) actualRequests.get(0); + ListEnvironmentsRequest actualRequest = ((ListEnvironmentsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -149,33 +118,74 @@ public void listEnvironmentsTest() { } @Test - @SuppressWarnings("all") public void listEnvironmentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listEnvironments(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listEnvironmentsTest2() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); + ListEnvironmentsResponse expectedResponse = + ListEnvironmentsResponse.newBuilder() + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) + .build(); + mockEnvironments.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListEnvironmentsPagedResponse pagedListResponse = client.listEnvironments(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListEnvironmentsRequest actualRequest = ((ListEnvironmentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void listEnvironmentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String parent = "parent-995424086"; client.listEnvironments(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getEnvironmentTest() { - EnvironmentName name2 = - EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void getEnvironmentTest() throws Exception { Environment expectedResponse = Environment.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); mockEnvironments.addResponse(expectedResponse); @@ -187,9 +197,9 @@ public void getEnvironmentTest() { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetEnvironmentRequest actualRequest = (GetEnvironmentRequest) actualRequests.get(0); + GetEnvironmentRequest actualRequest = ((GetEnvironmentRequest) actualRequests.get(0)); - Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -197,34 +207,75 @@ public void getEnvironmentTest() { } @Test - @SuppressWarnings("all") public void getEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + client.getEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getEnvironmentTest2() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockEnvironments.addResponse(expectedResponse); + + String name = "name3373707"; + + Environment actualResponse = client.getEnvironment(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetEnvironmentRequest actualRequest = ((GetEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getEnvironmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String name = "name3373707"; client.getEnvironment(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void createEnvironmentTest() throws Exception { - EnvironmentName name = - EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; Environment expectedResponse = Environment.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -242,9 +293,9 @@ public void createEnvironmentTest() throws Exception { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateEnvironmentRequest actualRequest = (CreateEnvironmentRequest) actualRequests.get(0); + CreateEnvironmentRequest actualRequest = ((CreateEnvironmentRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(environment, actualRequest.getEnvironment()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -253,36 +304,88 @@ public void createEnvironmentTest() throws Exception { } @Test - @SuppressWarnings("all") public void createEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Environment environment = Environment.newBuilder().build(); + client.createEnvironmentAsync(parent, environment).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createEnvironmentTest2() throws Exception { + Environment expectedResponse = + Environment.newBuilder() + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createEnvironmentTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockEnvironments.addResponse(resultOperation); + + String parent = "parent-995424086"; + Environment environment = Environment.newBuilder().build(); + Environment actualResponse = client.createEnvironmentAsync(parent, environment).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateEnvironmentRequest actualRequest = ((CreateEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(environment, actualRequest.getEnvironment()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createEnvironmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String parent = "parent-995424086"; + Environment environment = Environment.newBuilder().build(); client.createEnvironmentAsync(parent, environment).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") public void updateEnvironmentTest() throws Exception { - EnvironmentName name = - EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; Environment expectedResponse = Environment.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllVersionConfigs(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -300,7 +403,7 @@ public void updateEnvironmentTest() throws Exception { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateEnvironmentRequest actualRequest = (UpdateEnvironmentRequest) actualRequests.get(0); + UpdateEnvironmentRequest actualRequest = ((UpdateEnvironmentRequest) actualRequests.get(0)); Assert.assertEquals(environment, actualRequest.getEnvironment()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -311,27 +414,24 @@ public void updateEnvironmentTest() throws Exception { } @Test - @SuppressWarnings("all") public void updateEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { Environment environment = Environment.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateEnvironmentAsync(environment, updateMask).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void deleteEnvironmentTest() { + public void deleteEnvironmentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockEnvironments.addResponse(expectedResponse); @@ -342,9 +442,9 @@ public void deleteEnvironmentTest() { List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteEnvironmentRequest actualRequest = (DeleteEnvironmentRequest) actualRequests.get(0); + DeleteEnvironmentRequest actualRequest = ((DeleteEnvironmentRequest) actualRequests.get(0)); - Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -352,32 +452,61 @@ public void deleteEnvironmentTest() { } @Test - @SuppressWarnings("all") public void deleteEnvironmentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + client.deleteEnvironment(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteEnvironmentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockEnvironments.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteEnvironment(name); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteEnvironmentRequest actualRequest = ((DeleteEnvironmentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void deleteEnvironmentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String name = "name3373707"; client.deleteEnvironment(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void lookupEnvironmentHistoryTest() { - String nextPageToken = ""; - Environment environmentsElement = Environment.newBuilder().build(); - List environments = Arrays.asList(environmentsElement); + public void lookupEnvironmentHistoryTest() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); LookupEnvironmentHistoryResponse expectedResponse = LookupEnvironmentHistoryResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllEnvironments(environments) + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) .build(); mockEnvironments.addResponse(expectedResponse); @@ -387,15 +516,16 @@ public void lookupEnvironmentHistoryTest() { LookupEnvironmentHistoryPagedResponse pagedListResponse = client.lookupEnvironmentHistory(name); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); List actualRequests = mockEnvironments.getRequests(); Assert.assertEquals(1, actualRequests.size()); LookupEnvironmentHistoryRequest actualRequest = - (LookupEnvironmentHistoryRequest) actualRequests.get(0); + ((LookupEnvironmentHistoryRequest) actualRequests.get(0)); - Assert.assertEquals(name, EnvironmentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -403,19 +533,62 @@ public void lookupEnvironmentHistoryTest() { } @Test - @SuppressWarnings("all") public void lookupEnvironmentHistoryExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockEnvironments.addException(exception); try { EnvironmentName name = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]"); + client.lookupEnvironmentHistory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupEnvironmentHistoryTest2() throws Exception { + Environment responsesElement = Environment.newBuilder().build(); + LookupEnvironmentHistoryResponse expectedResponse = + LookupEnvironmentHistoryResponse.newBuilder() + .setNextPageToken("") + .addAllEnvironments(Arrays.asList(responsesElement)) + .build(); + mockEnvironments.addResponse(expectedResponse); + + String name = "name3373707"; + LookupEnvironmentHistoryPagedResponse pagedListResponse = client.lookupEnvironmentHistory(name); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getEnvironmentsList().get(0), resources.get(0)); + + List actualRequests = mockEnvironments.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupEnvironmentHistoryRequest actualRequest = + ((LookupEnvironmentHistoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupEnvironmentHistoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnvironments.addException(exception); + + try { + String name = "name3373707"; client.lookupEnvironmentHistory(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java index a0a00ce77..be72c2da6 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.FlowsClient.ListFlowsPagedResponse; @@ -31,13 +32,14 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,63 +47,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class FlowsClientTest { - private static MockPages mockPages; + private static MockServiceHelper mockServiceHelper; private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; private FlowsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockFlows)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); FlowsSettings settings = FlowsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -116,16 +86,15 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void createFlowTest() { - FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void createFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) .build(); mockFlows.addResponse(expectedResponse); @@ -137,9 +106,9 @@ public void createFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateFlowRequest actualRequest = (CreateFlowRequest) actualRequests.get(0); + CreateFlowRequest actualRequest = ((CreateFlowRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(flow, actualRequest.getFlow()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -148,25 +117,68 @@ public void createFlowTest() { } @Test - @SuppressWarnings("all") public void createFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Flow flow = Flow.newBuilder().build(); + client.createFlow(parent, flow); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createFlowTest2() throws Exception { + Flow expectedResponse = + Flow.newBuilder() + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) + .build(); + mockFlows.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Flow flow = Flow.newBuilder().build(); + Flow actualResponse = client.createFlow(parent, flow); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateFlowRequest actualRequest = ((CreateFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(flow, actualRequest.getFlow()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String parent = "parent-995424086"; + Flow flow = Flow.newBuilder().build(); client.createFlow(parent, flow); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteFlowTest() { + public void deleteFlowTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockFlows.addResponse(expectedResponse); @@ -176,9 +188,9 @@ public void deleteFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteFlowRequest actualRequest = (DeleteFlowRequest) actualRequests.get(0); + DeleteFlowRequest actualRequest = ((DeleteFlowRequest) actualRequests.get(0)); - Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -186,29 +198,61 @@ public void deleteFlowTest() { } @Test - @SuppressWarnings("all") public void deleteFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.deleteFlow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void deleteFlowTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockFlows.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteFlow(name); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteFlowRequest actualRequest = ((DeleteFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String name = "name3373707"; client.deleteFlow(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void listFlowsTest() { - String nextPageToken = ""; - Flow flowsElement = Flow.newBuilder().build(); - List flows = Arrays.asList(flowsElement); + public void listFlowsTest() throws Exception { + Flow responsesElement = Flow.newBuilder().build(); ListFlowsResponse expectedResponse = - ListFlowsResponse.newBuilder().setNextPageToken(nextPageToken).addAllFlows(flows).build(); + ListFlowsResponse.newBuilder() + .setNextPageToken("") + .addAllFlows(Arrays.asList(responsesElement)) + .build(); mockFlows.addResponse(expectedResponse); AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); @@ -216,14 +260,15 @@ public void listFlowsTest() { ListFlowsPagedResponse pagedListResponse = client.listFlows(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getFlowsList().get(0), resources.get(0)); List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListFlowsRequest actualRequest = (ListFlowsRequest) actualRequests.get(0); + ListFlowsRequest actualRequest = ((ListFlowsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -231,32 +276,73 @@ public void listFlowsTest() { } @Test - @SuppressWarnings("all") public void listFlowsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listFlows(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listFlowsTest2() throws Exception { + Flow responsesElement = Flow.newBuilder().build(); + ListFlowsResponse expectedResponse = + ListFlowsResponse.newBuilder() + .setNextPageToken("") + .addAllFlows(Arrays.asList(responsesElement)) + .build(); + mockFlows.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListFlowsPagedResponse pagedListResponse = client.listFlows(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFlowsList().get(0), resources.get(0)); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFlowsRequest actualRequest = ((ListFlowsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + @Test + public void listFlowsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String parent = "parent-995424086"; client.listFlows(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getFlowTest() { - FlowName name2 = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void getFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) .build(); mockFlows.addResponse(expectedResponse); @@ -267,9 +353,9 @@ public void getFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetFlowRequest actualRequest = (GetFlowRequest) actualRequests.get(0); + GetFlowRequest actualRequest = ((GetFlowRequest) actualRequests.get(0)); - Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -277,32 +363,72 @@ public void getFlowTest() { } @Test - @SuppressWarnings("all") public void getFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.getFlow(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getFlowTest2() throws Exception { + Flow expectedResponse = + Flow.newBuilder() + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) + .build(); + mockFlows.addResponse(expectedResponse); + + String name = "name3373707"; + + Flow actualResponse = client.getFlow(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFlowRequest actualRequest = ((GetFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String name = "name3373707"; client.getFlow(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateFlowTest() { - FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void updateFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .setNluSettings(NluSettings.newBuilder().build()) .build(); mockFlows.addResponse(expectedResponse); @@ -314,7 +440,7 @@ public void updateFlowTest() { List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateFlowRequest actualRequest = (UpdateFlowRequest) actualRequests.get(0); + UpdateFlowRequest actualRequest = ((UpdateFlowRequest) actualRequests.get(0)); Assert.assertEquals(flow, actualRequest.getFlow()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -325,24 +451,21 @@ public void updateFlowTest() { } @Test - @SuppressWarnings("all") public void updateFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { Flow flow = Flow.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateFlow(flow, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void trainFlowTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = @@ -355,14 +478,13 @@ public void trainFlowTest() throws Exception { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); - Empty actualResponse = client.trainFlowAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.trainFlowAsync(name).get(); List actualRequests = mockFlows.getRequests(); Assert.assertEquals(1, actualRequests.size()); - TrainFlowRequest actualRequest = (TrainFlowRequest) actualRequests.get(0); + TrainFlowRequest actualRequest = ((TrainFlowRequest) actualRequests.get(0)); - Assert.assertEquals(name, FlowName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -370,19 +492,59 @@ public void trainFlowTest() throws Exception { } @Test - @SuppressWarnings("all") public void trainFlowExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockFlows.addException(exception); try { FlowName name = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.trainFlowAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void trainFlowTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("trainFlowTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockFlows.addResponse(resultOperation); + + String name = "name3373707"; + client.trainFlowAsync(name).get(); + + List actualRequests = mockFlows.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TrainFlowRequest actualRequest = ((TrainFlowRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void trainFlowExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockFlows.addException(exception); + + try { + String name = "name3373707"; client.trainFlowAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java index 0446038fc..a69e4a8f0 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.IntentsClient.ListIntentsPagedResponse; @@ -28,12 +29,14 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,63 +44,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class IntentsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; + private static MockServiceHelper mockServiceHelper; private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; private IntentsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockIntents)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); IntentsSettings settings = IntentsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -112,15 +83,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listIntentsTest() { - String nextPageToken = ""; - Intent intentsElement = Intent.newBuilder().build(); - List intents = Arrays.asList(intentsElement); + public void listIntentsTest() throws Exception { + Intent responsesElement = Intent.newBuilder().build(); ListIntentsResponse expectedResponse = ListIntentsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllIntents(intents) + .setNextPageToken("") + .addAllIntents(Arrays.asList(responsesElement)) .build(); mockIntents.addResponse(expectedResponse); @@ -129,14 +97,15 @@ public void listIntentsTest() { ListIntentsPagedResponse pagedListResponse = client.listIntents(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getIntentsList().get(0), resources.get(0)); List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListIntentsRequest actualRequest = (ListIntentsRequest) actualRequests.get(0); + ListIntentsRequest actualRequest = ((ListIntentsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -144,36 +113,75 @@ public void listIntentsTest() { } @Test - @SuppressWarnings("all") public void listIntentsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listIntents(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listIntentsTest2() throws Exception { + Intent responsesElement = Intent.newBuilder().build(); + ListIntentsResponse expectedResponse = + ListIntentsResponse.newBuilder() + .setNextPageToken("") + .addAllIntents(Arrays.asList(responsesElement)) + .build(); + mockIntents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListIntentsPagedResponse pagedListResponse = client.listIntents(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getIntentsList().get(0), resources.get(0)); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListIntentsRequest actualRequest = ((ListIntentsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listIntentsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + String parent = "parent-995424086"; client.listIntents(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getIntentTest() { - IntentName name2 = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); - String displayName = "displayName1615086568"; - int priority = 1165461084; - boolean isFallback = false; - String description = "description-1724546052"; + public void getIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setPriority(priority) - .setIsFallback(isFallback) - .setDescription(description) + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") .build(); mockIntents.addResponse(expectedResponse); @@ -184,9 +192,9 @@ public void getIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetIntentRequest actualRequest = (GetIntentRequest) actualRequests.get(0); + GetIntentRequest actualRequest = ((GetIntentRequest) actualRequests.get(0)); - Assert.assertEquals(name, IntentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -194,36 +202,76 @@ public void getIntentTest() { } @Test - @SuppressWarnings("all") public void getIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + client.getIntent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIntentTest2() throws Exception { + Intent expectedResponse = + Intent.newBuilder() + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockIntents.addResponse(expectedResponse); + + String name = "name3373707"; + + Intent actualResponse = client.getIntent(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIntentRequest actualRequest = ((GetIntentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIntentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + try { + String name = "name3373707"; client.getIntent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createIntentTest() { - IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); - String displayName = "displayName1615086568"; - int priority = 1165461084; - boolean isFallback = false; - String description = "description-1724546052"; + public void createIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setPriority(priority) - .setIsFallback(isFallback) - .setDescription(description) + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") .build(); mockIntents.addResponse(expectedResponse); @@ -235,9 +283,9 @@ public void createIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateIntentRequest actualRequest = (CreateIntentRequest) actualRequests.get(0); + CreateIntentRequest actualRequest = ((CreateIntentRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(intent, actualRequest.getIntent()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -246,37 +294,80 @@ public void createIntentTest() { } @Test - @SuppressWarnings("all") public void createIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Intent intent = Intent.newBuilder().build(); + client.createIntent(parent, intent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createIntentTest2() throws Exception { + Intent expectedResponse = + Intent.newBuilder() + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") + .build(); + mockIntents.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Intent intent = Intent.newBuilder().build(); + + Intent actualResponse = client.createIntent(parent, intent); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateIntentRequest actualRequest = ((CreateIntentRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(intent, actualRequest.getIntent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createIntentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + try { + String parent = "parent-995424086"; + Intent intent = Intent.newBuilder().build(); client.createIntent(parent, intent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateIntentTest() { - IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); - String displayName = "displayName1615086568"; - int priority = 1165461084; - boolean isFallback = false; - String description = "description-1724546052"; + public void updateIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setPriority(priority) - .setIsFallback(isFallback) - .setDescription(description) + .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) + .setDisplayName("display_name1615086568") + .addAllTrainingPhrases(new ArrayList()) + .addAllParameters(new ArrayList()) + .setPriority(-1165461084) + .setIsFallback(true) + .putAllLabels(new HashMap()) + .setDescription("description-1724546052") .build(); mockIntents.addResponse(expectedResponse); @@ -288,7 +379,7 @@ public void updateIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateIntentRequest actualRequest = (UpdateIntentRequest) actualRequests.get(0); + UpdateIntentRequest actualRequest = ((UpdateIntentRequest) actualRequests.get(0)); Assert.assertEquals(intent, actualRequest.getIntent()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -299,25 +390,22 @@ public void updateIntentTest() { } @Test - @SuppressWarnings("all") public void updateIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { Intent intent = Intent.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateIntent(intent, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteIntentTest() { + public void deleteIntentTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockIntents.addResponse(expectedResponse); @@ -327,9 +415,9 @@ public void deleteIntentTest() { List actualRequests = mockIntents.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteIntentRequest actualRequest = (DeleteIntentRequest) actualRequests.get(0); + DeleteIntentRequest actualRequest = ((DeleteIntentRequest) actualRequests.get(0)); - Assert.assertEquals(name, IntentName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -337,18 +425,50 @@ public void deleteIntentTest() { } @Test - @SuppressWarnings("all") public void deleteIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockIntents.addException(exception); try { IntentName name = IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]"); + client.deleteIntent(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteIntentTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockIntents.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteIntent(name); + + List actualRequests = mockIntents.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteIntentRequest actualRequest = ((DeleteIntentRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteIntentExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIntents.addException(exception); + + try { + String name = "name3373707"; client.deleteIntent(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgents.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgents.java index 740ffe3e5..ebec1fd5e 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgents.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgents.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAgents implements MockGrpcService { private final MockAgentsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgentsImpl.java index e500b3ac8..491a3fa1a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgentsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockAgentsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockAgentsImpl extends AgentsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listAgents( Object response = responses.remove(); if (response instanceof ListAgentsResponse) { requests.add(request); - responseObserver.onNext((ListAgentsResponse) response); + responseObserver.onNext(((ListAgentsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void getAgent(GetAgentRequest request, StreamObserver responseObse Object response = responses.remove(); if (response instanceof Agent) { requests.add(request); - responseObserver.onNext((Agent) response); + responseObserver.onNext(((Agent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -92,10 +94,10 @@ public void createAgent(CreateAgentRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Agent) { requests.add(request); - responseObserver.onNext((Agent) response); + responseObserver.onNext(((Agent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -106,10 +108,10 @@ public void updateAgent(UpdateAgentRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Agent) { requests.add(request); - responseObserver.onNext((Agent) response); + responseObserver.onNext(((Agent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -120,10 +122,10 @@ public void deleteAgent(DeleteAgentRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -134,10 +136,10 @@ public void exportAgent(ExportAgentRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -149,10 +151,10 @@ public void restoreAgent( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypes.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypes.java index a326826ab..71fa21cc6 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypes.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypes.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEntityTypes implements MockGrpcService { private final MockEntityTypesImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypesImpl.java index 6fddd9790..a3a1b6bf9 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypesImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEntityTypesImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEntityTypesImpl extends EntityTypesImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listEntityTypes( Object response = responses.remove(); if (response instanceof ListEntityTypesResponse) { requests.add(request); - responseObserver.onNext((ListEntityTypesResponse) response); + responseObserver.onNext(((ListEntityTypesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void getEntityType( Object response = responses.remove(); if (response instanceof EntityType) { requests.add(request); - responseObserver.onNext((EntityType) response); + responseObserver.onNext(((EntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -93,10 +95,10 @@ public void createEntityType( Object response = responses.remove(); if (response instanceof EntityType) { requests.add(request); - responseObserver.onNext((EntityType) response); + responseObserver.onNext(((EntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -108,10 +110,10 @@ public void updateEntityType( Object response = responses.remove(); if (response instanceof EntityType) { requests.add(request); - responseObserver.onNext((EntityType) response); + responseObserver.onNext(((EntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -123,10 +125,10 @@ public void deleteEntityType( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironments.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironments.java index 5c5888ec7..b3a0d7340 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironments.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironments.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEnvironments implements MockGrpcService { private final MockEnvironmentsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironmentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironmentsImpl.java index 2eb17cdd5..9c2b763b9 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironmentsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockEnvironmentsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockEnvironmentsImpl extends EnvironmentsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listEnvironments( Object response = responses.remove(); if (response instanceof ListEnvironmentsResponse) { requests.add(request); - responseObserver.onNext((ListEnvironmentsResponse) response); + responseObserver.onNext(((ListEnvironmentsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -79,10 +81,10 @@ public void getEnvironment( Object response = responses.remove(); if (response instanceof Environment) { requests.add(request); - responseObserver.onNext((Environment) response); + responseObserver.onNext(((Environment) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -94,10 +96,10 @@ public void createEnvironment( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -109,10 +111,10 @@ public void updateEnvironment( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -124,10 +126,10 @@ public void deleteEnvironment( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -140,10 +142,10 @@ public void lookupEnvironmentHistory( Object response = responses.remove(); if (response instanceof LookupEnvironmentHistoryResponse) { requests.add(request); - responseObserver.onNext((LookupEnvironmentHistoryResponse) response); + responseObserver.onNext(((LookupEnvironmentHistoryResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlows.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlows.java index 01fed1242..918810d94 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlows.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlows.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockFlows implements MockGrpcService { private final MockFlowsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlowsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlowsImpl.java index 5f81de1df..ab7b52e81 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlowsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockFlowsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockFlowsImpl extends FlowsImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void createFlow(CreateFlowRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Flow) { requests.add(request); - responseObserver.onNext((Flow) response); + responseObserver.onNext(((Flow) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void deleteFlow(DeleteFlowRequest request, StreamObserver response Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -92,10 +94,10 @@ public void listFlows( Object response = responses.remove(); if (response instanceof ListFlowsResponse) { requests.add(request); - responseObserver.onNext((ListFlowsResponse) response); + responseObserver.onNext(((ListFlowsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -106,10 +108,10 @@ public void getFlow(GetFlowRequest request, StreamObserver responseObserve Object response = responses.remove(); if (response instanceof Flow) { requests.add(request); - responseObserver.onNext((Flow) response); + responseObserver.onNext(((Flow) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -120,10 +122,10 @@ public void updateFlow(UpdateFlowRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Flow) { requests.add(request); - responseObserver.onNext((Flow) response); + responseObserver.onNext(((Flow) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -134,10 +136,10 @@ public void trainFlow(TrainFlowRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntents.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntents.java index 67297127e..a6fbfa8c2 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntents.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntents.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockIntents implements MockGrpcService { private final MockIntentsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntentsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntentsImpl.java index d51edbb92..4493218ad 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntentsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockIntentsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockIntentsImpl extends IntentsImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listIntents( Object response = responses.remove(); if (response instanceof ListIntentsResponse) { requests.add(request); - responseObserver.onNext((ListIntentsResponse) response); + responseObserver.onNext(((ListIntentsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void getIntent(GetIntentRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Intent) { requests.add(request); - responseObserver.onNext((Intent) response); + responseObserver.onNext(((Intent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -91,10 +93,10 @@ public void createIntent(CreateIntentRequest request, StreamObserver res Object response = responses.remove(); if (response instanceof Intent) { requests.add(request); - responseObserver.onNext((Intent) response); + responseObserver.onNext(((Intent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -105,10 +107,10 @@ public void updateIntent(UpdateIntentRequest request, StreamObserver res Object response = responses.remove(); if (response instanceof Intent) { requests.add(request); - responseObserver.onNext((Intent) response); + responseObserver.onNext(((Intent) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -119,10 +121,10 @@ public void deleteIntent(DeleteIntentRequest request, StreamObserver resp Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPages.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPages.java index 76faba3d6..f1cc5aec4 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPages.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPages.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockPages implements MockGrpcService { private final MockPagesImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPagesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPagesImpl.java index 13b734fb2..02ee44596 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPagesImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockPagesImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockPagesImpl extends PagesImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listPages( Object response = responses.remove(); if (response instanceof ListPagesResponse) { requests.add(request); - responseObserver.onNext((ListPagesResponse) response); + responseObserver.onNext(((ListPagesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void getPage(GetPageRequest request, StreamObserver responseObserve Object response = responses.remove(); if (response instanceof Page) { requests.add(request); - responseObserver.onNext((Page) response); + responseObserver.onNext(((Page) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -91,10 +93,10 @@ public void createPage(CreatePageRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Page) { requests.add(request); - responseObserver.onNext((Page) response); + responseObserver.onNext(((Page) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -105,10 +107,10 @@ public void updatePage(UpdatePageRequest request, StreamObserver responseO Object response = responses.remove(); if (response instanceof Page) { requests.add(request); - responseObserver.onNext((Page) response); + responseObserver.onNext(((Page) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -119,10 +121,10 @@ public void deletePage(DeletePageRequest request, StreamObserver response Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypes.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypes.java index aaa494d90..93a482daa 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypes.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypes.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessionEntityTypes implements MockGrpcService { private final MockSessionEntityTypesImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypesImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypesImpl.java index 8745b9ab4..11ac2c939 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypesImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionEntityTypesImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessionEntityTypesImpl extends SessionEntityTypesImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listSessionEntityTypes( Object response = responses.remove(); if (response instanceof ListSessionEntityTypesResponse) { requests.add(request); - responseObserver.onNext((ListSessionEntityTypesResponse) response); + responseObserver.onNext(((ListSessionEntityTypesResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -79,10 +81,10 @@ public void getSessionEntityType( Object response = responses.remove(); if (response instanceof SessionEntityType) { requests.add(request); - responseObserver.onNext((SessionEntityType) response); + responseObserver.onNext(((SessionEntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -94,10 +96,10 @@ public void createSessionEntityType( Object response = responses.remove(); if (response instanceof SessionEntityType) { requests.add(request); - responseObserver.onNext((SessionEntityType) response); + responseObserver.onNext(((SessionEntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -109,10 +111,10 @@ public void updateSessionEntityType( Object response = responses.remove(); if (response instanceof SessionEntityType) { requests.add(request); - responseObserver.onNext((SessionEntityType) response); + responseObserver.onNext(((SessionEntityType) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -124,10 +126,10 @@ public void deleteSessionEntityType( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessions.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessions.java index 3e1f1fe67..97432b39a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessions.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessions.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessions implements MockGrpcService { private final MockSessionsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionsImpl.java index da8b721ff..a80c43488 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockSessionsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -23,9 +24,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockSessionsImpl extends SessionsImplBase { private List requests; private Queue responses; @@ -62,10 +64,10 @@ public void detectIntent( Object response = responses.remove(); if (response instanceof DetectIntentResponse) { requests.add(request); - responseObserver.onNext((DetectIntentResponse) response); + responseObserver.onNext(((DetectIntentResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -81,9 +83,9 @@ public void onNext(StreamingDetectIntentRequest value) { requests.add(value); final Object response = responses.remove(); if (response instanceof StreamingDetectIntentResponse) { - responseObserver.onNext((StreamingDetectIntentResponse) response); + responseObserver.onNext(((StreamingDetectIntentResponse) response)); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -108,10 +110,10 @@ public void matchIntent( Object response = responses.remove(); if (response instanceof MatchIntentResponse) { requests.add(request); - responseObserver.onNext((MatchIntentResponse) response); + responseObserver.onNext(((MatchIntentResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -123,10 +125,10 @@ public void fulfillIntent( Object response = responses.remove(); if (response instanceof FulfillIntentResponse) { requests.add(request); - responseObserver.onNext((FulfillIntentResponse) response); + responseObserver.onNext(((FulfillIntentResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroups.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroups.java index c0e8f6d5b..818d38ef0 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroups.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroups.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockTransitionRouteGroups implements MockGrpcService { private final MockTransitionRouteGroupsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroupsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroupsImpl.java index 51e9944a0..1f1725652 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroupsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockTransitionRouteGroupsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockTransitionRouteGroupsImpl extends TransitionRouteGroupsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listTransitionRouteGroups( Object response = responses.remove(); if (response instanceof ListTransitionRouteGroupsResponse) { requests.add(request); - responseObserver.onNext((ListTransitionRouteGroupsResponse) response); + responseObserver.onNext(((ListTransitionRouteGroupsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -80,10 +82,10 @@ public void getTransitionRouteGroup( Object response = responses.remove(); if (response instanceof TransitionRouteGroup) { requests.add(request); - responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onNext(((TransitionRouteGroup) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -96,10 +98,10 @@ public void createTransitionRouteGroup( Object response = responses.remove(); if (response instanceof TransitionRouteGroup) { requests.add(request); - responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onNext(((TransitionRouteGroup) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -112,10 +114,10 @@ public void updateTransitionRouteGroup( Object response = responses.remove(); if (response instanceof TransitionRouteGroup) { requests.add(request); - responseObserver.onNext((TransitionRouteGroup) response); + responseObserver.onNext(((TransitionRouteGroup) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -127,10 +129,10 @@ public void deleteTransitionRouteGroup( Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersions.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersions.java index 0eda34bfe..002931dce 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersions.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersions.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockVersions implements MockGrpcService { private final MockVersionsImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersionsImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersionsImpl.java index e8662d51b..bfd10811e 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersionsImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockVersionsImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -25,9 +26,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockVersionsImpl extends VersionsImplBase { private List requests; private Queue responses; @@ -64,10 +66,10 @@ public void listVersions( Object response = responses.remove(); if (response instanceof ListVersionsResponse) { requests.add(request); - responseObserver.onNext((ListVersionsResponse) response); + responseObserver.onNext(((ListVersionsResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -78,10 +80,10 @@ public void getVersion(GetVersionRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Version) { requests.add(request); - responseObserver.onNext((Version) response); + responseObserver.onNext(((Version) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -93,10 +95,10 @@ public void createVersion( Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -108,10 +110,10 @@ public void updateVersion( Object response = responses.remove(); if (response instanceof Version) { requests.add(request); - responseObserver.onNext((Version) response); + responseObserver.onNext(((Version) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -122,10 +124,10 @@ public void deleteVersion(DeleteVersionRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -136,10 +138,10 @@ public void loadVersion(LoadVersionRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Operation) { requests.add(request); - responseObserver.onNext((Operation) response); + responseObserver.onNext(((Operation) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooks.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooks.java index 08ac7c1a2..7081dbd12 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooks.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooks.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -20,9 +21,10 @@ import com.google.protobuf.AbstractMessage; import io.grpc.ServerServiceDefinition; import java.util.List; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockWebhooks implements MockGrpcService { private final MockWebhooksImpl serviceImpl; diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooksImpl.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooksImpl.java index 2b8cb77e8..955caa942 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooksImpl.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/MockWebhooksImpl.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.core.BetaApi; @@ -24,9 +25,10 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; +import javax.annotation.Generated; -@javax.annotation.Generated("by GAPIC") @BetaApi +@Generated("by gapic-generator-java") public class MockWebhooksImpl extends WebhooksImplBase { private List requests; private Queue responses; @@ -63,10 +65,10 @@ public void listWebhooks( Object response = responses.remove(); if (response instanceof ListWebhooksResponse) { requests.add(request); - responseObserver.onNext((ListWebhooksResponse) response); + responseObserver.onNext(((ListWebhooksResponse) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -77,10 +79,10 @@ public void getWebhook(GetWebhookRequest request, StreamObserver respon Object response = responses.remove(); if (response instanceof Webhook) { requests.add(request); - responseObserver.onNext((Webhook) response); + responseObserver.onNext(((Webhook) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -92,10 +94,10 @@ public void createWebhook( Object response = responses.remove(); if (response instanceof Webhook) { requests.add(request); - responseObserver.onNext((Webhook) response); + responseObserver.onNext(((Webhook) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -107,10 +109,10 @@ public void updateWebhook( Object response = responses.remove(); if (response instanceof Webhook) { requests.add(request); - responseObserver.onNext((Webhook) response); + responseObserver.onNext(((Webhook) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } @@ -121,10 +123,10 @@ public void deleteWebhook(DeleteWebhookRequest request, StreamObserver re Object response = responses.remove(); if (response instanceof Empty) { requests.add(request); - responseObserver.onNext((Empty) response); + responseObserver.onNext(((Empty) response)); responseObserver.onCompleted(); } else if (response instanceof Exception) { - responseObserver.onError((Exception) response); + responseObserver.onError(((Exception) response)); } else { responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java index af86c613a..3277d618a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.PagesClient.ListPagesPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,63 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class PagesClientTest { private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private PagesClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockPages)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); PagesSettings settings = PagesSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -112,13 +82,13 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listPagesTest() { - String nextPageToken = ""; - Page pagesElement = Page.newBuilder().build(); - List pages = Arrays.asList(pagesElement); + public void listPagesTest() throws Exception { + Page responsesElement = Page.newBuilder().build(); ListPagesResponse expectedResponse = - ListPagesResponse.newBuilder().setNextPageToken(nextPageToken).addAllPages(pages).build(); + ListPagesResponse.newBuilder() + .setNextPageToken("") + .addAllPages(Arrays.asList(responsesElement)) + .build(); mockPages.addResponse(expectedResponse); FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); @@ -126,14 +96,15 @@ public void listPagesTest() { ListPagesPagedResponse pagedListResponse = client.listPages(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getPagesList().get(0), resources.get(0)); List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListPagesRequest actualRequest = (ListPagesRequest) actualRequests.get(0); + ListPagesRequest actualRequest = ((ListPagesRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -141,28 +112,76 @@ public void listPagesTest() { } @Test - @SuppressWarnings("all") public void listPagesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.listPages(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listPagesTest2() throws Exception { + Page responsesElement = Page.newBuilder().build(); + ListPagesResponse expectedResponse = + ListPagesResponse.newBuilder() + .setNextPageToken("") + .addAllPages(Arrays.asList(responsesElement)) + .build(); + mockPages.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListPagesPagedResponse pagedListResponse = client.listPages(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getPagesList().get(0), resources.get(0)); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListPagesRequest actualRequest = ((ListPagesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listPagesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + String parent = "parent-995424086"; client.listPages(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getPageTest() { - PageName name2 = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); - String displayName = "displayName1615086568"; + public void getPageTest() throws Exception { Page expectedResponse = - Page.newBuilder().setName(name2.toString()).setDisplayName(displayName).build(); + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); mockPages.addResponse(expectedResponse); PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); @@ -172,9 +191,9 @@ public void getPageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetPageRequest actualRequest = (GetPageRequest) actualRequests.get(0); + GetPageRequest actualRequest = ((GetPageRequest) actualRequests.get(0)); - Assert.assertEquals(name, PageName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -182,28 +201,77 @@ public void getPageTest() { } @Test - @SuppressWarnings("all") public void getPageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + client.getPage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getPageTest2() throws Exception { + Page expectedResponse = + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); + mockPages.addResponse(expectedResponse); + + String name = "name3373707"; + + Page actualResponse = client.getPage(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetPageRequest actualRequest = ((GetPageRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getPageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + try { + String name = "name3373707"; client.getPage(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createPageTest() { - PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); - String displayName = "displayName1615086568"; + public void createPageTest() throws Exception { Page expectedResponse = - Page.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); mockPages.addResponse(expectedResponse); FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); @@ -214,9 +282,9 @@ public void createPageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreatePageRequest actualRequest = (CreatePageRequest) actualRequests.get(0); + CreatePageRequest actualRequest = ((CreatePageRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(page, actualRequest.getPage()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -225,29 +293,81 @@ public void createPageTest() { } @Test - @SuppressWarnings("all") public void createPageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); Page page = Page.newBuilder().build(); + client.createPage(parent, page); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createPageTest2() throws Exception { + Page expectedResponse = + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); + mockPages.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Page page = Page.newBuilder().build(); + + Page actualResponse = client.createPage(parent, page); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreatePageRequest actualRequest = ((CreatePageRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(page, actualRequest.getPage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createPageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + try { + String parent = "parent-995424086"; + Page page = Page.newBuilder().build(); client.createPage(parent, page); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updatePageTest() { - PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); - String displayName = "displayName1615086568"; + public void updatePageTest() throws Exception { Page expectedResponse = - Page.newBuilder().setName(name.toString()).setDisplayName(displayName).build(); + Page.newBuilder() + .setName( + PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) + .setDisplayName("display_name1615086568") + .setEntryFulfillment(Fulfillment.newBuilder().build()) + .setForm(Form.newBuilder().build()) + .addAllTransitionRouteGroups(new ArrayList()) + .addAllTransitionRoutes(new ArrayList()) + .addAllEventHandlers(new ArrayList()) + .build(); mockPages.addResponse(expectedResponse); Page page = Page.newBuilder().build(); @@ -258,7 +378,7 @@ public void updatePageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdatePageRequest actualRequest = (UpdatePageRequest) actualRequests.get(0); + UpdatePageRequest actualRequest = ((UpdatePageRequest) actualRequests.get(0)); Assert.assertEquals(page, actualRequest.getPage()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -269,25 +389,22 @@ public void updatePageTest() { } @Test - @SuppressWarnings("all") public void updatePageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { Page page = Page.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updatePage(page, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deletePageTest() { + public void deletePageTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockPages.addResponse(expectedResponse); @@ -297,9 +414,9 @@ public void deletePageTest() { List actualRequests = mockPages.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeletePageRequest actualRequest = (DeletePageRequest) actualRequests.get(0); + DeletePageRequest actualRequest = ((DeletePageRequest) actualRequests.get(0)); - Assert.assertEquals(name, PageName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -307,18 +424,50 @@ public void deletePageTest() { } @Test - @SuppressWarnings("all") public void deletePageExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockPages.addException(exception); try { PageName name = PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]"); + client.deletePage(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deletePageTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockPages.addResponse(expectedResponse); + + String name = "name3373707"; + client.deletePage(name); + + List actualRequests = mockPages.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeletePageRequest actualRequest = ((DeletePageRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deletePageExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockPages.addException(exception); + + try { + String name = "name3373707"; client.deletePage(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClientTest.java index c08705f0a..ef795d6b0 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypesClient.ListSessionEntityTypesPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,63 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class SessionEntityTypesClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private SessionEntityTypesClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockSessionEntityTypes)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); SessionEntityTypesSettings settings = SessionEntityTypesSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -112,15 +82,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listSessionEntityTypesTest() { - String nextPageToken = ""; - SessionEntityType sessionEntityTypesElement = SessionEntityType.newBuilder().build(); - List sessionEntityTypes = Arrays.asList(sessionEntityTypesElement); + public void listSessionEntityTypesTest() throws Exception { + SessionEntityType responsesElement = SessionEntityType.newBuilder().build(); ListSessionEntityTypesResponse expectedResponse = ListSessionEntityTypesResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllSessionEntityTypes(sessionEntityTypes) + .setNextPageToken("") + .addAllSessionEntityTypes(Arrays.asList(responsesElement)) .build(); mockSessionEntityTypes.addResponse(expectedResponse); @@ -131,15 +98,16 @@ public void listSessionEntityTypesTest() { ListSessionEntityTypesPagedResponse pagedListResponse = client.listSessionEntityTypes(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getSessionEntityTypesList().get(0), resources.get(0)); List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListSessionEntityTypesRequest actualRequest = - (ListSessionEntityTypesRequest) actualRequests.get(0); + ((ListSessionEntityTypesRequest) actualRequests.get(0)); - Assert.assertEquals(parent, SessionName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -147,31 +115,76 @@ public void listSessionEntityTypesTest() { } @Test - @SuppressWarnings("all") public void listSessionEntityTypesExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionName parent = SessionName.ofProjectLocationAgentSessionName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); + client.listSessionEntityTypes(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listSessionEntityTypesTest2() throws Exception { + SessionEntityType responsesElement = SessionEntityType.newBuilder().build(); + ListSessionEntityTypesResponse expectedResponse = + ListSessionEntityTypesResponse.newBuilder() + .setNextPageToken("") + .addAllSessionEntityTypes(Arrays.asList(responsesElement)) + .build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListSessionEntityTypesPagedResponse pagedListResponse = client.listSessionEntityTypes(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getSessionEntityTypesList().get(0), resources.get(0)); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListSessionEntityTypesRequest actualRequest = + ((ListSessionEntityTypesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listSessionEntityTypesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + try { + String parent = "parent-995424086"; client.listSessionEntityTypes(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getSessionEntityTypeTest() { - SessionEntityTypeName name2 = - SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + public void getSessionEntityTypeTest() throws Exception { SessionEntityType expectedResponse = - SessionEntityType.newBuilder().setName(name2.toString()).build(); + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); mockSessionEntityTypes.addResponse(expectedResponse); SessionEntityTypeName name = @@ -183,9 +196,10 @@ public void getSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetSessionEntityTypeRequest actualRequest = (GetSessionEntityTypeRequest) actualRequests.get(0); + GetSessionEntityTypeRequest actualRequest = + ((GetSessionEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, SessionEntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -193,31 +207,74 @@ public void getSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void getSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + client.getSessionEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getSessionEntityTypeTest2() throws Exception { + SessionEntityType expectedResponse = + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); + mockSessionEntityTypes.addResponse(expectedResponse); + String name = "name3373707"; + + SessionEntityType actualResponse = client.getSessionEntityType(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetSessionEntityTypeRequest actualRequest = + ((GetSessionEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getSessionEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + String name = "name3373707"; client.getSessionEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createSessionEntityTypeTest() { - SessionEntityTypeName name = - SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + public void createSessionEntityTypeTest() throws Exception { SessionEntityType expectedResponse = - SessionEntityType.newBuilder().setName(name.toString()).build(); + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); mockSessionEntityTypes.addResponse(expectedResponse); SessionName parent = @@ -231,9 +288,9 @@ public void createSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateSessionEntityTypeRequest actualRequest = - (CreateSessionEntityTypeRequest) actualRequests.get(0); + ((CreateSessionEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(parent, SessionName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -242,9 +299,8 @@ public void createSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void createSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { @@ -252,22 +308,69 @@ public void createSessionEntityTypeExceptionTest() throws Exception { SessionName.ofProjectLocationAgentSessionName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + client.createSessionEntityType(parent, sessionEntityType); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void createSessionEntityTypeTest2() throws Exception { + SessionEntityType expectedResponse = + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + String parent = "parent-995424086"; + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); + + SessionEntityType actualResponse = client.createSessionEntityType(parent, sessionEntityType); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateSessionEntityTypeRequest actualRequest = + ((CreateSessionEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createSessionEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + String parent = "parent-995424086"; + SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); client.createSessionEntityType(parent, sessionEntityType); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateSessionEntityTypeTest() { - SessionEntityTypeName name = - SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + public void updateSessionEntityTypeTest() throws Exception { SessionEntityType expectedResponse = - SessionEntityType.newBuilder().setName(name.toString()).build(); + SessionEntityType.newBuilder() + .setName( + SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]") + .toString()) + .addAllEntities(new ArrayList()) + .build(); mockSessionEntityTypes.addResponse(expectedResponse); SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); @@ -280,7 +383,7 @@ public void updateSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateSessionEntityTypeRequest actualRequest = - (UpdateSessionEntityTypeRequest) actualRequests.get(0); + ((UpdateSessionEntityTypeRequest) actualRequests.get(0)); Assert.assertEquals(sessionEntityType, actualRequest.getSessionEntityType()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -291,25 +394,22 @@ public void updateSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void updateSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateSessionEntityType(sessionEntityType, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteSessionEntityTypeTest() { + public void deleteSessionEntityTypeTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockSessionEntityTypes.addResponse(expectedResponse); @@ -322,9 +422,9 @@ public void deleteSessionEntityTypeTest() { List actualRequests = mockSessionEntityTypes.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteSessionEntityTypeRequest actualRequest = - (DeleteSessionEntityTypeRequest) actualRequests.get(0); + ((DeleteSessionEntityTypeRequest) actualRequests.get(0)); - Assert.assertEquals(name, SessionEntityTypeName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -332,20 +432,53 @@ public void deleteSessionEntityTypeTest() { } @Test - @SuppressWarnings("all") public void deleteSessionEntityTypeExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessionEntityTypes.addException(exception); try { SessionEntityTypeName name = SessionEntityTypeName.ofProjectLocationAgentSessionEntityTypeName( "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]", "[ENTITY_TYPE]"); + client.deleteSessionEntityType(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteSessionEntityTypeTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockSessionEntityTypes.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteSessionEntityType(name); + + List actualRequests = mockSessionEntityTypes.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteSessionEntityTypeRequest actualRequest = + ((DeleteSessionEntityTypeRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteSessionEntityTypeExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSessionEntityTypes.addException(exception); + + try { + String name = "name3373707"; client.deleteSessionEntityType(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java index b50df1371..cf1b57b2a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import com.google.api.gax.core.NoCredentialsProvider; @@ -28,13 +29,14 @@ import com.google.api.gax.rpc.StatusCode; import com.google.protobuf.AbstractMessage; import com.google.protobuf.ByteString; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -42,63 +44,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class SessionsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private SessionsClient client; private LocalChannelProvider channelProvider; + private static MockSessions mockSessions; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockSessions)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); SessionsSettings settings = SessionsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -113,25 +83,25 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void detectIntentTest() { - String responseId = "responseId1847552473"; - ByteString outputAudio = ByteString.copyFromUtf8("24"); + public void detectIntentTest() throws Exception { DetectIntentResponse expectedResponse = DetectIntentResponse.newBuilder() - .setResponseId(responseId) - .setOutputAudio(outputAudio) + .setResponseId("response_id1847552473") + .setQueryResult(QueryResult.newBuilder().build()) + .setOutputAudio(ByteString.EMPTY) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); mockSessions.addResponse(expectedResponse); - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); DetectIntentRequest request = DetectIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); DetectIntentResponse actualResponse = client.detectIntent(request); @@ -139,10 +109,12 @@ public void detectIntentTest() { List actualRequests = mockSessions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DetectIntentRequest actualRequest = (DetectIntentRequest) actualRequests.get(0); + DetectIntentRequest actualRequest = ((DetectIntentRequest) actualRequests.get(0)); - Assert.assertEquals(session, SessionName.parse(actualRequest.getSession())); - Assert.assertEquals(queryInput, actualRequest.getQueryInput()); + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertEquals(request.getQueryParams(), actualRequest.getQueryParams()); + Assert.assertEquals(request.getQueryInput(), actualRequest.getQueryInput()); + Assert.assertEquals(request.getOutputAudioConfig(), actualRequest.getOutputAudioConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -150,38 +122,43 @@ public void detectIntentTest() { } @Test - @SuppressWarnings("all") public void detectIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); try { - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); DetectIntentRequest request = DetectIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); - client.detectIntent(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void streamingDetectIntentTest() throws Exception { StreamingDetectIntentResponse expectedResponse = StreamingDetectIntentResponse.newBuilder().build(); mockSessions.addResponse(expectedResponse); - QueryInput queryInput = QueryInput.newBuilder().build(); StreamingDetectIntentRequest request = - StreamingDetectIntentRequest.newBuilder().setQueryInput(queryInput).build(); + StreamingDetectIntentRequest.newBuilder() + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -199,13 +176,19 @@ public void streamingDetectIntentTest() throws Exception { } @Test - @SuppressWarnings("all") public void streamingDetectIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); - QueryInput queryInput = QueryInput.newBuilder().build(); StreamingDetectIntentRequest request = - StreamingDetectIntentRequest.newBuilder().setQueryInput(queryInput).build(); + StreamingDetectIntentRequest.newBuilder() + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); MockStreamObserver responseObserver = new MockStreamObserver<>(); @@ -221,26 +204,28 @@ public void streamingDetectIntentExceptionTest() throws Exception { Assert.fail("No exception thrown"); } catch (ExecutionException e) { Assert.assertTrue(e.getCause() instanceof InvalidArgumentException); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void matchIntentTest() { - String text = "text3556653"; - MatchIntentResponse expectedResponse = MatchIntentResponse.newBuilder().setText(text).build(); + public void matchIntentTest() throws Exception { + MatchIntentResponse expectedResponse = + MatchIntentResponse.newBuilder() + .addAllMatches(new ArrayList()) + .setCurrentPage(Page.newBuilder().build()) + .build(); mockSessions.addResponse(expectedResponse); - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); MatchIntentRequest request = MatchIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) .build(); MatchIntentResponse actualResponse = client.matchIntent(request); @@ -248,10 +233,11 @@ public void matchIntentTest() { List actualRequests = mockSessions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - MatchIntentRequest actualRequest = (MatchIntentRequest) actualRequests.get(0); + MatchIntentRequest actualRequest = ((MatchIntentRequest) actualRequests.get(0)); - Assert.assertEquals(session, SessionName.parse(actualRequest.getSession())); - Assert.assertEquals(queryInput, actualRequest.getQueryInput()); + Assert.assertEquals(request.getSession(), actualRequest.getSession()); + Assert.assertEquals(request.getQueryParams(), actualRequest.getQueryParams()); + Assert.assertEquals(request.getQueryInput(), actualRequest.getQueryInput()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -259,50 +245,55 @@ public void matchIntentTest() { } @Test - @SuppressWarnings("all") public void matchIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); try { - SessionName session = - SessionName.ofProjectLocationAgentSessionName( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]"); - QueryInput queryInput = QueryInput.newBuilder().build(); MatchIntentRequest request = MatchIntentRequest.newBuilder() - .setSession(session.toString()) - .setQueryInput(queryInput) + .setSession( + SessionName.ofProjectLocationAgentSessionName( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + .toString()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setQueryInput(QueryInput.newBuilder().build()) .build(); - client.matchIntent(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void fulfillIntentTest() { - String responseId = "responseId1847552473"; - ByteString outputAudio = ByteString.copyFromUtf8("24"); + public void fulfillIntentTest() throws Exception { FulfillIntentResponse expectedResponse = FulfillIntentResponse.newBuilder() - .setResponseId(responseId) - .setOutputAudio(outputAudio) + .setResponseId("response_id1847552473") + .setQueryResult(QueryResult.newBuilder().build()) + .setOutputAudio(ByteString.EMPTY) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) .build(); mockSessions.addResponse(expectedResponse); - FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build(); + FulfillIntentRequest request = + FulfillIntentRequest.newBuilder() + .setMatchIntentRequest(MatchIntentRequest.newBuilder().build()) + .setMatch(Match.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); FulfillIntentResponse actualResponse = client.fulfillIntent(request); Assert.assertEquals(expectedResponse, actualResponse); List actualRequests = mockSessions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - FulfillIntentRequest actualRequest = (FulfillIntentRequest) actualRequests.get(0); + FulfillIntentRequest actualRequest = ((FulfillIntentRequest) actualRequests.get(0)); + Assert.assertEquals(request.getMatchIntentRequest(), actualRequest.getMatchIntentRequest()); + Assert.assertEquals(request.getMatch(), actualRequest.getMatch()); + Assert.assertEquals(request.getOutputAudioConfig(), actualRequest.getOutputAudioConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -310,18 +301,21 @@ public void fulfillIntentTest() { } @Test - @SuppressWarnings("all") public void fulfillIntentExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockSessions.addException(exception); try { - FulfillIntentRequest request = FulfillIntentRequest.newBuilder().build(); - + FulfillIntentRequest request = + FulfillIntentRequest.newBuilder() + .setMatchIntentRequest(MatchIntentRequest.newBuilder().build()) + .setMatch(Match.newBuilder().build()) + .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + .build(); client.fulfillIntent(request); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java index ae3224fde..3ea5aae66 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse; @@ -28,12 +29,13 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,63 +43,32 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class TransitionRouteGroupsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private TransitionRouteGroupsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + Arrays.asList(mockTransitionRouteGroups)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); TransitionRouteGroupsSettings settings = TransitionRouteGroupsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -112,15 +83,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listTransitionRouteGroupsTest() { - String nextPageToken = ""; - TransitionRouteGroup transitionRouteGroupsElement = TransitionRouteGroup.newBuilder().build(); - List transitionRouteGroups = Arrays.asList(transitionRouteGroupsElement); + public void listTransitionRouteGroupsTest() throws Exception { + TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build(); ListTransitionRouteGroupsResponse expectedResponse = ListTransitionRouteGroupsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllTransitionRouteGroups(transitionRouteGroups) + .setNextPageToken("") + .addAllTransitionRouteGroups(Arrays.asList(responsesElement)) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -130,15 +98,16 @@ public void listTransitionRouteGroupsTest() { client.listTransitionRouteGroups(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0)); List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); ListTransitionRouteGroupsRequest actualRequest = - (ListTransitionRouteGroupsRequest) actualRequests.get(0); + ((ListTransitionRouteGroupsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -146,32 +115,75 @@ public void listTransitionRouteGroupsTest() { } @Test - @SuppressWarnings("all") public void listTransitionRouteGroupsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.listTransitionRouteGroups(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listTransitionRouteGroupsTest2() throws Exception { + TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build(); + ListTransitionRouteGroupsResponse expectedResponse = + ListTransitionRouteGroupsResponse.newBuilder() + .setNextPageToken("") + .addAllTransitionRouteGroups(Arrays.asList(responsesElement)) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListTransitionRouteGroupsPagedResponse pagedListResponse = + client.listTransitionRouteGroups(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0)); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListTransitionRouteGroupsRequest actualRequest = + ((ListTransitionRouteGroupsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listTransitionRouteGroupsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + String parent = "parent-995424086"; client.listTransitionRouteGroups(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getTransitionRouteGroupTest() { - TransitionRouteGroupName name2 = - TransitionRouteGroupName.of( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); - String displayName = "displayName1615086568"; + public void getTransitionRouteGroupTest() throws Exception { TransitionRouteGroup expectedResponse = TransitionRouteGroup.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -185,9 +197,9 @@ public void getTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); GetTransitionRouteGroupRequest actualRequest = - (GetTransitionRouteGroupRequest) actualRequests.get(0); + ((GetTransitionRouteGroupRequest) actualRequests.get(0)); - Assert.assertEquals(name, TransitionRouteGroupName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -195,34 +207,75 @@ public void getTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void getTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { TransitionRouteGroupName name = TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + client.getTransitionRouteGroup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getTransitionRouteGroupTest2() throws Exception { + TransitionRouteGroup expectedResponse = + TransitionRouteGroup.newBuilder() + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String name = "name3373707"; + + TransitionRouteGroup actualResponse = client.getTransitionRouteGroup(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetTransitionRouteGroupRequest actualRequest = + ((GetTransitionRouteGroupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getTransitionRouteGroupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + String name = "name3373707"; client.getTransitionRouteGroup(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createTransitionRouteGroupTest() { - TransitionRouteGroupName name = - TransitionRouteGroupName.of( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); - String displayName = "displayName1615086568"; + public void createTransitionRouteGroupTest() throws Exception { TransitionRouteGroup expectedResponse = TransitionRouteGroup.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -236,9 +289,9 @@ public void createTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateTransitionRouteGroupRequest actualRequest = - (CreateTransitionRouteGroupRequest) actualRequests.get(0); + ((CreateTransitionRouteGroupRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -247,33 +300,78 @@ public void createTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void createTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + client.createTransitionRouteGroup(parent, transitionRouteGroup); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createTransitionRouteGroupTest2() throws Exception { + TransitionRouteGroup expectedResponse = + TransitionRouteGroup.newBuilder() + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) + .build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String parent = "parent-995424086"; + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); + + TransitionRouteGroup actualResponse = + client.createTransitionRouteGroup(parent, transitionRouteGroup); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateTransitionRouteGroupRequest actualRequest = + ((CreateTransitionRouteGroupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createTransitionRouteGroupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + try { + String parent = "parent-995424086"; + TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); client.createTransitionRouteGroup(parent, transitionRouteGroup); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateTransitionRouteGroupTest() { - TransitionRouteGroupName name = - TransitionRouteGroupName.of( - "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); - String displayName = "displayName1615086568"; + public void updateTransitionRouteGroupTest() throws Exception { TransitionRouteGroup expectedResponse = TransitionRouteGroup.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) + .setName( + TransitionRouteGroupName.of( + "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") + .toString()) + .setDisplayName("display_name1615086568") + .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -287,7 +385,7 @@ public void updateTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateTransitionRouteGroupRequest actualRequest = - (UpdateTransitionRouteGroupRequest) actualRequests.get(0); + ((UpdateTransitionRouteGroupRequest) actualRequests.get(0)); Assert.assertEquals(transitionRouteGroup, actualRequest.getTransitionRouteGroup()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -298,25 +396,22 @@ public void updateTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void updateTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateTransitionRouteGroup(transitionRouteGroup, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteTransitionRouteGroupTest() { + public void deleteTransitionRouteGroupTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -329,9 +424,9 @@ public void deleteTransitionRouteGroupTest() { List actualRequests = mockTransitionRouteGroups.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteTransitionRouteGroupRequest actualRequest = - (DeleteTransitionRouteGroupRequest) actualRequests.get(0); + ((DeleteTransitionRouteGroupRequest) actualRequests.get(0)); - Assert.assertEquals(name, TransitionRouteGroupName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -339,20 +434,53 @@ public void deleteTransitionRouteGroupTest() { } @Test - @SuppressWarnings("all") public void deleteTransitionRouteGroupExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockTransitionRouteGroups.addException(exception); try { TransitionRouteGroupName name = TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]"); + client.deleteTransitionRouteGroup(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteTransitionRouteGroupTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockTransitionRouteGroups.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteTransitionRouteGroup(name); + + List actualRequests = mockTransitionRouteGroups.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteTransitionRouteGroupRequest actualRequest = + ((DeleteTransitionRouteGroupRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteTransitionRouteGroupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockTransitionRouteGroups.addException(exception); + + try { + String name = "name3373707"; client.deleteTransitionRouteGroup(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java index 46f74f9cc..b9722943d 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.VersionsClient.ListVersionsPagedResponse; @@ -31,13 +32,14 @@ import com.google.protobuf.Any; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; +import com.google.protobuf.Timestamp; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -45,63 +47,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class VersionsClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; private static MockVersions mockVersions; - private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private VersionsClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); mockVersions = new MockVersions(); - mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockVersions)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); VersionsSettings settings = VersionsSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -116,15 +86,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listVersionsTest() { - String nextPageToken = ""; - Version versionsElement = Version.newBuilder().build(); - List versions = Arrays.asList(versionsElement); + public void listVersionsTest() throws Exception { + Version responsesElement = Version.newBuilder().build(); ListVersionsResponse expectedResponse = ListVersionsResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllVersions(versions) + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) .build(); mockVersions.addResponse(expectedResponse); @@ -133,14 +100,15 @@ public void listVersionsTest() { ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListVersionsRequest actualRequest = (ListVersionsRequest) actualRequests.get(0); + ListVersionsRequest actualRequest = ((ListVersionsRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -148,32 +116,74 @@ public void listVersionsTest() { } @Test - @SuppressWarnings("all") public void listVersionsExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); + client.listVersions(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVersionsTest2() throws Exception { + Version responsesElement = Version.newBuilder().build(); + ListVersionsResponse expectedResponse = + ListVersionsResponse.newBuilder() + .setNextPageToken("") + .addAllVersions(Arrays.asList(responsesElement)) + .build(); + mockVersions.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListVersionsPagedResponse pagedListResponse = client.listVersions(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVersionsList().get(0), resources.get(0)); + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListVersionsRequest actualRequest = ((ListVersionsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listVersionsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String parent = "parent-995424086"; client.listVersions(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getVersionTest() { - VersionName name2 = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void getVersionTest() throws Exception { Version expectedResponse = Version.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) .build(); mockVersions.addResponse(expectedResponse); @@ -184,9 +194,9 @@ public void getVersionTest() { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetVersionRequest actualRequest = (GetVersionRequest) actualRequests.get(0); + GetVersionRequest actualRequest = ((GetVersionRequest) actualRequests.get(0)); - Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -194,33 +204,75 @@ public void getVersionTest() { } @Test - @SuppressWarnings("all") public void getVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + client.getVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test + public void getVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + mockVersions.addResponse(expectedResponse); + + String name = "name3373707"; + + Version actualResponse = client.getVersion(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVersionRequest actualRequest = ((GetVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String name = "name3373707"; client.getVersion(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void createVersionTest() throws Exception { - VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; Version expectedResponse = Version.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -238,9 +290,9 @@ public void createVersionTest() throws Exception { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateVersionRequest actualRequest = (CreateVersionRequest) actualRequests.get(0); + CreateVersionRequest actualRequest = ((CreateVersionRequest) actualRequests.get(0)); - Assert.assertEquals(parent, FlowName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(version, actualRequest.getVersion()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -249,35 +301,88 @@ public void createVersionTest() throws Exception { } @Test - @SuppressWarnings("all") public void createVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]"); Version version = Version.newBuilder().build(); + client.createVersionAsync(parent, version).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void createVersionTest2() throws Exception { + Version expectedResponse = + Version.newBuilder() + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockVersions.addResponse(resultOperation); + + String parent = "parent-995424086"; + Version version = Version.newBuilder().build(); + + Version actualResponse = client.createVersionAsync(parent, version).get(); + Assert.assertEquals(expectedResponse, actualResponse); + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateVersionRequest actualRequest = ((CreateVersionRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(version, actualRequest.getVersion()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String parent = "parent-995424086"; + Version version = Version.newBuilder().build(); client.createVersionAsync(parent, version).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } @Test - @SuppressWarnings("all") - public void updateVersionTest() { - VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - String displayName = "displayName1615086568"; - String description = "description-1724546052"; + public void updateVersionTest() throws Exception { Version expectedResponse = Version.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDescription(description) + .setName( + VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") + .toString()) + .setDisplayName("display_name1615086568") + .setDescription("description-1724546052") + .setNluSettings(NluSettings.newBuilder().build()) + .setCreateTime(Timestamp.newBuilder().build()) .build(); mockVersions.addResponse(expectedResponse); @@ -289,7 +394,7 @@ public void updateVersionTest() { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateVersionRequest actualRequest = (UpdateVersionRequest) actualRequests.get(0); + UpdateVersionRequest actualRequest = ((UpdateVersionRequest) actualRequests.get(0)); Assert.assertEquals(version, actualRequest.getVersion()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -300,25 +405,22 @@ public void updateVersionTest() { } @Test - @SuppressWarnings("all") public void updateVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { Version version = Version.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateVersion(version, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteVersionTest() { + public void deleteVersionTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockVersions.addResponse(expectedResponse); @@ -328,9 +430,9 @@ public void deleteVersionTest() { List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteVersionRequest actualRequest = (DeleteVersionRequest) actualRequests.get(0); + DeleteVersionRequest actualRequest = ((DeleteVersionRequest) actualRequests.get(0)); - Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -338,24 +440,55 @@ public void deleteVersionTest() { } @Test - @SuppressWarnings("all") public void deleteVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + client.deleteVersion(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockVersions.addResponse(expectedResponse); + + String name = "name3373707"; + + client.deleteVersion(name); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteVersionRequest actualRequest = ((DeleteVersionRequest) actualRequests.get(0)); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String name = "name3373707"; client.deleteVersion(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") public void loadVersionTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); Operation resultOperation = @@ -368,14 +501,13 @@ public void loadVersionTest() throws Exception { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); - Empty actualResponse = client.loadVersionAsync(name).get(); - Assert.assertEquals(expectedResponse, actualResponse); + client.loadVersionAsync(name).get(); List actualRequests = mockVersions.getRequests(); Assert.assertEquals(1, actualRequests.size()); - LoadVersionRequest actualRequest = (LoadVersionRequest) actualRequests.get(0); + LoadVersionRequest actualRequest = ((LoadVersionRequest) actualRequests.get(0)); - Assert.assertEquals(name, VersionName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -383,20 +515,60 @@ public void loadVersionTest() throws Exception { } @Test - @SuppressWarnings("all") public void loadVersionExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockVersions.addException(exception); try { VersionName name = VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]"); + client.loadVersionAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } + + @Test + public void loadVersionTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("loadVersionTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockVersions.addResponse(resultOperation); + + String name = "name3373707"; + + client.loadVersionAsync(name).get(); + + List actualRequests = mockVersions.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LoadVersionRequest actualRequest = ((LoadVersionRequest) actualRequests.get(0)); + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void loadVersionExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockVersions.addException(exception); + + try { + String name = "name3373707"; client.loadVersionAsync(name).get(); Assert.fail("No exception raised"); } catch (ExecutionException e) { Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); - InvalidArgumentException apiException = (InvalidArgumentException) e.getCause(); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); } } diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java index 23110d933..783f4f859 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.google.cloud.dialogflow.cx.v3beta1; import static com.google.cloud.dialogflow.cx.v3beta1.WebhooksClient.ListWebhooksPagedResponse; @@ -26,14 +27,15 @@ import com.google.api.gax.rpc.InvalidArgumentException; import com.google.common.collect.Lists; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Duration; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; -import io.grpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.UUID; +import javax.annotation.Generated; import org.junit.After; import org.junit.AfterClass; import org.junit.Assert; @@ -41,63 +43,31 @@ import org.junit.BeforeClass; import org.junit.Test; -@javax.annotation.Generated("by GAPIC") +@Generated("by gapic-generator-java") public class WebhooksClientTest { - private static MockPages mockPages; - private static MockFlows mockFlows; - private static MockAgents mockAgents; - private static MockEntityTypes mockEntityTypes; - private static MockEnvironments mockEnvironments; - private static MockIntents mockIntents; - private static MockSessionEntityTypes mockSessionEntityTypes; - private static MockSessions mockSessions; - private static MockTransitionRouteGroups mockTransitionRouteGroups; - private static MockVersions mockVersions; private static MockWebhooks mockWebhooks; - private static MockServiceHelper serviceHelper; + private static MockServiceHelper mockServiceHelper; private WebhooksClient client; private LocalChannelProvider channelProvider; @BeforeClass public static void startStaticServer() { - mockPages = new MockPages(); - mockFlows = new MockFlows(); - mockAgents = new MockAgents(); - mockEntityTypes = new MockEntityTypes(); - mockEnvironments = new MockEnvironments(); - mockIntents = new MockIntents(); - mockSessionEntityTypes = new MockSessionEntityTypes(); - mockSessions = new MockSessions(); - mockTransitionRouteGroups = new MockTransitionRouteGroups(); - mockVersions = new MockVersions(); mockWebhooks = new MockWebhooks(); - serviceHelper = + mockServiceHelper = new MockServiceHelper( - UUID.randomUUID().toString(), - Arrays.asList( - mockPages, - mockFlows, - mockAgents, - mockEntityTypes, - mockEnvironments, - mockIntents, - mockSessionEntityTypes, - mockSessions, - mockTransitionRouteGroups, - mockVersions, - mockWebhooks)); - serviceHelper.start(); + UUID.randomUUID().toString(), Arrays.asList(mockWebhooks)); + mockServiceHelper.start(); } @AfterClass public static void stopServer() { - serviceHelper.stop(); + mockServiceHelper.stop(); } @Before public void setUp() throws IOException { - serviceHelper.reset(); - channelProvider = serviceHelper.createChannelProvider(); + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); WebhooksSettings settings = WebhooksSettings.newBuilder() .setTransportChannelProvider(channelProvider) @@ -112,15 +82,12 @@ public void tearDown() throws Exception { } @Test - @SuppressWarnings("all") - public void listWebhooksTest() { - String nextPageToken = ""; - Webhook webhooksElement = Webhook.newBuilder().build(); - List webhooks = Arrays.asList(webhooksElement); + public void listWebhooksTest() throws Exception { + Webhook responsesElement = Webhook.newBuilder().build(); ListWebhooksResponse expectedResponse = ListWebhooksResponse.newBuilder() - .setNextPageToken(nextPageToken) - .addAllWebhooks(webhooks) + .setNextPageToken("") + .addAllWebhooks(Arrays.asList(responsesElement)) .build(); mockWebhooks.addResponse(expectedResponse); @@ -129,14 +96,15 @@ public void listWebhooksTest() { ListWebhooksPagedResponse pagedListResponse = client.listWebhooks(parent); List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); Assert.assertEquals(expectedResponse.getWebhooksList().get(0), resources.get(0)); List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - ListWebhooksRequest actualRequest = (ListWebhooksRequest) actualRequests.get(0); + ListWebhooksRequest actualRequest = ((ListWebhooksRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -144,32 +112,71 @@ public void listWebhooksTest() { } @Test - @SuppressWarnings("all") public void listWebhooksExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + client.listWebhooks(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listWebhooksTest2() throws Exception { + Webhook responsesElement = Webhook.newBuilder().build(); + ListWebhooksResponse expectedResponse = + ListWebhooksResponse.newBuilder() + .setNextPageToken("") + .addAllWebhooks(Arrays.asList(responsesElement)) + .build(); + mockWebhooks.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListWebhooksPagedResponse pagedListResponse = client.listWebhooks(parent); + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getWebhooksList().get(0), resources.get(0)); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListWebhooksRequest actualRequest = ((ListWebhooksRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listWebhooksExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + String parent = "parent-995424086"; client.listWebhooks(parent); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void getWebhookTest() { - WebhookName name2 = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); - String displayName = "displayName1615086568"; - boolean disabled = true; + public void getWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() - .setName(name2.toString()) - .setDisplayName(displayName) - .setDisabled(disabled) + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) .build(); mockWebhooks.addResponse(expectedResponse); @@ -180,9 +187,9 @@ public void getWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - GetWebhookRequest actualRequest = (GetWebhookRequest) actualRequests.get(0); + GetWebhookRequest actualRequest = ((GetWebhookRequest) actualRequests.get(0)); - Assert.assertEquals(name, WebhookName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -190,32 +197,68 @@ public void getWebhookTest() { } @Test - @SuppressWarnings("all") public void getWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + client.getWebhook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getWebhookTest2() throws Exception { + Webhook expectedResponse = + Webhook.newBuilder() + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) + .build(); + mockWebhooks.addResponse(expectedResponse); + + String name = "name3373707"; + + Webhook actualResponse = client.getWebhook(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetWebhookRequest actualRequest = ((GetWebhookRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getWebhookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + try { + String name = "name3373707"; client.getWebhook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void createWebhookTest() { - WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); - String displayName = "displayName1615086568"; - boolean disabled = true; + public void createWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDisabled(disabled) + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) .build(); mockWebhooks.addResponse(expectedResponse); @@ -227,9 +270,9 @@ public void createWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - CreateWebhookRequest actualRequest = (CreateWebhookRequest) actualRequests.get(0); + CreateWebhookRequest actualRequest = ((CreateWebhookRequest) actualRequests.get(0)); - Assert.assertEquals(parent, AgentName.parse(actualRequest.getParent())); + Assert.assertEquals(parent.toString(), actualRequest.getParent()); Assert.assertEquals(webhook, actualRequest.getWebhook()); Assert.assertTrue( channelProvider.isHeaderSent( @@ -238,33 +281,72 @@ public void createWebhookTest() { } @Test - @SuppressWarnings("all") public void createWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); Webhook webhook = Webhook.newBuilder().build(); + client.createWebhook(parent, webhook); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createWebhookTest2() throws Exception { + Webhook expectedResponse = + Webhook.newBuilder() + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) + .build(); + mockWebhooks.addResponse(expectedResponse); + + String parent = "parent-995424086"; + Webhook webhook = Webhook.newBuilder().build(); + + Webhook actualResponse = client.createWebhook(parent, webhook); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateWebhookRequest actualRequest = ((CreateWebhookRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(webhook, actualRequest.getWebhook()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createWebhookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + try { + String parent = "parent-995424086"; + Webhook webhook = Webhook.newBuilder().build(); client.createWebhook(parent, webhook); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void updateWebhookTest() { - WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); - String displayName = "displayName1615086568"; - boolean disabled = true; + public void updateWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() - .setName(name.toString()) - .setDisplayName(displayName) - .setDisabled(disabled) + .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) + .setDisplayName("display_name1615086568") + .setTimeout(Duration.newBuilder().build()) + .setDisabled(true) .build(); mockWebhooks.addResponse(expectedResponse); @@ -276,7 +358,7 @@ public void updateWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - UpdateWebhookRequest actualRequest = (UpdateWebhookRequest) actualRequests.get(0); + UpdateWebhookRequest actualRequest = ((UpdateWebhookRequest) actualRequests.get(0)); Assert.assertEquals(webhook, actualRequest.getWebhook()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); @@ -287,25 +369,22 @@ public void updateWebhookTest() { } @Test - @SuppressWarnings("all") public void updateWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { Webhook webhook = Webhook.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); - client.updateWebhook(webhook, updateMask); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } @Test - @SuppressWarnings("all") - public void deleteWebhookTest() { + public void deleteWebhookTest() throws Exception { Empty expectedResponse = Empty.newBuilder().build(); mockWebhooks.addResponse(expectedResponse); @@ -315,9 +394,9 @@ public void deleteWebhookTest() { List actualRequests = mockWebhooks.getRequests(); Assert.assertEquals(1, actualRequests.size()); - DeleteWebhookRequest actualRequest = (DeleteWebhookRequest) actualRequests.get(0); + DeleteWebhookRequest actualRequest = ((DeleteWebhookRequest) actualRequests.get(0)); - Assert.assertEquals(name, WebhookName.parse(actualRequest.getName())); + Assert.assertEquals(name.toString(), actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -325,18 +404,50 @@ public void deleteWebhookTest() { } @Test - @SuppressWarnings("all") public void deleteWebhookExceptionTest() throws Exception { - StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); mockWebhooks.addException(exception); try { WebhookName name = WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]"); + client.deleteWebhook(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void deleteWebhookTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + mockWebhooks.addResponse(expectedResponse); + + String name = "name3373707"; + client.deleteWebhook(name); + + List actualRequests = mockWebhooks.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteWebhookRequest actualRequest = ((DeleteWebhookRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void deleteWebhookExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockWebhooks.addException(exception); + + try { + String name = "name3373707"; client.deleteWebhook(name); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { - // Expected exception + // Expected exception. } } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java index 14d26b7ea..faccab986 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,21 +23,33 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class AgentName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; + @Deprecated + protected AgentName() { + project = null; + location = null; + agent = null; + } + + private AgentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + } + public String getProject() { return project; } @@ -58,12 +70,6 @@ public Builder toBuilder() { return new Builder(this); } - private AgentName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - } - public static AgentName of(String project, String location, String agent) { return newBuilder().setProject(project).setLocation(location).setAgent(agent).build(); } @@ -82,7 +88,7 @@ public static AgentName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT.validatedMatch( formattedString, "AgentName.parse: formattedString not in valid format"); return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("agent")); } @@ -96,9 +102,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (AgentName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -108,17 +114,24 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -132,16 +145,44 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "location", location, "agent", agent); + return PROJECT_LOCATION_AGENT.instantiate( + "project", project, "location", location, "agent", agent); } - /** Builder for AgentName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AgentName that = ((AgentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}. */ + public static class Builder { private String project; private String location; private String agent; + protected Builder() {} + public String getProject() { return project; } @@ -169,8 +210,6 @@ public Builder setAgent(String agent) { return this; } - private Builder() {} - private Builder(AgentName agentName) { project = agentName.project; location = agentName.location; @@ -181,30 +220,4 @@ public AgentName build() { return new AgentName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof AgentName) { - AgentName that = (AgentName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java index d332c07c3..590e75c6d 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class EntityTypeName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_ENTITY_TYPE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String entityType; + @Deprecated + protected EntityTypeName() { + project = null; + location = null; + agent = null; + entityType = null; + } + + private EntityTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private EntityTypeName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - entityType = Preconditions.checkNotNull(builder.getEntityType()); - } - public static EntityTypeName of( String project, String location, String agent, String entityType) { return newBuilder() @@ -95,7 +102,7 @@ public static EntityTypeName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_ENTITY_TYPE.validatedMatch( formattedString, "EntityTypeName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -113,9 +120,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (EntityTypeName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -125,18 +132,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_ENTITY_TYPE.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("entityType", entityType); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(entityType)) { + fieldMapBuilder.put("entity_type", entityType); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -150,18 +166,50 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_ENTITY_TYPE.instantiate( "project", project, "location", location, "agent", agent, "entity_type", entityType); } - /** Builder for EntityTypeName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + EntityTypeName that = ((EntityTypeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.entityType, that.entityType); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(entityType); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}. + */ + public static class Builder { private String project; private String location; private String agent; private String entityType; + protected Builder() {} + public String getProject() { return project; } @@ -198,8 +246,6 @@ public Builder setEntityType(String entityType) { return this; } - private Builder() {} - private Builder(EntityTypeName entityTypeName) { project = entityTypeName.project; location = entityTypeName.location; @@ -211,33 +257,4 @@ public EntityTypeName build() { return new EntityTypeName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof EntityTypeName) { - EntityTypeName that = (EntityTypeName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.entityType.equals(that.entityType)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= entityType.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java index 69c1a1956..29c9e0271 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class EnvironmentName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String environment; + @Deprecated + protected EnvironmentName() { + project = null; + location = null; + agent = null; + environment = null; + } + + private EnvironmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private EnvironmentName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - environment = Preconditions.checkNotNull(builder.getEnvironment()); - } - public static EnvironmentName of( String project, String location, String agent, String environment) { return newBuilder() @@ -95,7 +102,7 @@ public static EnvironmentName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_ENVIRONMENT.validatedMatch( formattedString, "EnvironmentName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -113,9 +120,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (EnvironmentName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -125,18 +132,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_ENVIRONMENT.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("environment", environment); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(environment)) { + fieldMapBuilder.put("environment", environment); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -150,18 +166,50 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_ENVIRONMENT.instantiate( "project", project, "location", location, "agent", agent, "environment", environment); } - /** Builder for EnvironmentName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + EnvironmentName that = ((EnvironmentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.environment, that.environment); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/agents/{agent}/environments/{environment}. + */ + public static class Builder { private String project; private String location; private String agent; private String environment; + protected Builder() {} + public String getProject() { return project; } @@ -198,8 +246,6 @@ public Builder setEnvironment(String environment) { return this; } - private Builder() {} - private Builder(EnvironmentName environmentName) { project = environmentName.project; location = environmentName.location; @@ -211,33 +257,4 @@ public EnvironmentName build() { return new EnvironmentName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof EnvironmentName) { - EnvironmentName that = (EnvironmentName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.environment.equals(that.environment)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= environment.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java index ef86b686a..2b8de6862 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class FlowName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; + @Deprecated + protected FlowName() { + project = null; + location = null; + agent = null; + flow = null; + } + + private FlowName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private FlowName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - } - public static FlowName of(String project, String location, String agent, String flow) { return newBuilder() .setProject(project) @@ -94,7 +101,7 @@ public static FlowName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW.validatedMatch( formattedString, "FlowName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -112,9 +119,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (FlowName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -124,18 +131,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -149,18 +165,48 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW.instantiate( "project", project, "location", location, "agent", agent, "flow", flow); } - /** Builder for FlowName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + FlowName that = ((FlowName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}/flows/{flow}. */ + public static class Builder { private String project; private String location; private String agent; private String flow; + protected Builder() {} + public String getProject() { return project; } @@ -197,8 +243,6 @@ public Builder setFlow(String flow) { return this; } - private Builder() {} - private Builder(FlowName flowName) { project = flowName.project; location = flowName.location; @@ -210,33 +254,4 @@ public FlowName build() { return new FlowName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof FlowName) { - FlowName that = (FlowName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java index e2bf942de..66a29b866 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class IntentName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_INTENT = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String intent; + @Deprecated + protected IntentName() { + project = null; + location = null; + agent = null; + intent = null; + } + + private IntentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + intent = Preconditions.checkNotNull(builder.getIntent()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private IntentName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - intent = Preconditions.checkNotNull(builder.getIntent()); - } - public static IntentName of(String project, String location, String agent, String intent) { return newBuilder() .setProject(project) @@ -94,7 +101,7 @@ public static IntentName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_INTENT.validatedMatch( formattedString, "IntentName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -112,9 +119,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (IntentName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -124,18 +131,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_INTENT.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("intent", intent); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(intent)) { + fieldMapBuilder.put("intent", intent); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -149,18 +165,48 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_INTENT.instantiate( "project", project, "location", location, "agent", agent, "intent", intent); } - /** Builder for IntentName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + IntentName that = ((IntentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.intent, that.intent); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(intent); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}/intents/{intent}. */ + public static class Builder { private String project; private String location; private String agent; private String intent; + protected Builder() {} + public String getProject() { return project; } @@ -197,8 +243,6 @@ public Builder setIntent(String intent) { return this; } - private Builder() {} - private Builder(IntentName intentName) { project = intentName.project; location = intentName.location; @@ -210,33 +254,4 @@ public IntentName build() { return new IntentName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof IntentName) { - IntentName that = (IntentName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.intent.equals(that.intent)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= intent.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java index 04f928dcb..89cacf8ce 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,19 +23,29 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class LocationName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION = PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + public String getProject() { return project; } @@ -52,11 +62,6 @@ public Builder toBuilder() { return new Builder(this); } - private LocationName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - } - public static LocationName of(String project, String location) { return newBuilder().setProject(project).setLocation(location).build(); } @@ -70,7 +75,7 @@ public static LocationName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION.validatedMatch( formattedString, "LocationName.parse: formattedString not in valid format"); return of(matchMap.get("project"), matchMap.get("location")); } @@ -84,9 +89,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (LocationName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -96,16 +101,21 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -119,15 +129,39 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "location", location); + return PROJECT_LOCATION.instantiate("project", project, "location", location); } - /** Builder for LocationName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { private String project; private String location; + protected Builder() {} + public String getProject() { return project; } @@ -146,8 +180,6 @@ public Builder setLocation(String location) { return this; } - private Builder() {} - private Builder(LocationName locationName) { project = locationName.project; location = locationName.location; @@ -157,26 +189,4 @@ public LocationName build() { return new LocationName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof LocationName) { - LocationName that = (LocationName) o; - return (this.project.equals(that.project)) && (this.location.equals(that.location)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java index 21b182be3..5f9be81e5 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,23 +23,39 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class PageName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW_PAGE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; private final String page; + @Deprecated + protected PageName() { + project = null; + location = null; + agent = null; + flow = null; + page = null; + } + + private PageName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + page = Preconditions.checkNotNull(builder.getPage()); + } + public String getProject() { return project; } @@ -68,14 +84,6 @@ public Builder toBuilder() { return new Builder(this); } - private PageName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - page = Preconditions.checkNotNull(builder.getPage()); - } - public static PageName of( String project, String location, String agent, String flow, String page) { return newBuilder() @@ -104,7 +112,7 @@ public static PageName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW_PAGE.validatedMatch( formattedString, "PageName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -123,9 +131,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (PageName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -135,19 +143,30 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW_PAGE.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); - fieldMapBuilder.put("page", page); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } + if (!Objects.isNull(page)) { + fieldMapBuilder.put("page", page); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -161,19 +180,54 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW_PAGE.instantiate( "project", project, "location", location, "agent", agent, "flow", flow, "page", page); } - /** Builder for PageName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + PageName that = ((PageName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow) + && Objects.equals(this.page, that.page); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + h *= 1000003; + h ^= Objects.hashCode(page); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}. + */ + public static class Builder { private String project; private String location; private String agent; private String flow; private String page; + protected Builder() {} + public String getProject() { return project; } @@ -219,8 +273,6 @@ public Builder setPage(String page) { return this; } - private Builder() {} - private Builder(PageName pageName) { project = pageName.project; location = pageName.location; @@ -233,36 +285,4 @@ public PageName build() { return new PageName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof PageName) { - PageName that = (PageName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)) - && (this.page.equals(that.page)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - h *= 1000003; - h ^= page.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java index 9303a6eaa..b24a8ff36 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,21 +23,33 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class SecuritySettingsName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_SECURITY_SETTINGS = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/securitySettings/{security_settings}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String securitySettings; + @Deprecated + protected SecuritySettingsName() { + project = null; + location = null; + securitySettings = null; + } + + private SecuritySettingsName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + securitySettings = Preconditions.checkNotNull(builder.getSecuritySettings()); + } + public String getProject() { return project; } @@ -58,12 +70,6 @@ public Builder toBuilder() { return new Builder(this); } - private SecuritySettingsName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - securitySettings = Preconditions.checkNotNull(builder.getSecuritySettings()); - } - public static SecuritySettingsName of(String project, String location, String securitySettings) { return newBuilder() .setProject(project) @@ -86,7 +92,7 @@ public static SecuritySettingsName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_SECURITY_SETTINGS.validatedMatch( formattedString, "SecuritySettingsName.parse: formattedString not in valid format"); return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("security_settings")); } @@ -100,9 +106,9 @@ public static List parseList(List formattedStrings } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (SecuritySettingsName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -112,17 +118,24 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_SECURITY_SETTINGS.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("securitySettings", securitySettings); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(securitySettings)) { + fieldMapBuilder.put("security_settings", securitySettings); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -136,17 +149,44 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_SECURITY_SETTINGS.instantiate( "project", project, "location", location, "security_settings", securitySettings); } - /** Builder for SecuritySettingsName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SecuritySettingsName that = ((SecuritySettingsName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.securitySettings, that.securitySettings); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(securitySettings); + return h; + } + + /** Builder for projects/{project}/locations/{location}/securitySettings/{security_settings}. */ + public static class Builder { private String project; private String location; private String securitySettings; + protected Builder() {} + public String getProject() { return project; } @@ -174,8 +214,6 @@ public Builder setSecuritySettings(String securitySettings) { return this; } - private Builder() {} - private Builder(SecuritySettingsName securitySettingsName) { project = securitySettingsName.project; location = securitySettingsName.location; @@ -186,30 +224,4 @@ public SecuritySettingsName build() { return new SecuritySettingsName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof SecuritySettingsName) { - SecuritySettingsName that = (SecuritySettingsName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.securitySettings.equals(that.securitySettings)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= securitySettings.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java index 18dec2e6a..f9765ef7a 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,32 +26,56 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class SessionEntityTypeName implements ResourceName { - - @Deprecated - protected SessionEntityTypeName() {} - - private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}"); - private static final PathTemplate - PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}"); - + private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}"); private volatile Map fieldValuesMap; private PathTemplate pathTemplate; private String fixedValue; + private final String project; + private final String location; + private final String agent; + private final String session; + private final String entityType; + private final String environment; - private String project; - private String location; - private String agent; - private String session; - private String entityType; - private String environment; + @Deprecated + protected SessionEntityTypeName() { + project = null; + location = null; + agent = null; + session = null; + entityType = null; + environment = null; + } + + private SessionEntityTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + session = Preconditions.checkNotNull(builder.getSession()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + environment = null; + pathTemplate = PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE; + } + + private SessionEntityTypeName(ProjectLocationAgentEnvironmentSessionEntityTypeBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + session = Preconditions.checkNotNull(builder.getSession()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE; + } public String getProject() { return project; @@ -77,25 +101,6 @@ public String getEnvironment() { return environment; } - private SessionEntityTypeName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - session = Preconditions.checkNotNull(builder.getSession()); - entityType = Preconditions.checkNotNull(builder.getEntityType()); - pathTemplate = PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE; - } - - private SessionEntityTypeName(ProjectLocationAgentEnvironmentSessionEntityTypeBuilder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - environment = Preconditions.checkNotNull(builder.getEnvironment()); - session = Preconditions.checkNotNull(builder.getSession()); - entityType = Preconditions.checkNotNull(builder.getEntityType()); - pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE; - } - public static Builder newBuilder() { return new Builder(); } @@ -117,7 +122,7 @@ public Builder toBuilder() { public static SessionEntityTypeName of( String project, String location, String agent, String session, String entityType) { - return newProjectLocationAgentSessionEntityTypeBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -129,7 +134,7 @@ public static SessionEntityTypeName of( @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static SessionEntityTypeName ofProjectLocationAgentSessionEntityTypeName( String project, String location, String agent, String session, String entityType) { - return newProjectLocationAgentSessionEntityTypeBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -204,20 +209,18 @@ public static SessionEntityTypeName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - if (PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches(formattedString)) { + if (PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE.matches(formattedString)) { Map matchMap = - PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.match(formattedString); + PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE.match(formattedString); return ofProjectLocationAgentSessionEntityTypeName( matchMap.get("project"), matchMap.get("location"), matchMap.get("agent"), matchMap.get("session"), matchMap.get("entity_type")); - } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches( - formattedString)) { + } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE.matches(formattedString)) { Map matchMap = - PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.match( - formattedString); + PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE.match(formattedString); return ofProjectLocationAgentEnvironmentSessionEntityTypeName( matchMap.get("project"), matchMap.get("location"), @@ -226,7 +229,8 @@ public static SessionEntityTypeName parse(String formattedString) { matchMap.get("session"), matchMap.get("entity_type")); } - throw new ValidationException("JobName.parse: formattedString not in valid format"); + throw new ValidationException( + "SessionEntityTypeName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -240,7 +244,7 @@ public static List parseList(List formattedString public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionEntityTypeName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -250,33 +254,32 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches(formattedString) - || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches( - formattedString); + return PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE.matches(formattedString) + || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE.matches(formattedString); } @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { + if (!Objects.isNull(project)) { fieldMapBuilder.put("project", project); } - if (location != null) { + if (!Objects.isNull(location)) { fieldMapBuilder.put("location", location); } - if (agent != null) { + if (!Objects.isNull(agent)) { fieldMapBuilder.put("agent", agent); } - if (session != null) { + if (!Objects.isNull(session)) { fieldMapBuilder.put("session", session); } - if (entityType != null) { + if (!Objects.isNull(entityType)) { fieldMapBuilder.put("entity_type", entityType); } - if (environment != null) { + if (!Objects.isNull(environment)) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -292,7 +295,44 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionEntityTypeName that = ((SessionEntityTypeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.session, that.session) + && Objects.equals(this.entityType, that.entityType) + && Objects.equals(this.environment, that.environment); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(entityType); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; } /** @@ -300,7 +340,6 @@ public String toString() { * projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}. */ public static class Builder { - private String project; private String location; private String agent; @@ -356,10 +395,9 @@ public Builder setEntityType(String entityType) { private Builder(SessionEntityTypeName sessionEntityTypeName) { Preconditions.checkArgument( - sessionEntityTypeName.pathTemplate - == PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE, - "toBuilder is only supported when SessionEntityTypeName has the pattern of " - + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}."); + Objects.equals( + sessionEntityTypeName.pathTemplate, PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE), + "toBuilder is only supported when SessionEntityTypeName has the pattern of projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}"); project = sessionEntityTypeName.project; location = sessionEntityTypeName.location; agent = sessionEntityTypeName.agent; @@ -378,7 +416,6 @@ public SessionEntityTypeName build() { */ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class ProjectLocationAgentEnvironmentSessionEntityTypeBuilder { - private String project; private String location; private String agent; @@ -386,7 +423,7 @@ public static class ProjectLocationAgentEnvironmentSessionEntityTypeBuilder { private String session; private String entityType; - private ProjectLocationAgentEnvironmentSessionEntityTypeBuilder() {} + protected ProjectLocationAgentEnvironmentSessionEntityTypeBuilder() {} public String getProject() { return project; @@ -448,41 +485,4 @@ public SessionEntityTypeName build() { return new SessionEntityTypeName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SessionEntityTypeName that = (SessionEntityTypeName) o; - return (Objects.equals(this.project, that.project)) - && (Objects.equals(this.location, that.location)) - && (Objects.equals(this.agent, that.agent)) - && (Objects.equals(this.session, that.session)) - && (Objects.equals(this.entityType, that.entityType)) - && (Objects.equals(this.environment, that.environment)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(agent); - h *= 1000003; - h ^= Objects.hashCode(session); - h *= 1000003; - h ^= Objects.hashCode(entityType); - h *= 1000003; - h ^= Objects.hashCode(environment); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java index 8b50bac38..e5747929c 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,30 +26,52 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class SessionName implements ResourceName { - - @Deprecated - protected SessionName() {} - - private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}"); - private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}"); - private volatile Map fieldValuesMap; private PathTemplate pathTemplate; private String fixedValue; + private final String project; + private final String location; + private final String agent; + private final String session; + private final String environment; + + @Deprecated + protected SessionName() { + project = null; + location = null; + agent = null; + session = null; + environment = null; + } - private String project; - private String location; - private String agent; - private String session; - private String environment; + private SessionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + session = Preconditions.checkNotNull(builder.getSession()); + environment = null; + pathTemplate = PROJECT_LOCATION_AGENT_SESSION; + } + + private SessionName(ProjectLocationAgentEnvironmentSessionBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + session = Preconditions.checkNotNull(builder.getSession()); + pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION; + } public String getProject() { return project; @@ -71,23 +93,6 @@ public String getEnvironment() { return environment; } - private SessionName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - session = Preconditions.checkNotNull(builder.getSession()); - pathTemplate = PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE; - } - - private SessionName(ProjectLocationAgentEnvironmentSessionBuilder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - environment = Preconditions.checkNotNull(builder.getEnvironment()); - session = Preconditions.checkNotNull(builder.getSession()); - pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE; - } - public static Builder newBuilder() { return new Builder(); } @@ -108,7 +113,7 @@ public Builder toBuilder() { } public static SessionName of(String project, String location, String agent, String session) { - return newProjectLocationAgentSessionBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -119,7 +124,7 @@ public static SessionName of(String project, String location, String agent, Stri @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static SessionName ofProjectLocationAgentSessionName( String project, String location, String agent, String session) { - return newProjectLocationAgentSessionBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -178,17 +183,16 @@ public static SessionName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - if (PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.matches(formattedString)) { - Map matchMap = - PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.match(formattedString); + if (PROJECT_LOCATION_AGENT_SESSION.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_AGENT_SESSION.match(formattedString); return ofProjectLocationAgentSessionName( matchMap.get("project"), matchMap.get("location"), matchMap.get("agent"), matchMap.get("session")); - } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.matches(formattedString)) { + } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION.matches(formattedString)) { Map matchMap = - PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.match(formattedString); + PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION.match(formattedString); return ofProjectLocationAgentEnvironmentSessionName( matchMap.get("project"), matchMap.get("location"), @@ -196,7 +200,7 @@ public static SessionName parse(String formattedString) { matchMap.get("environment"), matchMap.get("session")); } - throw new ValidationException("JobName.parse: formattedString not in valid format"); + throw new ValidationException("SessionName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -210,7 +214,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -220,29 +224,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.matches(formattedString) - || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_SESSION.matches(formattedString) + || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION.matches(formattedString); } @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { + if (!Objects.isNull(project)) { fieldMapBuilder.put("project", project); } - if (location != null) { + if (!Objects.isNull(location)) { fieldMapBuilder.put("location", location); } - if (agent != null) { + if (!Objects.isNull(agent)) { fieldMapBuilder.put("agent", agent); } - if (session != null) { + if (!Objects.isNull(session)) { fieldMapBuilder.put("session", session); } - if (environment != null) { + if (!Objects.isNull(environment)) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -258,12 +262,45 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.session, that.session) + && Objects.equals(this.environment, that.environment); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; } /** Builder for projects/{project}/locations/{location}/agents/{agent}/sessions/{session}. */ public static class Builder { - private String project; private String location; private String agent; @@ -309,9 +346,8 @@ public Builder setSession(String session) { private Builder(SessionName sessionName) { Preconditions.checkArgument( - sessionName.pathTemplate == PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE, - "toBuilder is only supported when SessionName has the pattern of " - + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}."); + Objects.equals(sessionName.pathTemplate, PROJECT_LOCATION_AGENT_SESSION), + "toBuilder is only supported when SessionName has the pattern of projects/{project}/locations/{location}/agents/{agent}/sessions/{session}"); project = sessionName.project; location = sessionName.location; agent = sessionName.agent; @@ -329,14 +365,13 @@ public SessionName build() { */ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class ProjectLocationAgentEnvironmentSessionBuilder { - private String project; private String location; private String agent; private String environment; private String session; - private ProjectLocationAgentEnvironmentSessionBuilder() {} + protected ProjectLocationAgentEnvironmentSessionBuilder() {} public String getProject() { return project; @@ -387,38 +422,4 @@ public SessionName build() { return new SessionName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SessionName that = (SessionName) o; - return (Objects.equals(this.project, that.project)) - && (Objects.equals(this.location, that.location)) - && (Objects.equals(this.agent, that.agent)) - && (Objects.equals(this.session, that.session)) - && (Objects.equals(this.environment, that.environment)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(agent); - h *= 1000003; - h ^= Objects.hashCode(session); - h *= 1000003; - h ^= Objects.hashCode(environment); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java index bb03b136d..b410698a9 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,23 +23,39 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class TransitionRouteGroupName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; private final String transitionRouteGroup; + @Deprecated + protected TransitionRouteGroupName() { + project = null; + location = null; + agent = null; + flow = null; + transitionRouteGroup = null; + } + + private TransitionRouteGroupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + transitionRouteGroup = Preconditions.checkNotNull(builder.getTransitionRouteGroup()); + } + public String getProject() { return project; } @@ -68,14 +84,6 @@ public Builder toBuilder() { return new Builder(this); } - private TransitionRouteGroupName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - transitionRouteGroup = Preconditions.checkNotNull(builder.getTransitionRouteGroup()); - } - public static TransitionRouteGroupName of( String project, String location, String agent, String flow, String transitionRouteGroup) { return newBuilder() @@ -104,7 +112,7 @@ public static TransitionRouteGroupName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP.validatedMatch( formattedString, "TransitionRouteGroupName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -123,9 +131,9 @@ public static List parseList(List formattedStr } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (TransitionRouteGroupName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -135,19 +143,30 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); - fieldMapBuilder.put("transitionRouteGroup", transitionRouteGroup); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } + if (!Objects.isNull(transitionRouteGroup)) { + fieldMapBuilder.put("transition_route_group", transitionRouteGroup); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -161,7 +180,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP.instantiate( "project", project, "location", @@ -174,15 +193,51 @@ public String toString() { transitionRouteGroup); } - /** Builder for TransitionRouteGroupName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TransitionRouteGroupName that = ((TransitionRouteGroupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow) + && Objects.equals(this.transitionRouteGroup, that.transitionRouteGroup); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + h *= 1000003; + h ^= Objects.hashCode(transitionRouteGroup); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}. + */ + public static class Builder { private String project; private String location; private String agent; private String flow; private String transitionRouteGroup; + protected Builder() {} + public String getProject() { return project; } @@ -228,8 +283,6 @@ public Builder setTransitionRouteGroup(String transitionRouteGroup) { return this; } - private Builder() {} - private Builder(TransitionRouteGroupName transitionRouteGroupName) { project = transitionRouteGroupName.project; location = transitionRouteGroupName.location; @@ -242,36 +295,4 @@ public TransitionRouteGroupName build() { return new TransitionRouteGroupName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof TransitionRouteGroupName) { - TransitionRouteGroupName that = (TransitionRouteGroupName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)) - && (this.transitionRouteGroup.equals(that.transitionRouteGroup)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - h *= 1000003; - h ^= transitionRouteGroup.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java index 28f7a0cc9..6365304d4 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,23 +23,39 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class VersionName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW_VERSION = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; private final String version; + @Deprecated + protected VersionName() { + project = null; + location = null; + agent = null; + flow = null; + version = null; + } + + private VersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + version = Preconditions.checkNotNull(builder.getVersion()); + } + public String getProject() { return project; } @@ -68,14 +84,6 @@ public Builder toBuilder() { return new Builder(this); } - private VersionName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - version = Preconditions.checkNotNull(builder.getVersion()); - } - public static VersionName of( String project, String location, String agent, String flow, String version) { return newBuilder() @@ -104,7 +112,7 @@ public static VersionName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW_VERSION.validatedMatch( formattedString, "VersionName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -123,9 +131,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (VersionName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -135,19 +143,30 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW_VERSION.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); - fieldMapBuilder.put("version", version); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } + if (!Objects.isNull(version)) { + fieldMapBuilder.put("version", version); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -161,19 +180,55 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW_VERSION.instantiate( "project", project, "location", location, "agent", agent, "flow", flow, "version", version); } - /** Builder for VersionName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + VersionName that = ((VersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow) + && Objects.equals(this.version, that.version); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + h *= 1000003; + h ^= Objects.hashCode(version); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}. + */ + public static class Builder { private String project; private String location; private String agent; private String flow; private String version; + protected Builder() {} + public String getProject() { return project; } @@ -219,8 +274,6 @@ public Builder setVersion(String version) { return this; } - private Builder() {} - private Builder(VersionName versionName) { project = versionName.project; location = versionName.location; @@ -233,36 +286,4 @@ public VersionName build() { return new VersionName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof VersionName) { - VersionName that = (VersionName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)) - && (this.version.equals(that.version)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - h *= 1000003; - h ^= version.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java index c3b20602b..5b5418f63 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class WebhookName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_WEBHOOK = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String webhook; + @Deprecated + protected WebhookName() { + project = null; + location = null; + agent = null; + webhook = null; + } + + private WebhookName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + webhook = Preconditions.checkNotNull(builder.getWebhook()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private WebhookName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - webhook = Preconditions.checkNotNull(builder.getWebhook()); - } - public static WebhookName of(String project, String location, String agent, String webhook) { return newBuilder() .setProject(project) @@ -94,7 +101,7 @@ public static WebhookName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_WEBHOOK.validatedMatch( formattedString, "WebhookName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -112,9 +119,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (WebhookName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -124,18 +131,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_WEBHOOK.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("webhook", webhook); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(webhook)) { + fieldMapBuilder.put("webhook", webhook); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -149,18 +165,48 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_WEBHOOK.instantiate( "project", project, "location", location, "agent", agent, "webhook", webhook); } - /** Builder for WebhookName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + WebhookName that = ((WebhookName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.webhook, that.webhook); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(webhook); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}. */ + public static class Builder { private String project; private String location; private String agent; private String webhook; + protected Builder() {} + public String getProject() { return project; } @@ -197,8 +243,6 @@ public Builder setWebhook(String webhook) { return this; } - private Builder() {} - private Builder(WebhookName webhookName) { project = webhookName.project; location = webhookName.location; @@ -210,33 +254,4 @@ public WebhookName build() { return new WebhookName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof WebhookName) { - WebhookName that = (WebhookName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.webhook.equals(that.webhook)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= webhook.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java index 679030d83..70014f42a 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,21 +23,33 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class AgentName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; + @Deprecated + protected AgentName() { + project = null; + location = null; + agent = null; + } + + private AgentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + } + public String getProject() { return project; } @@ -58,12 +70,6 @@ public Builder toBuilder() { return new Builder(this); } - private AgentName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - } - public static AgentName of(String project, String location, String agent) { return newBuilder().setProject(project).setLocation(location).setAgent(agent).build(); } @@ -82,7 +88,7 @@ public static AgentName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT.validatedMatch( formattedString, "AgentName.parse: formattedString not in valid format"); return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("agent")); } @@ -96,9 +102,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (AgentName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -108,17 +114,24 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -132,16 +145,44 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "location", location, "agent", agent); + return PROJECT_LOCATION_AGENT.instantiate( + "project", project, "location", location, "agent", agent); } - /** Builder for AgentName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + AgentName that = ((AgentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}. */ + public static class Builder { private String project; private String location; private String agent; + protected Builder() {} + public String getProject() { return project; } @@ -169,8 +210,6 @@ public Builder setAgent(String agent) { return this; } - private Builder() {} - private Builder(AgentName agentName) { project = agentName.project; location = agentName.location; @@ -181,30 +220,4 @@ public AgentName build() { return new AgentName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof AgentName) { - AgentName that = (AgentName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java index 22cc944ab..44212df00 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class EntityTypeName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_ENTITY_TYPE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String entityType; + @Deprecated + protected EntityTypeName() { + project = null; + location = null; + agent = null; + entityType = null; + } + + private EntityTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private EntityTypeName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - entityType = Preconditions.checkNotNull(builder.getEntityType()); - } - public static EntityTypeName of( String project, String location, String agent, String entityType) { return newBuilder() @@ -95,7 +102,7 @@ public static EntityTypeName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_ENTITY_TYPE.validatedMatch( formattedString, "EntityTypeName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -113,9 +120,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (EntityTypeName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -125,18 +132,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_ENTITY_TYPE.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("entityType", entityType); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(entityType)) { + fieldMapBuilder.put("entity_type", entityType); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -150,18 +166,50 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_ENTITY_TYPE.instantiate( "project", project, "location", location, "agent", agent, "entity_type", entityType); } - /** Builder for EntityTypeName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + EntityTypeName that = ((EntityTypeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.entityType, that.entityType); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(entityType); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}. + */ + public static class Builder { private String project; private String location; private String agent; private String entityType; + protected Builder() {} + public String getProject() { return project; } @@ -198,8 +246,6 @@ public Builder setEntityType(String entityType) { return this; } - private Builder() {} - private Builder(EntityTypeName entityTypeName) { project = entityTypeName.project; location = entityTypeName.location; @@ -211,33 +257,4 @@ public EntityTypeName build() { return new EntityTypeName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof EntityTypeName) { - EntityTypeName that = (EntityTypeName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.entityType.equals(that.entityType)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= entityType.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java index 33cfca470..957ba450d 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class EnvironmentName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String environment; + @Deprecated + protected EnvironmentName() { + project = null; + location = null; + agent = null; + environment = null; + } + + private EnvironmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private EnvironmentName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - environment = Preconditions.checkNotNull(builder.getEnvironment()); - } - public static EnvironmentName of( String project, String location, String agent, String environment) { return newBuilder() @@ -95,7 +102,7 @@ public static EnvironmentName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_ENVIRONMENT.validatedMatch( formattedString, "EnvironmentName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -113,9 +120,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (EnvironmentName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -125,18 +132,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_ENVIRONMENT.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("environment", environment); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(environment)) { + fieldMapBuilder.put("environment", environment); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -150,18 +166,50 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_ENVIRONMENT.instantiate( "project", project, "location", location, "agent", agent, "environment", environment); } - /** Builder for EnvironmentName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + EnvironmentName that = ((EnvironmentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.environment, that.environment); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/agents/{agent}/environments/{environment}. + */ + public static class Builder { private String project; private String location; private String agent; private String environment; + protected Builder() {} + public String getProject() { return project; } @@ -198,8 +246,6 @@ public Builder setEnvironment(String environment) { return this; } - private Builder() {} - private Builder(EnvironmentName environmentName) { project = environmentName.project; location = environmentName.location; @@ -211,33 +257,4 @@ public EnvironmentName build() { return new EnvironmentName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof EnvironmentName) { - EnvironmentName that = (EnvironmentName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.environment.equals(that.environment)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= environment.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java index 12cb0199a..13b8ab73d 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class FlowName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; + @Deprecated + protected FlowName() { + project = null; + location = null; + agent = null; + flow = null; + } + + private FlowName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private FlowName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - } - public static FlowName of(String project, String location, String agent, String flow) { return newBuilder() .setProject(project) @@ -94,7 +101,7 @@ public static FlowName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW.validatedMatch( formattedString, "FlowName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -112,9 +119,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (FlowName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -124,18 +131,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -149,18 +165,48 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW.instantiate( "project", project, "location", location, "agent", agent, "flow", flow); } - /** Builder for FlowName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + FlowName that = ((FlowName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}/flows/{flow}. */ + public static class Builder { private String project; private String location; private String agent; private String flow; + protected Builder() {} + public String getProject() { return project; } @@ -197,8 +243,6 @@ public Builder setFlow(String flow) { return this; } - private Builder() {} - private Builder(FlowName flowName) { project = flowName.project; location = flowName.location; @@ -210,33 +254,4 @@ public FlowName build() { return new FlowName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof FlowName) { - FlowName that = (FlowName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java index 5fe2d5727..d7470c66f 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class IntentName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_INTENT = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/intents/{intent}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String intent; + @Deprecated + protected IntentName() { + project = null; + location = null; + agent = null; + intent = null; + } + + private IntentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + intent = Preconditions.checkNotNull(builder.getIntent()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private IntentName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - intent = Preconditions.checkNotNull(builder.getIntent()); - } - public static IntentName of(String project, String location, String agent, String intent) { return newBuilder() .setProject(project) @@ -94,7 +101,7 @@ public static IntentName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_INTENT.validatedMatch( formattedString, "IntentName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -112,9 +119,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (IntentName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -124,18 +131,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_INTENT.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("intent", intent); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(intent)) { + fieldMapBuilder.put("intent", intent); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -149,18 +165,48 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_INTENT.instantiate( "project", project, "location", location, "agent", agent, "intent", intent); } - /** Builder for IntentName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + IntentName that = ((IntentName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.intent, that.intent); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(intent); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}/intents/{intent}. */ + public static class Builder { private String project; private String location; private String agent; private String intent; + protected Builder() {} + public String getProject() { return project; } @@ -197,8 +243,6 @@ public Builder setIntent(String intent) { return this; } - private Builder() {} - private Builder(IntentName intentName) { project = intentName.project; location = intentName.location; @@ -210,33 +254,4 @@ public IntentName build() { return new IntentName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof IntentName) { - IntentName that = (IntentName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.intent.equals(that.intent)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= intent.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java index 7f792bb28..bed1bbb99 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,19 +23,29 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class LocationName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION = PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + public String getProject() { return project; } @@ -52,11 +62,6 @@ public Builder toBuilder() { return new Builder(this); } - private LocationName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - } - public static LocationName of(String project, String location) { return newBuilder().setProject(project).setLocation(location).build(); } @@ -70,7 +75,7 @@ public static LocationName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION.validatedMatch( formattedString, "LocationName.parse: formattedString not in valid format"); return of(matchMap.get("project"), matchMap.get("location")); } @@ -84,9 +89,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (LocationName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -96,16 +101,21 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -119,15 +129,39 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate("project", project, "location", location); + return PROJECT_LOCATION.instantiate("project", project, "location", location); } - /** Builder for LocationName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { private String project; private String location; + protected Builder() {} + public String getProject() { return project; } @@ -146,8 +180,6 @@ public Builder setLocation(String location) { return this; } - private Builder() {} - private Builder(LocationName locationName) { project = locationName.project; location = locationName.location; @@ -157,26 +189,4 @@ public LocationName build() { return new LocationName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof LocationName) { - LocationName that = (LocationName) o; - return (this.project.equals(that.project)) && (this.location.equals(that.location)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java index 1bcd0c9ad..bf96e47b2 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,23 +23,39 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class PageName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW_PAGE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; private final String page; + @Deprecated + protected PageName() { + project = null; + location = null; + agent = null; + flow = null; + page = null; + } + + private PageName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + page = Preconditions.checkNotNull(builder.getPage()); + } + public String getProject() { return project; } @@ -68,14 +84,6 @@ public Builder toBuilder() { return new Builder(this); } - private PageName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - page = Preconditions.checkNotNull(builder.getPage()); - } - public static PageName of( String project, String location, String agent, String flow, String page) { return newBuilder() @@ -104,7 +112,7 @@ public static PageName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW_PAGE.validatedMatch( formattedString, "PageName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -123,9 +131,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (PageName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -135,19 +143,30 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW_PAGE.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); - fieldMapBuilder.put("page", page); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } + if (!Objects.isNull(page)) { + fieldMapBuilder.put("page", page); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -161,19 +180,54 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW_PAGE.instantiate( "project", project, "location", location, "agent", agent, "flow", flow, "page", page); } - /** Builder for PageName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + PageName that = ((PageName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow) + && Objects.equals(this.page, that.page); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + h *= 1000003; + h ^= Objects.hashCode(page); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/pages/{page}. + */ + public static class Builder { private String project; private String location; private String agent; private String flow; private String page; + protected Builder() {} + public String getProject() { return project; } @@ -219,8 +273,6 @@ public Builder setPage(String page) { return this; } - private Builder() {} - private Builder(PageName pageName) { project = pageName.project; location = pageName.location; @@ -233,36 +285,4 @@ public PageName build() { return new PageName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof PageName) { - PageName that = (PageName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)) - && (this.page.equals(that.page)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - h *= 1000003; - h ^= page.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java index 85ff5e53e..5ecfda594 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,32 +26,56 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class SessionEntityTypeName implements ResourceName { - - @Deprecated - protected SessionEntityTypeName() {} - - private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}"); - private static final PathTemplate - PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE = - PathTemplate.createWithoutUrlEncoding( - "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}"); - + private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}/entityTypes/{entity_type}"); private volatile Map fieldValuesMap; private PathTemplate pathTemplate; private String fixedValue; + private final String project; + private final String location; + private final String agent; + private final String session; + private final String entityType; + private final String environment; - private String project; - private String location; - private String agent; - private String session; - private String entityType; - private String environment; + @Deprecated + protected SessionEntityTypeName() { + project = null; + location = null; + agent = null; + session = null; + entityType = null; + environment = null; + } + + private SessionEntityTypeName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + session = Preconditions.checkNotNull(builder.getSession()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + environment = null; + pathTemplate = PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE; + } + + private SessionEntityTypeName(ProjectLocationAgentEnvironmentSessionEntityTypeBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + session = Preconditions.checkNotNull(builder.getSession()); + entityType = Preconditions.checkNotNull(builder.getEntityType()); + pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE; + } public String getProject() { return project; @@ -77,25 +101,6 @@ public String getEnvironment() { return environment; } - private SessionEntityTypeName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - session = Preconditions.checkNotNull(builder.getSession()); - entityType = Preconditions.checkNotNull(builder.getEntityType()); - pathTemplate = PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE; - } - - private SessionEntityTypeName(ProjectLocationAgentEnvironmentSessionEntityTypeBuilder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - environment = Preconditions.checkNotNull(builder.getEnvironment()); - session = Preconditions.checkNotNull(builder.getSession()); - entityType = Preconditions.checkNotNull(builder.getEntityType()); - pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE; - } - public static Builder newBuilder() { return new Builder(); } @@ -117,7 +122,7 @@ public Builder toBuilder() { public static SessionEntityTypeName of( String project, String location, String agent, String session, String entityType) { - return newProjectLocationAgentSessionEntityTypeBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -129,7 +134,7 @@ public static SessionEntityTypeName of( @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static SessionEntityTypeName ofProjectLocationAgentSessionEntityTypeName( String project, String location, String agent, String session, String entityType) { - return newProjectLocationAgentSessionEntityTypeBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -204,20 +209,18 @@ public static SessionEntityTypeName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - if (PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches(formattedString)) { + if (PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE.matches(formattedString)) { Map matchMap = - PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.match(formattedString); + PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE.match(formattedString); return ofProjectLocationAgentSessionEntityTypeName( matchMap.get("project"), matchMap.get("location"), matchMap.get("agent"), matchMap.get("session"), matchMap.get("entity_type")); - } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches( - formattedString)) { + } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE.matches(formattedString)) { Map matchMap = - PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.match( - formattedString); + PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE.match(formattedString); return ofProjectLocationAgentEnvironmentSessionEntityTypeName( matchMap.get("project"), matchMap.get("location"), @@ -226,7 +229,8 @@ public static SessionEntityTypeName parse(String formattedString) { matchMap.get("session"), matchMap.get("entity_type")); } - throw new ValidationException("JobName.parse: formattedString not in valid format"); + throw new ValidationException( + "SessionEntityTypeName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -240,7 +244,7 @@ public static List parseList(List formattedString public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionEntityTypeName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -250,33 +254,32 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches(formattedString) - || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE.matches( - formattedString); + return PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE.matches(formattedString) + || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_ENTITY_TYPE.matches(formattedString); } @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { + if (!Objects.isNull(project)) { fieldMapBuilder.put("project", project); } - if (location != null) { + if (!Objects.isNull(location)) { fieldMapBuilder.put("location", location); } - if (agent != null) { + if (!Objects.isNull(agent)) { fieldMapBuilder.put("agent", agent); } - if (session != null) { + if (!Objects.isNull(session)) { fieldMapBuilder.put("session", session); } - if (entityType != null) { + if (!Objects.isNull(entityType)) { fieldMapBuilder.put("entity_type", entityType); } - if (environment != null) { + if (!Objects.isNull(environment)) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -292,7 +295,44 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionEntityTypeName that = ((SessionEntityTypeName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.session, that.session) + && Objects.equals(this.entityType, that.entityType) + && Objects.equals(this.environment, that.environment); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(entityType); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; } /** @@ -300,7 +340,6 @@ public String toString() { * projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}. */ public static class Builder { - private String project; private String location; private String agent; @@ -356,10 +395,9 @@ public Builder setEntityType(String entityType) { private Builder(SessionEntityTypeName sessionEntityTypeName) { Preconditions.checkArgument( - sessionEntityTypeName.pathTemplate - == PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE_PATH_TEMPLATE, - "toBuilder is only supported when SessionEntityTypeName has the pattern of " - + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}."); + Objects.equals( + sessionEntityTypeName.pathTemplate, PROJECT_LOCATION_AGENT_SESSION_ENTITY_TYPE), + "toBuilder is only supported when SessionEntityTypeName has the pattern of projects/{project}/locations/{location}/agents/{agent}/sessions/{session}/entityTypes/{entity_type}"); project = sessionEntityTypeName.project; location = sessionEntityTypeName.location; agent = sessionEntityTypeName.agent; @@ -378,7 +416,6 @@ public SessionEntityTypeName build() { */ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class ProjectLocationAgentEnvironmentSessionEntityTypeBuilder { - private String project; private String location; private String agent; @@ -386,7 +423,7 @@ public static class ProjectLocationAgentEnvironmentSessionEntityTypeBuilder { private String session; private String entityType; - private ProjectLocationAgentEnvironmentSessionEntityTypeBuilder() {} + protected ProjectLocationAgentEnvironmentSessionEntityTypeBuilder() {} public String getProject() { return project; @@ -448,41 +485,4 @@ public SessionEntityTypeName build() { return new SessionEntityTypeName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SessionEntityTypeName that = (SessionEntityTypeName) o; - return (Objects.equals(this.project, that.project)) - && (Objects.equals(this.location, that.location)) - && (Objects.equals(this.agent, that.agent)) - && (Objects.equals(this.session, that.session)) - && (Objects.equals(this.entityType, that.entityType)) - && (Objects.equals(this.environment, that.environment)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(agent); - h *= 1000003; - h ^= Objects.hashCode(session); - h *= 1000003; - h ^= Objects.hashCode(entityType); - h *= 1000003; - h ^= Objects.hashCode(environment); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java index f97656188..7ea36ab03 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -26,30 +26,52 @@ import java.util.List; import java.util.Map; import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class SessionName implements ResourceName { - - @Deprecated - protected SessionName() {} - - private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_SESSION = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}"); - private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/sessions/{session}"); - private volatile Map fieldValuesMap; private PathTemplate pathTemplate; private String fixedValue; + private final String project; + private final String location; + private final String agent; + private final String session; + private final String environment; + + @Deprecated + protected SessionName() { + project = null; + location = null; + agent = null; + session = null; + environment = null; + } - private String project; - private String location; - private String agent; - private String session; - private String environment; + private SessionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + session = Preconditions.checkNotNull(builder.getSession()); + environment = null; + pathTemplate = PROJECT_LOCATION_AGENT_SESSION; + } + + private SessionName(ProjectLocationAgentEnvironmentSessionBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + environment = Preconditions.checkNotNull(builder.getEnvironment()); + session = Preconditions.checkNotNull(builder.getSession()); + pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION; + } public String getProject() { return project; @@ -71,23 +93,6 @@ public String getEnvironment() { return environment; } - private SessionName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - session = Preconditions.checkNotNull(builder.getSession()); - pathTemplate = PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE; - } - - private SessionName(ProjectLocationAgentEnvironmentSessionBuilder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - environment = Preconditions.checkNotNull(builder.getEnvironment()); - session = Preconditions.checkNotNull(builder.getSession()); - pathTemplate = PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE; - } - public static Builder newBuilder() { return new Builder(); } @@ -108,7 +113,7 @@ public Builder toBuilder() { } public static SessionName of(String project, String location, String agent, String session) { - return newProjectLocationAgentSessionBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -119,7 +124,7 @@ public static SessionName of(String project, String location, String agent, Stri @BetaApi("The static create methods are not stable yet and may be changed in the future.") public static SessionName ofProjectLocationAgentSessionName( String project, String location, String agent, String session) { - return newProjectLocationAgentSessionBuilder() + return newBuilder() .setProject(project) .setLocation(location) .setAgent(agent) @@ -178,17 +183,16 @@ public static SessionName parse(String formattedString) { if (formattedString.isEmpty()) { return null; } - if (PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.matches(formattedString)) { - Map matchMap = - PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.match(formattedString); + if (PROJECT_LOCATION_AGENT_SESSION.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_AGENT_SESSION.match(formattedString); return ofProjectLocationAgentSessionName( matchMap.get("project"), matchMap.get("location"), matchMap.get("agent"), matchMap.get("session")); - } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.matches(formattedString)) { + } else if (PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION.matches(formattedString)) { Map matchMap = - PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.match(formattedString); + PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION.match(formattedString); return ofProjectLocationAgentEnvironmentSessionName( matchMap.get("project"), matchMap.get("location"), @@ -196,7 +200,7 @@ public static SessionName parse(String formattedString) { matchMap.get("environment"), matchMap.get("session")); } - throw new ValidationException("JobName.parse: formattedString not in valid format"); + throw new ValidationException("SessionName.parse: formattedString not in valid format"); } public static List parseList(List formattedStrings) { @@ -210,7 +214,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -220,29 +224,29 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE.matches(formattedString) - || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION_PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_SESSION.matches(formattedString) + || PROJECT_LOCATION_AGENT_ENVIRONMENT_SESSION.matches(formattedString); } @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (project != null) { + if (!Objects.isNull(project)) { fieldMapBuilder.put("project", project); } - if (location != null) { + if (!Objects.isNull(location)) { fieldMapBuilder.put("location", location); } - if (agent != null) { + if (!Objects.isNull(agent)) { fieldMapBuilder.put("agent", agent); } - if (session != null) { + if (!Objects.isNull(session)) { fieldMapBuilder.put("session", session); } - if (environment != null) { + if (!Objects.isNull(environment)) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -258,12 +262,45 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + SessionName that = ((SessionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.session, that.session) + && Objects.equals(this.environment, that.environment); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(session); + h *= 1000003; + h ^= Objects.hashCode(environment); + return h; } /** Builder for projects/{project}/locations/{location}/agents/{agent}/sessions/{session}. */ public static class Builder { - private String project; private String location; private String agent; @@ -309,9 +346,8 @@ public Builder setSession(String session) { private Builder(SessionName sessionName) { Preconditions.checkArgument( - sessionName.pathTemplate == PROJECT_LOCATION_AGENT_SESSION_PATH_TEMPLATE, - "toBuilder is only supported when SessionName has the pattern of " - + "projects/{project}/locations/{location}/agents/{agent}/sessions/{session}."); + Objects.equals(sessionName.pathTemplate, PROJECT_LOCATION_AGENT_SESSION), + "toBuilder is only supported when SessionName has the pattern of projects/{project}/locations/{location}/agents/{agent}/sessions/{session}"); project = sessionName.project; location = sessionName.location; agent = sessionName.agent; @@ -329,14 +365,13 @@ public SessionName build() { */ @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") public static class ProjectLocationAgentEnvironmentSessionBuilder { - private String project; private String location; private String agent; private String environment; private String session; - private ProjectLocationAgentEnvironmentSessionBuilder() {} + protected ProjectLocationAgentEnvironmentSessionBuilder() {} public String getProject() { return project; @@ -387,38 +422,4 @@ public SessionName build() { return new SessionName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o != null || getClass() == o.getClass()) { - SessionName that = (SessionName) o; - return (Objects.equals(this.project, that.project)) - && (Objects.equals(this.location, that.location)) - && (Objects.equals(this.agent, that.agent)) - && (Objects.equals(this.session, that.session)) - && (Objects.equals(this.environment, that.environment)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= Objects.hashCode(fixedValue); - h *= 1000003; - h ^= Objects.hashCode(project); - h *= 1000003; - h ^= Objects.hashCode(location); - h *= 1000003; - h ^= Objects.hashCode(agent); - h *= 1000003; - h ^= Objects.hashCode(session); - h *= 1000003; - h ^= Objects.hashCode(environment); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java index cabac6911..ef76ef8b6 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,23 +23,39 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class TransitionRouteGroupName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; private final String transitionRouteGroup; + @Deprecated + protected TransitionRouteGroupName() { + project = null; + location = null; + agent = null; + flow = null; + transitionRouteGroup = null; + } + + private TransitionRouteGroupName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + transitionRouteGroup = Preconditions.checkNotNull(builder.getTransitionRouteGroup()); + } + public String getProject() { return project; } @@ -68,14 +84,6 @@ public Builder toBuilder() { return new Builder(this); } - private TransitionRouteGroupName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - transitionRouteGroup = Preconditions.checkNotNull(builder.getTransitionRouteGroup()); - } - public static TransitionRouteGroupName of( String project, String location, String agent, String flow, String transitionRouteGroup) { return newBuilder() @@ -104,7 +112,7 @@ public static TransitionRouteGroupName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP.validatedMatch( formattedString, "TransitionRouteGroupName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -123,9 +131,9 @@ public static List parseList(List formattedStr } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (TransitionRouteGroupName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -135,19 +143,30 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); - fieldMapBuilder.put("transitionRouteGroup", transitionRouteGroup); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } + if (!Objects.isNull(transitionRouteGroup)) { + fieldMapBuilder.put("transition_route_group", transitionRouteGroup); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -161,7 +180,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW_TRANSITION_ROUTE_GROUP.instantiate( "project", project, "location", @@ -174,15 +193,51 @@ public String toString() { transitionRouteGroup); } - /** Builder for TransitionRouteGroupName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + TransitionRouteGroupName that = ((TransitionRouteGroupName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow) + && Objects.equals(this.transitionRouteGroup, that.transitionRouteGroup); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + h *= 1000003; + h ^= Objects.hashCode(transitionRouteGroup); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}. + */ + public static class Builder { private String project; private String location; private String agent; private String flow; private String transitionRouteGroup; + protected Builder() {} + public String getProject() { return project; } @@ -228,8 +283,6 @@ public Builder setTransitionRouteGroup(String transitionRouteGroup) { return this; } - private Builder() {} - private Builder(TransitionRouteGroupName transitionRouteGroupName) { project = transitionRouteGroupName.project; location = transitionRouteGroupName.location; @@ -242,36 +295,4 @@ public TransitionRouteGroupName build() { return new TransitionRouteGroupName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof TransitionRouteGroupName) { - TransitionRouteGroupName that = (TransitionRouteGroupName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)) - && (this.transitionRouteGroup.equals(that.transitionRouteGroup)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - h *= 1000003; - h ^= transitionRouteGroup.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java index 1a80539be..43633c778 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,23 +23,39 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class VersionName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_FLOW_VERSION = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String flow; private final String version; + @Deprecated + protected VersionName() { + project = null; + location = null; + agent = null; + flow = null; + version = null; + } + + private VersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + flow = Preconditions.checkNotNull(builder.getFlow()); + version = Preconditions.checkNotNull(builder.getVersion()); + } + public String getProject() { return project; } @@ -68,14 +84,6 @@ public Builder toBuilder() { return new Builder(this); } - private VersionName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - flow = Preconditions.checkNotNull(builder.getFlow()); - version = Preconditions.checkNotNull(builder.getVersion()); - } - public static VersionName of( String project, String location, String agent, String flow, String version) { return newBuilder() @@ -104,7 +112,7 @@ public static VersionName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_FLOW_VERSION.validatedMatch( formattedString, "VersionName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -123,9 +131,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (VersionName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -135,19 +143,30 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_FLOW_VERSION.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("flow", flow); - fieldMapBuilder.put("version", version); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(flow)) { + fieldMapBuilder.put("flow", flow); + } + if (!Objects.isNull(version)) { + fieldMapBuilder.put("version", version); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -161,19 +180,55 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_FLOW_VERSION.instantiate( "project", project, "location", location, "agent", agent, "flow", flow, "version", version); } - /** Builder for VersionName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + VersionName that = ((VersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.flow, that.flow) + && Objects.equals(this.version, that.version); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(flow); + h *= 1000003; + h ^= Objects.hashCode(version); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}. + */ + public static class Builder { private String project; private String location; private String agent; private String flow; private String version; + protected Builder() {} + public String getProject() { return project; } @@ -219,8 +274,6 @@ public Builder setVersion(String version) { return this; } - private Builder() {} - private Builder(VersionName versionName) { project = versionName.project; location = versionName.location; @@ -233,36 +286,4 @@ public VersionName build() { return new VersionName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof VersionName) { - VersionName that = (VersionName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.flow.equals(that.flow)) - && (this.version.equals(that.version)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= flow.hashCode(); - h *= 1000003; - h ^= version.hashCode(); - return h; - } } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java index 980ad9e20..06633d7a1 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * https://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -23,22 +23,36 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; -/** AUTO-GENERATED DOCUMENTATION AND CLASS */ -@javax.annotation.Generated("by GAPIC protoc plugin") +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") public class WebhookName implements ResourceName { - - private static final PathTemplate PATH_TEMPLATE = + private static final PathTemplate PROJECT_LOCATION_AGENT_WEBHOOK = PathTemplate.createWithoutUrlEncoding( "projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}"); - private volatile Map fieldValuesMap; - private final String project; private final String location; private final String agent; private final String webhook; + @Deprecated + protected WebhookName() { + project = null; + location = null; + agent = null; + webhook = null; + } + + private WebhookName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + agent = Preconditions.checkNotNull(builder.getAgent()); + webhook = Preconditions.checkNotNull(builder.getWebhook()); + } + public String getProject() { return project; } @@ -63,13 +77,6 @@ public Builder toBuilder() { return new Builder(this); } - private WebhookName(Builder builder) { - project = Preconditions.checkNotNull(builder.getProject()); - location = Preconditions.checkNotNull(builder.getLocation()); - agent = Preconditions.checkNotNull(builder.getAgent()); - webhook = Preconditions.checkNotNull(builder.getWebhook()); - } - public static WebhookName of(String project, String location, String agent, String webhook) { return newBuilder() .setProject(project) @@ -94,7 +101,7 @@ public static WebhookName parse(String formattedString) { return null; } Map matchMap = - PATH_TEMPLATE.validatedMatch( + PROJECT_LOCATION_AGENT_WEBHOOK.validatedMatch( formattedString, "WebhookName.parse: formattedString not in valid format"); return of( matchMap.get("project"), @@ -112,9 +119,9 @@ public static List parseList(List formattedStrings) { } public static List toStringList(List values) { - List list = new ArrayList(values.size()); + List list = new ArrayList<>(values.size()); for (WebhookName value : values) { - if (value == null) { + if (Objects.isNull(value)) { list.add(""); } else { list.add(value.toString()); @@ -124,18 +131,27 @@ public static List toStringList(List values) { } public static boolean isParsableFrom(String formattedString) { - return PATH_TEMPLATE.matches(formattedString); + return PROJECT_LOCATION_AGENT_WEBHOOK.matches(formattedString); } + @Override public Map getFieldValuesMap() { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { synchronized (this) { - if (fieldValuesMap == null) { + if (Objects.isNull(fieldValuesMap)) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - fieldMapBuilder.put("project", project); - fieldMapBuilder.put("location", location); - fieldMapBuilder.put("agent", agent); - fieldMapBuilder.put("webhook", webhook); + if (!Objects.isNull(project)) { + fieldMapBuilder.put("project", project); + } + if (!Objects.isNull(location)) { + fieldMapBuilder.put("location", location); + } + if (!Objects.isNull(agent)) { + fieldMapBuilder.put("agent", agent); + } + if (!Objects.isNull(webhook)) { + fieldMapBuilder.put("webhook", webhook); + } fieldValuesMap = fieldMapBuilder.build(); } } @@ -149,18 +165,48 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return PATH_TEMPLATE.instantiate( + return PROJECT_LOCATION_AGENT_WEBHOOK.instantiate( "project", project, "location", location, "agent", agent, "webhook", webhook); } - /** Builder for WebhookName. */ - public static class Builder { + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + WebhookName that = ((WebhookName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.agent, that.agent) + && Objects.equals(this.webhook, that.webhook); + } + return false; + } + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(agent); + h *= 1000003; + h ^= Objects.hashCode(webhook); + return h; + } + + /** Builder for projects/{project}/locations/{location}/agents/{agent}/webhooks/{webhook}. */ + public static class Builder { private String project; private String location; private String agent; private String webhook; + protected Builder() {} + public String getProject() { return project; } @@ -197,8 +243,6 @@ public Builder setWebhook(String webhook) { return this; } - private Builder() {} - private Builder(WebhookName webhookName) { project = webhookName.project; location = webhookName.location; @@ -210,33 +254,4 @@ public WebhookName build() { return new WebhookName(this); } } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof WebhookName) { - WebhookName that = (WebhookName) o; - return (this.project.equals(that.project)) - && (this.location.equals(that.location)) - && (this.agent.equals(that.agent)) - && (this.webhook.equals(that.webhook)); - } - return false; - } - - @Override - public int hashCode() { - int h = 1; - h *= 1000003; - h ^= project.hashCode(); - h *= 1000003; - h ^= location.hashCode(); - h *= 1000003; - h ^= agent.hashCode(); - h *= 1000003; - h ^= webhook.hashCode(); - return h; - } } diff --git a/synth.metadata b/synth.metadata index abc698622..8a82c5c95 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b11a87f3b54be3a5e42c15020ee1e0781f86da90", - "internalRef": "344134135" + "sha": "ca7389d35c91ba8aae893fbafd68127d1ff535d2", + "internalRef": "345049577" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b11a87f3b54be3a5e42c15020ee1e0781f86da90", - "internalRef": "344134135" + "sha": "ca7389d35c91ba8aae893fbafd68127d1ff535d2", + "internalRef": "345049577" } }, { From f77b309763df6bd6b6d7f6d8c21718694b6cbc2c Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:25:16 -0800 Subject: [PATCH 5/9] chore: Undo removal of --include_source_info from .bazelrc Committer: @miraleung PiperOrigin-RevId: 345067549 Source-Author: Google APIs Source-Date: Tue Dec 1 11:49:14 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 8cfc6c874574b649b4524a4ef6a0651533325a84 Source-Link: https://github.com/googleapis/googleapis/commit/8cfc6c874574b649b4524a4ef6a0651533325a84 --- .../cloud/dialogflow/cx/v3/AgentsGrpc.java | 272 +++++++++++++++--- .../dialogflow/cx/v3/EntityTypesGrpc.java | 200 +++++++++++-- .../dialogflow/cx/v3/EnvironmentsGrpc.java | 232 +++++++++++++-- .../cloud/dialogflow/cx/v3/FlowsGrpc.java | 236 +++++++++++++-- .../cloud/dialogflow/cx/v3/IntentsGrpc.java | 200 +++++++++++-- .../cloud/dialogflow/cx/v3/PagesGrpc.java | 200 +++++++++++-- .../cx/v3/SecuritySettingsServiceGrpc.java | 204 +++++++++++-- .../cx/v3/SessionEntityTypesGrpc.java | 208 ++++++++++++-- .../cloud/dialogflow/cx/v3/SessionsGrpc.java | 190 ++++++++++-- .../cx/v3/TransitionRouteGroupsGrpc.java | 200 +++++++++++-- .../cloud/dialogflow/cx/v3/VersionsGrpc.java | 232 +++++++++++++-- .../cloud/dialogflow/cx/v3/WebhooksGrpc.java | 200 +++++++++++-- .../dialogflow/cx/v3beta1/AgentsGrpc.java | 272 +++++++++++++++--- .../cx/v3beta1/EntityTypesGrpc.java | 200 +++++++++++-- .../cx/v3beta1/EnvironmentsGrpc.java | 232 +++++++++++++-- .../dialogflow/cx/v3beta1/FlowsGrpc.java | 236 +++++++++++++-- .../dialogflow/cx/v3beta1/IntentsGrpc.java | 200 +++++++++++-- .../dialogflow/cx/v3beta1/PagesGrpc.java | 200 +++++++++++-- .../cx/v3beta1/SessionEntityTypesGrpc.java | 208 ++++++++++++-- .../dialogflow/cx/v3beta1/SessionsGrpc.java | 190 ++++++++++-- .../cx/v3beta1/TransitionRouteGroupsGrpc.java | 200 +++++++++++-- .../dialogflow/cx/v3beta1/VersionsGrpc.java | 232 +++++++++++++-- .../dialogflow/cx/v3beta1/WebhooksGrpc.java | 200 +++++++++++-- synth.metadata | 8 +- 24 files changed, 4345 insertions(+), 607 deletions(-) diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java index a475f94d4..9bbccdfbf 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/agent.proto") @@ -380,10 +386,22 @@ public AgentsFutureStub newStub( return AgentsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
+   * 
+ */ public abstract static class AgentsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public void listAgents( com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -391,42 +409,80 @@ public void listAgents( asyncUnimplementedUnaryCall(getListAgentsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public void getAgent( com.google.cloud.dialogflow.cx.v3.GetAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public void createAgent( com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public void updateAgent( com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public void exportAgent( com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getExportAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -483,7 +539,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
+   * 
+ */ public static final class AgentsStub extends io.grpc.stub.AbstractAsyncStub { private AgentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -494,7 +556,13 @@ protected AgentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpti return new AgentsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public void listAgents( com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -503,7 +571,13 @@ public void listAgents( getChannel().newCall(getListAgentsMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public void getAgent( com.google.cloud.dialogflow.cx.v3.GetAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -511,7 +585,13 @@ public void getAgent( getChannel().newCall(getGetAgentMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public void createAgent( com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -521,7 +601,13 @@ public void createAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public void updateAgent( com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -531,7 +617,13 @@ public void updateAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -541,7 +633,13 @@ public void deleteAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public void exportAgent( com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -551,7 +649,15 @@ public void exportAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -562,7 +668,13 @@ public void restoreAgent( } } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
+   * 
+ */ public static final class AgentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private AgentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -574,50 +686,100 @@ protected AgentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new AgentsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListAgentsResponse listAgents( com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request) { return blockingUnaryCall(getChannel(), getListAgentsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Agent getAgent( com.google.cloud.dialogflow.cx.v3.GetAgentRequest request) { return blockingUnaryCall(getChannel(), getGetAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Agent createAgent( com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request) { return blockingUnaryCall(getChannel(), getCreateAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Agent updateAgent( com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request) { return blockingUnaryCall(getChannel(), getUpdateAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public com.google.protobuf.Empty deleteAgent( com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request) { return blockingUnaryCall(getChannel(), getDeleteAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public com.google.longrunning.Operation exportAgent( com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request) { return blockingUnaryCall(getChannel(), getExportAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public com.google.longrunning.Operation restoreAgent( com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request) { return blockingUnaryCall(getChannel(), getRestoreAgentMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3.Agent].
+   * 
+ */ public static final class AgentsFutureStub extends io.grpc.stub.AbstractFutureStub { private AgentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -629,7 +791,13 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new AgentsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListAgentsResponse> listAgents(com.google.cloud.dialogflow.cx.v3.ListAgentsRequest request) { @@ -637,14 +805,26 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getListAgentsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Agent> getAgent(com.google.cloud.dialogflow.cx.v3.GetAgentRequest request) { return futureUnaryCall(getChannel().newCall(getGetAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Agent> createAgent(com.google.cloud.dialogflow.cx.v3.CreateAgentRequest request) { @@ -652,7 +832,13 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getCreateAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Agent> updateAgent(com.google.cloud.dialogflow.cx.v3.UpdateAgentRequest request) { @@ -660,21 +846,41 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getUpdateAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteAgent(com.google.cloud.dialogflow.cx.v3.DeleteAgentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture exportAgent(com.google.cloud.dialogflow.cx.v3.ExportAgentRequest request) { return futureUnaryCall( getChannel().newCall(getExportAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture restoreAgent(com.google.cloud.dialogflow.cx.v3.RestoreAgentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java index 7325694ca..065a1b795 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/entity_type.proto") @@ -300,10 +306,22 @@ public EntityTypesFutureStub newStub( return EntityTypesFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
+   * 
+ */ public abstract static class EntityTypesImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -311,7 +329,13 @@ public void listEntityTypes( asyncUnimplementedUnaryCall(getListEntityTypesMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public void getEntityType( com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -319,7 +343,13 @@ public void getEntityType( asyncUnimplementedUnaryCall(getGetEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public void createEntityType( com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -327,7 +357,13 @@ public void createEntityType( asyncUnimplementedUnaryCall(getCreateEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -335,7 +371,13 @@ public void updateEntityType( asyncUnimplementedUnaryCall(getUpdateEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -383,7 +425,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
+   * 
+ */ public static final class EntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private EntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -395,7 +443,13 @@ protected EntityTypesStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new EntityTypesStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -406,7 +460,13 @@ public void listEntityTypes( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public void getEntityType( com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -417,7 +477,13 @@ public void getEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public void createEntityType( com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -428,7 +494,13 @@ public void createEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -439,7 +511,13 @@ public void updateEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -450,7 +528,13 @@ public void deleteEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
+   * 
+ */ public static final class EntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EntityTypesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -463,33 +547,63 @@ protected EntityTypesBlockingStub build( return new EntityTypesBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse listEntityTypes( com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request) { return blockingUnaryCall(getChannel(), getListEntityTypesMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.EntityType getEntityType( com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request) { return blockingUnaryCall(getChannel(), getGetEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.EntityType createEntityType( com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.EntityType updateEntityType( com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public com.google.protobuf.Empty deleteEntityType( com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request) { return blockingUnaryCall( @@ -497,7 +611,13 @@ public com.google.protobuf.Empty deleteEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3.EntityType].
+   * 
+ */ public static final class EntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private EntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -510,7 +630,13 @@ protected EntityTypesFutureStub build( return new EntityTypesFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListEntityTypesResponse> listEntityTypes(com.google.cloud.dialogflow.cx.v3.ListEntityTypesRequest request) { @@ -518,7 +644,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getListEntityTypesMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.EntityType> getEntityType(com.google.cloud.dialogflow.cx.v3.GetEntityTypeRequest request) { @@ -526,7 +658,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getGetEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.EntityType> createEntityType(com.google.cloud.dialogflow.cx.v3.CreateEntityTypeRequest request) { @@ -534,7 +672,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getCreateEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.EntityType> updateEntityType(com.google.cloud.dialogflow.cx.v3.UpdateEntityTypeRequest request) { @@ -542,7 +686,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getUpdateEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteEntityType(com.google.cloud.dialogflow.cx.v3.DeleteEntityTypeRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java index e8daa1d7f..8c1bd655c 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/environment.proto") @@ -352,10 +358,22 @@ public EnvironmentsFutureStub newStub( return EnvironmentsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
+   * 
+ */ public abstract static class EnvironmentsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -363,7 +381,13 @@ public void listEnvironments( asyncUnimplementedUnaryCall(getListEnvironmentsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -371,28 +395,52 @@ public void getEnvironment( asyncUnimplementedUnaryCall(getGetEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -447,7 +495,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
+   * 
+ */ public static final class EnvironmentsStub extends io.grpc.stub.AbstractAsyncStub { private EnvironmentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -459,7 +513,13 @@ protected EnvironmentsStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new EnvironmentsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -470,7 +530,13 @@ public void listEnvironments( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -481,7 +547,13 @@ public void getEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -491,7 +563,13 @@ public void createEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -501,7 +579,13 @@ public void updateEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -511,7 +595,13 @@ public void deleteEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -524,7 +614,13 @@ public void lookupEnvironmentHistory( } } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
+   * 
+ */ public static final class EnvironmentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EnvironmentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -537,41 +633,77 @@ protected EnvironmentsBlockingStub build( return new EnvironmentsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse listEnvironments( com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request) { return blockingUnaryCall( getChannel(), getListEnvironmentsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Environment getEnvironment( com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request) { return blockingUnaryCall(getChannel(), getGetEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public com.google.longrunning.Operation createEnvironment( com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getCreateEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.longrunning.Operation updateEnvironment( com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getUpdateEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.protobuf.Empty deleteEnvironment( com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getDeleteEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryRequest request) { @@ -580,7 +712,13 @@ public com.google.protobuf.Empty deleteEnvironment( } } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3.Environment].
+   * 
+ */ public static final class EnvironmentsFutureStub extends io.grpc.stub.AbstractFutureStub { private EnvironmentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -593,7 +731,13 @@ protected EnvironmentsFutureStub build( return new EnvironmentsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListEnvironmentsResponse> listEnvironments(com.google.cloud.dialogflow.cx.v3.ListEnvironmentsRequest request) { @@ -601,7 +745,13 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getListEnvironmentsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Environment> getEnvironment(com.google.cloud.dialogflow.cx.v3.GetEnvironmentRequest request) { @@ -609,28 +759,52 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3.Agent].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture createEnvironment(com.google.cloud.dialogflow.cx.v3.CreateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getCreateEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture updateEnvironment(com.google.cloud.dialogflow.cx.v3.UpdateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getUpdateEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteEnvironment(com.google.cloud.dialogflow.cx.v3.DeleteEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.LookupEnvironmentHistoryResponse> lookupEnvironmentHistory( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java index 873e799d7..3ad301886 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/flow.proto") @@ -335,24 +341,48 @@ public FlowsFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return FlowsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
+   * 
+ */ public abstract static class FlowsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public void createFlow( com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public void listFlows( com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -360,21 +390,40 @@ public void listFlows( asyncUnimplementedUnaryCall(getListFlowsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public void getFlow( com.google.cloud.dialogflow.cx.v3.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public void updateFlow( com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ public void trainFlow( com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -425,7 +474,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
+   * 
+ */ public static final class FlowsStub extends io.grpc.stub.AbstractAsyncStub { private FlowsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -436,7 +491,13 @@ protected FlowsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new FlowsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public void createFlow( com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -444,7 +505,13 @@ public void createFlow( getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -452,7 +519,13 @@ public void deleteFlow( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public void listFlows( com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -461,7 +534,13 @@ public void listFlows( getChannel().newCall(getListFlowsMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public void getFlow( com.google.cloud.dialogflow.cx.v3.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -469,7 +548,13 @@ public void getFlow( getChannel().newCall(getGetFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public void updateFlow( com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -477,7 +562,14 @@ public void updateFlow( getChannel().newCall(getUpdateFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ public void trainFlow( com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -486,7 +578,13 @@ public void trainFlow( } } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
+   * 
+ */ public static final class FlowsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private FlowsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -498,44 +596,87 @@ protected FlowsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new FlowsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Flow createFlow( com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request) { return blockingUnaryCall(getChannel(), getCreateFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public com.google.protobuf.Empty deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request) { return blockingUnaryCall(getChannel(), getDeleteFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListFlowsResponse listFlows( com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request) { return blockingUnaryCall(getChannel(), getListFlowsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Flow getFlow( com.google.cloud.dialogflow.cx.v3.GetFlowRequest request) { return blockingUnaryCall(getChannel(), getGetFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Flow updateFlow( com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request) { return blockingUnaryCall(getChannel(), getUpdateFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ public com.google.longrunning.Operation trainFlow( com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request) { return blockingUnaryCall(getChannel(), getTrainFlowMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
+   * 
+ */ public static final class FlowsFutureStub extends io.grpc.stub.AbstractFutureStub { private FlowsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -547,7 +688,13 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new FlowsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Flow> createFlow(com.google.cloud.dialogflow.cx.v3.CreateFlowRequest request) { @@ -555,28 +702,52 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteFlow( com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListFlowsResponse> listFlows(com.google.cloud.dialogflow.cx.v3.ListFlowsRequest request) { return futureUnaryCall(getChannel().newCall(getListFlowsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Flow> getFlow(com.google.cloud.dialogflow.cx.v3.GetFlowRequest request) { return futureUnaryCall(getChannel().newCall(getGetFlowMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Flow> updateFlow(com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest request) { @@ -584,7 +755,14 @@ public com.google.common.util.concurrent.ListenableFuture + * Trains the specified flow. Note that only the flow in 'draft' environment + * is trained. + * + */ public com.google.common.util.concurrent.ListenableFuture trainFlow(com.google.cloud.dialogflow.cx.v3.TrainFlowRequest request) { return futureUnaryCall(getChannel().newCall(getTrainFlowMethod(), getCallOptions()), request); diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java index 2d63b84b0..d9c1243f4 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/intent.proto") @@ -296,10 +302,22 @@ public IntentsFutureStub newStub( return IntentsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
+   * 
+ */ public abstract static class IntentsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public void listIntents( com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -307,28 +325,52 @@ public void listIntents( asyncUnimplementedUnaryCall(getListIntentsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public void getIntent( com.google.cloud.dialogflow.cx.v3.GetIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public void createIntent( com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public void updateIntent( com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -373,7 +415,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
+   * 
+ */ public static final class IntentsStub extends io.grpc.stub.AbstractAsyncStub { private IntentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -384,7 +432,13 @@ protected IntentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpt return new IntentsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public void listIntents( com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -395,7 +449,13 @@ public void listIntents( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public void getIntent( com.google.cloud.dialogflow.cx.v3.GetIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -403,7 +463,13 @@ public void getIntent( getChannel().newCall(getGetIntentMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public void createIntent( com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -413,7 +479,13 @@ public void createIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public void updateIntent( com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -423,7 +495,13 @@ public void updateIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -434,7 +512,13 @@ public void deleteIntent( } } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
+   * 
+ */ public static final class IntentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private IntentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -446,38 +530,74 @@ protected IntentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new IntentsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListIntentsResponse listIntents( com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request) { return blockingUnaryCall(getChannel(), getListIntentsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Intent getIntent( com.google.cloud.dialogflow.cx.v3.GetIntentRequest request) { return blockingUnaryCall(getChannel(), getGetIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Intent createIntent( com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request) { return blockingUnaryCall(getChannel(), getCreateIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Intent updateIntent( com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request) { return blockingUnaryCall(getChannel(), getUpdateIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public com.google.protobuf.Empty deleteIntent( com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request) { return blockingUnaryCall(getChannel(), getDeleteIntentMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3.Intent].
+   * 
+ */ public static final class IntentsFutureStub extends io.grpc.stub.AbstractFutureStub { private IntentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -489,7 +609,13 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new IntentsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListIntentsResponse> listIntents(com.google.cloud.dialogflow.cx.v3.ListIntentsRequest request) { @@ -497,14 +623,26 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getListIntentsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Intent> getIntent(com.google.cloud.dialogflow.cx.v3.GetIntentRequest request) { return futureUnaryCall(getChannel().newCall(getGetIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Intent> createIntent(com.google.cloud.dialogflow.cx.v3.CreateIntentRequest request) { @@ -512,7 +650,13 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getCreateIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Intent> updateIntent(com.google.cloud.dialogflow.cx.v3.UpdateIntentRequest request) { @@ -520,7 +664,13 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getUpdateIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteIntent(com.google.cloud.dialogflow.cx.v3.DeleteIntentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java index e54027443..e0ee89e3e 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/page.proto") @@ -293,10 +299,22 @@ public PagesFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return PagesFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
+   * 
+ */ public abstract static class PagesImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public void listPages( com.google.cloud.dialogflow.cx.v3.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -304,28 +322,52 @@ public void listPages( asyncUnimplementedUnaryCall(getListPagesMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public void getPage( com.google.cloud.dialogflow.cx.v3.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetPageMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public void createPage( com.google.cloud.dialogflow.cx.v3.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreatePageMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public void updatePage( com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdatePageMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public void deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -370,7 +412,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
+   * 
+ */ public static final class PagesStub extends io.grpc.stub.AbstractAsyncStub { private PagesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -381,7 +429,13 @@ protected PagesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new PagesStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public void listPages( com.google.cloud.dialogflow.cx.v3.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -390,7 +444,13 @@ public void listPages( getChannel().newCall(getListPagesMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public void getPage( com.google.cloud.dialogflow.cx.v3.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -398,7 +458,13 @@ public void getPage( getChannel().newCall(getGetPageMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public void createPage( com.google.cloud.dialogflow.cx.v3.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -406,7 +472,13 @@ public void createPage( getChannel().newCall(getCreatePageMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public void updatePage( com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -414,7 +486,13 @@ public void updatePage( getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public void deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -423,7 +501,13 @@ public void deletePage( } } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
+   * 
+ */ public static final class PagesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private PagesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -435,38 +519,74 @@ protected PagesBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new PagesBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListPagesResponse listPages( com.google.cloud.dialogflow.cx.v3.ListPagesRequest request) { return blockingUnaryCall(getChannel(), getListPagesMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Page getPage( com.google.cloud.dialogflow.cx.v3.GetPageRequest request) { return blockingUnaryCall(getChannel(), getGetPageMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Page createPage( com.google.cloud.dialogflow.cx.v3.CreatePageRequest request) { return blockingUnaryCall(getChannel(), getCreatePageMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Page updatePage( com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request) { return blockingUnaryCall(getChannel(), getUpdatePageMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public com.google.protobuf.Empty deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request) { return blockingUnaryCall(getChannel(), getDeletePageMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
+   * 
+ */ public static final class PagesFutureStub extends io.grpc.stub.AbstractFutureStub { private PagesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -478,21 +598,39 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new PagesFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListPagesResponse> listPages(com.google.cloud.dialogflow.cx.v3.ListPagesRequest request) { return futureUnaryCall(getChannel().newCall(getListPagesMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Page> getPage(com.google.cloud.dialogflow.cx.v3.GetPageRequest request) { return futureUnaryCall(getChannel().newCall(getGetPageMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Page> createPage(com.google.cloud.dialogflow.cx.v3.CreatePageRequest request) { @@ -500,7 +638,13 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreatePageMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Page> updatePage(com.google.cloud.dialogflow.cx.v3.UpdatePageRequest request) { @@ -508,7 +652,13 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deletePage( com.google.cloud.dialogflow.cx.v3.DeletePageRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java index 1c6809236..03d712761 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing security settings for Dialogflow.
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/security_settings.proto") @@ -336,10 +342,22 @@ public SecuritySettingsServiceFutureStub newStub( return SecuritySettingsServiceFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing security settings for Dialogflow.
+   * 
+ */ public abstract static class SecuritySettingsServiceImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Create security settings in the specified location.
+     * 
+ */ public void createSecuritySettings( com.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -347,7 +365,14 @@ public void createSecuritySettings( asyncUnimplementedUnaryCall(getCreateSecuritySettingsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * The returned settings may be stale by up to 1 minute.
+     * 
+ */ public void getSecuritySettings( com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -355,7 +380,13 @@ public void getSecuritySettings( asyncUnimplementedUnaryCall(getGetSecuritySettingsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public void updateSecuritySettings( com.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -363,7 +394,13 @@ public void updateSecuritySettings( asyncUnimplementedUnaryCall(getUpdateSecuritySettingsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Returns the list of all security settings in the specified location.
+     * 
+ */ public void listSecuritySettings( com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -371,7 +408,13 @@ public void listSecuritySettings( asyncUnimplementedUnaryCall(getListSecuritySettingsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public void deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -419,7 +462,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing security settings for Dialogflow.
+   * 
+ */ public static final class SecuritySettingsServiceStub extends io.grpc.stub.AbstractAsyncStub { private SecuritySettingsServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -432,7 +481,13 @@ protected SecuritySettingsServiceStub build( return new SecuritySettingsServiceStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Create security settings in the specified location.
+     * 
+ */ public void createSecuritySettings( com.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -443,7 +498,14 @@ public void createSecuritySettings( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * The returned settings may be stale by up to 1 minute.
+     * 
+ */ public void getSecuritySettings( com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -454,7 +516,13 @@ public void getSecuritySettings( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public void updateSecuritySettings( com.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -465,7 +533,13 @@ public void updateSecuritySettings( responseObserver); } - /** */ + /** + * + * + *
+     * Returns the list of all security settings in the specified location.
+     * 
+ */ public void listSecuritySettings( com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest request, io.grpc.stub.StreamObserver @@ -476,7 +550,13 @@ public void listSecuritySettings( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public void deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -487,7 +567,13 @@ public void deleteSecuritySettings( } } - /** */ + /** + * + * + *
+   * Service for managing security settings for Dialogflow.
+   * 
+ */ public static final class SecuritySettingsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SecuritySettingsServiceBlockingStub( @@ -501,35 +587,66 @@ protected SecuritySettingsServiceBlockingStub build( return new SecuritySettingsServiceBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Create security settings in the specified location.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.SecuritySettings createSecuritySettings( com.google.cloud.dialogflow.cx.v3.CreateSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getCreateSecuritySettingsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * The returned settings may be stale by up to 1 minute.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.SecuritySettings getSecuritySettings( com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getGetSecuritySettingsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.SecuritySettings updateSecuritySettings( com.google.cloud.dialogflow.cx.v3.UpdateSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getUpdateSecuritySettingsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Returns the list of all security settings in the specified location.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse listSecuritySettings( com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsRequest request) { return blockingUnaryCall( getChannel(), getListSecuritySettingsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public com.google.protobuf.Empty deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request) { return blockingUnaryCall( @@ -537,7 +654,13 @@ public com.google.protobuf.Empty deleteSecuritySettings( } } - /** */ + /** + * + * + *
+   * Service for managing security settings for Dialogflow.
+   * 
+ */ public static final class SecuritySettingsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { private SecuritySettingsServiceFutureStub( @@ -551,7 +674,13 @@ protected SecuritySettingsServiceFutureStub build( return new SecuritySettingsServiceFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Create security settings in the specified location.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SecuritySettings> createSecuritySettings( @@ -560,7 +689,14 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getCreateSecuritySettingsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * The returned settings may be stale by up to 1 minute.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SecuritySettings> getSecuritySettings(com.google.cloud.dialogflow.cx.v3.GetSecuritySettingsRequest request) { @@ -568,7 +704,13 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getGetSecuritySettingsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SecuritySettings> updateSecuritySettings( @@ -577,7 +719,13 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getUpdateSecuritySettingsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Returns the list of all security settings in the specified location.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListSecuritySettingsResponse> listSecuritySettings( @@ -586,7 +734,13 @@ protected SecuritySettingsServiceFutureStub build( getChannel().newCall(getListSecuritySettingsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteSecuritySettings( com.google.cloud.dialogflow.cx.v3.DeleteSecuritySettingsRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java index 883de3134..edb667bdf 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/session_entity_type.proto") @@ -327,10 +333,22 @@ public SessionEntityTypesFutureStub newStub( return SessionEntityTypesFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
+   * 
+ */ public abstract static class SessionEntityTypesImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -339,7 +357,13 @@ public void listSessionEntityTypes( asyncUnimplementedUnaryCall(getListSessionEntityTypesMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -347,7 +371,15 @@ public void getSessionEntityType( asyncUnimplementedUnaryCall(getGetSessionEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -355,7 +387,13 @@ public void createSessionEntityType( asyncUnimplementedUnaryCall(getCreateSessionEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -363,7 +401,13 @@ public void updateSessionEntityType( asyncUnimplementedUnaryCall(getUpdateSessionEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -411,7 +455,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
+   * 
+ */ public static final class SessionEntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private SessionEntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -424,7 +474,13 @@ protected SessionEntityTypesStub build( return new SessionEntityTypesStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -436,7 +492,13 @@ public void listSessionEntityTypes( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -447,7 +509,15 @@ public void getSessionEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -458,7 +528,13 @@ public void createSessionEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -469,7 +545,13 @@ public void updateSessionEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -480,7 +562,13 @@ public void deleteSessionEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
+   * 
+ */ public static final class SessionEntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionEntityTypesBlockingStub( @@ -494,35 +582,67 @@ protected SessionEntityTypesBlockingStub build( return new SessionEntityTypesBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesRequest request) { return blockingUnaryCall( getChannel(), getListSessionEntityTypesMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.SessionEntityType getSessionEntityType( com.google.cloud.dialogflow.cx.v3.GetSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getGetSessionEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.SessionEntityType createSessionEntityType( com.google.cloud.dialogflow.cx.v3.CreateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateSessionEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.SessionEntityType updateSessionEntityType( com.google.cloud.dialogflow.cx.v3.UpdateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateSessionEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public com.google.protobuf.Empty deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request) { return blockingUnaryCall( @@ -530,7 +650,13 @@ public com.google.protobuf.Empty deleteSessionEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3.SessionEntityType].
+   * 
+ */ public static final class SessionEntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionEntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -543,7 +669,13 @@ protected SessionEntityTypesFutureStub build( return new SessionEntityTypesFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListSessionEntityTypesResponse> listSessionEntityTypes( @@ -552,7 +684,13 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getListSessionEntityTypesMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SessionEntityType> getSessionEntityType( @@ -561,7 +699,15 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getGetSessionEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SessionEntityType> createSessionEntityType( @@ -570,7 +716,13 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getCreateSessionEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.SessionEntityType> updateSessionEntityType( @@ -579,7 +731,13 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getUpdateSessionEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3.DeleteSessionEntityTypeRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java index 17c1c3c52..dacd62eeb 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionsGrpc.java @@ -25,7 +25,15 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * A session represents an interaction with a user. You retrieve user input
+ * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
+ * user intent and respond.
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/session.proto") @@ -263,10 +271,27 @@ public SessionsFutureStub newStub( return SessionsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public abstract static class SessionsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public void detectIntent( com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -274,7 +299,15 @@ public void detectIntent( asyncUnimplementedUnaryCall(getDetectIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Processes a natural language query in audio format in a streaming fashion
+     * and returns structured, actionable data as a result. This method is only
+     * available via the gRPC API (not REST).
+     * 
+ */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest> streamingDetectIntent( @@ -284,7 +317,14 @@ public void detectIntent( return asyncUnimplementedStreamingCall(getStreamingDetectIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public void matchIntent( com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -292,7 +332,15 @@ public void matchIntent( asyncUnimplementedUnaryCall(getMatchIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -335,7 +383,15 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public static final class SessionsStub extends io.grpc.stub.AbstractAsyncStub { private SessionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -346,7 +402,16 @@ protected SessionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new SessionsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public void detectIntent( com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -357,7 +422,15 @@ public void detectIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Processes a natural language query in audio format in a streaming fashion
+     * and returns structured, actionable data as a result. This method is only
+     * available via the gRPC API (not REST).
+     * 
+ */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentRequest> streamingDetectIntent( @@ -369,7 +442,14 @@ public void detectIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public void matchIntent( com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -380,7 +460,15 @@ public void matchIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -392,7 +480,15 @@ public void fulfillIntent( } } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public static final class SessionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -404,26 +500,58 @@ protected SessionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new SessionsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse detectIntent( com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request) { return blockingUnaryCall(getChannel(), getDetectIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.MatchIntentResponse matchIntent( com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request) { return blockingUnaryCall(getChannel(), getMatchIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.FulfillIntentResponse fulfillIntent( com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request) { return blockingUnaryCall(getChannel(), getFulfillIntentMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public static final class SessionsFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -435,7 +563,16 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new SessionsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.DetectIntentResponse> detectIntent(com.google.cloud.dialogflow.cx.v3.DetectIntentRequest request) { @@ -443,7 +580,14 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getDetectIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.MatchIntentResponse> matchIntent(com.google.cloud.dialogflow.cx.v3.MatchIntentRequest request) { @@ -451,7 +595,15 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getMatchIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.FulfillIntentResponse> fulfillIntent(com.google.cloud.dialogflow.cx.v3.FulfillIntentRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java index 3345e9194..8ade4caaf 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/transition_route_group.proto") @@ -338,10 +344,22 @@ public TransitionRouteGroupsFutureStub newStub( return TransitionRouteGroupsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+   * 
+ */ public abstract static class TransitionRouteGroupsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -350,7 +368,13 @@ public void listTransitionRouteGroups( asyncUnimplementedUnaryCall(getListTransitionRouteGroupsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -358,7 +382,13 @@ public void getTransitionRouteGroup( asyncUnimplementedUnaryCall(getGetTransitionRouteGroupMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -366,7 +396,13 @@ public void createTransitionRouteGroup( asyncUnimplementedUnaryCall(getCreateTransitionRouteGroupMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -374,7 +410,13 @@ public void updateTransitionRouteGroup( asyncUnimplementedUnaryCall(getUpdateTransitionRouteGroupMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -422,7 +464,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+   * 
+ */ public static final class TransitionRouteGroupsStub extends io.grpc.stub.AbstractAsyncStub { private TransitionRouteGroupsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -435,7 +483,13 @@ protected TransitionRouteGroupsStub build( return new TransitionRouteGroupsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -447,7 +501,13 @@ public void listTransitionRouteGroups( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -458,7 +518,13 @@ public void getTransitionRouteGroup( responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -469,7 +535,13 @@ public void createTransitionRouteGroup( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -480,7 +552,13 @@ public void updateTransitionRouteGroup( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -491,7 +569,13 @@ public void deleteTransitionRouteGroup( } } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+   * 
+ */ public static final class TransitionRouteGroupsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private TransitionRouteGroupsBlockingStub( @@ -505,7 +589,13 @@ protected TransitionRouteGroupsBlockingStub build( return new TransitionRouteGroupsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsRequest request) { @@ -513,28 +603,52 @@ protected TransitionRouteGroupsBlockingStub build( getChannel(), getListTransitionRouteGroupsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.GetTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getGetTransitionRouteGroupMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.CreateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getCreateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.UpdateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getUpdateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public com.google.protobuf.Empty deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request) { return blockingUnaryCall( @@ -542,7 +656,13 @@ public com.google.protobuf.Empty deleteTransitionRouteGroup( } } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+   * 
+ */ public static final class TransitionRouteGroupsFutureStub extends io.grpc.stub.AbstractFutureStub { private TransitionRouteGroupsFutureStub( @@ -556,7 +676,13 @@ protected TransitionRouteGroupsFutureStub build( return new TransitionRouteGroupsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListTransitionRouteGroupsResponse> listTransitionRouteGroups( @@ -565,7 +691,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getListTransitionRouteGroupsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup> getTransitionRouteGroup( @@ -574,7 +706,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getGetTransitionRouteGroupMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup> createTransitionRouteGroup( @@ -583,7 +721,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getCreateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.TransitionRouteGroup> updateTransitionRouteGroup( @@ -592,7 +736,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getUpdateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3.DeleteTransitionRouteGroupRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java index 04ba069f8..08f150886 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/version.proto") @@ -336,10 +342,22 @@ public VersionsFutureStub newStub( return VersionsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
+   * 
+ */ public abstract static class VersionsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public void listVersions( com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -347,35 +365,65 @@ public void listVersions( asyncUnimplementedUnaryCall(getListVersionsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public void getVersion( com.google.cloud.dialogflow.cx.v3.GetVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public void createVersion( com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public void updateVersion( com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public void loadVersion( com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -426,7 +474,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
+   * 
+ */ public static final class VersionsStub extends io.grpc.stub.AbstractAsyncStub { private VersionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -437,7 +491,13 @@ protected VersionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new VersionsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public void listVersions( com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -448,7 +508,13 @@ public void listVersions( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public void getVersion( com.google.cloud.dialogflow.cx.v3.GetVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -456,7 +522,13 @@ public void getVersion( getChannel().newCall(getGetVersionMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public void createVersion( com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -466,7 +538,13 @@ public void createVersion( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public void updateVersion( com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -476,7 +554,13 @@ public void updateVersion( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -486,7 +570,13 @@ public void deleteVersion( responseObserver); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public void loadVersion( com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -497,7 +587,13 @@ public void loadVersion( } } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
+   * 
+ */ public static final class VersionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private VersionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -509,44 +605,86 @@ protected VersionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new VersionsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListVersionsResponse listVersions( com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request) { return blockingUnaryCall(getChannel(), getListVersionsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Version getVersion( com.google.cloud.dialogflow.cx.v3.GetVersionRequest request) { return blockingUnaryCall(getChannel(), getGetVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public com.google.longrunning.Operation createVersion( com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request) { return blockingUnaryCall(getChannel(), getCreateVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Version updateVersion( com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request) { return blockingUnaryCall(getChannel(), getUpdateVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public com.google.protobuf.Empty deleteVersion( com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request) { return blockingUnaryCall(getChannel(), getDeleteVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public com.google.longrunning.Operation loadVersion( com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request) { return blockingUnaryCall(getChannel(), getLoadVersionMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3.Version].
+   * 
+ */ public static final class VersionsFutureStub extends io.grpc.stub.AbstractFutureStub { private VersionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -558,7 +696,13 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new VersionsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListVersionsResponse> listVersions(com.google.cloud.dialogflow.cx.v3.ListVersionsRequest request) { @@ -566,7 +710,13 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListVersionsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Version> getVersion(com.google.cloud.dialogflow.cx.v3.GetVersionRequest request) { @@ -574,14 +724,26 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3.Flow].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture createVersion(com.google.cloud.dialogflow.cx.v3.CreateVersionRequest request) { return futureUnaryCall( getChannel().newCall(getCreateVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Version> updateVersion(com.google.cloud.dialogflow.cx.v3.UpdateVersionRequest request) { @@ -589,14 +751,26 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3.Version].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteVersion(com.google.cloud.dialogflow.cx.v3.DeleteVersionRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture loadVersion(com.google.cloud.dialogflow.cx.v3.LoadVersionRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java index 0848af0b8..4561e9ce5 100644 --- a/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3/webhook.proto") @@ -296,10 +302,22 @@ public WebhooksFutureStub newStub( return WebhooksFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
+   * 
+ */ public abstract static class WebhooksImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -307,28 +325,52 @@ public void listWebhooks( asyncUnimplementedUnaryCall(getListWebhooksMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public void getWebhook( com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetWebhookMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public void createWebhook( com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateWebhookMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateWebhookMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -373,7 +415,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
+   * 
+ */ public static final class WebhooksStub extends io.grpc.stub.AbstractAsyncStub { private WebhooksStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -384,7 +432,13 @@ protected WebhooksStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new WebhooksStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -395,7 +449,13 @@ public void listWebhooks( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public void getWebhook( com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -403,7 +463,13 @@ public void getWebhook( getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public void createWebhook( com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -413,7 +479,13 @@ public void createWebhook( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -423,7 +495,13 @@ public void updateWebhook( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -434,7 +512,13 @@ public void deleteWebhook( } } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
+   * 
+ */ public static final class WebhooksBlockingStub extends io.grpc.stub.AbstractBlockingStub { private WebhooksBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -446,38 +530,74 @@ protected WebhooksBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new WebhooksBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.ListWebhooksResponse listWebhooks( com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request) { return blockingUnaryCall(getChannel(), getListWebhooksMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Webhook getWebhook( com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request) { return blockingUnaryCall(getChannel(), getGetWebhookMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Webhook createWebhook( com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request) { return blockingUnaryCall(getChannel(), getCreateWebhookMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3.Webhook updateWebhook( com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request) { return blockingUnaryCall(getChannel(), getUpdateWebhookMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public com.google.protobuf.Empty deleteWebhook( com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request) { return blockingUnaryCall(getChannel(), getDeleteWebhookMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
+   * 
+ */ public static final class WebhooksFutureStub extends io.grpc.stub.AbstractFutureStub { private WebhooksFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -489,7 +609,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new WebhooksFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.ListWebhooksResponse> listWebhooks(com.google.cloud.dialogflow.cx.v3.ListWebhooksRequest request) { @@ -497,7 +623,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListWebhooksMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Webhook> getWebhook(com.google.cloud.dialogflow.cx.v3.GetWebhookRequest request) { @@ -505,7 +637,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Webhook> createWebhook(com.google.cloud.dialogflow.cx.v3.CreateWebhookRequest request) { @@ -513,7 +651,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getCreateWebhookMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3.Webhook> updateWebhook(com.google.cloud.dialogflow.cx.v3.UpdateWebhookRequest request) { @@ -521,7 +665,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateWebhookMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteWebhook(com.google.cloud.dialogflow.cx.v3.DeleteWebhookRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java index 22bf15373..b1ed19b8f 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/agent.proto") @@ -386,10 +392,22 @@ public AgentsFutureStub newStub( return AgentsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ public abstract static class AgentsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public void listAgents( com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -397,7 +415,13 @@ public void listAgents( asyncUnimplementedUnaryCall(getListAgentsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public void getAgent( com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request, io.grpc.stub.StreamObserver @@ -405,7 +429,13 @@ public void getAgent( asyncUnimplementedUnaryCall(getGetAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public void createAgent( com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request, io.grpc.stub.StreamObserver @@ -413,7 +443,13 @@ public void createAgent( asyncUnimplementedUnaryCall(getCreateAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public void updateAgent( com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request, io.grpc.stub.StreamObserver @@ -421,21 +457,41 @@ public void updateAgent( asyncUnimplementedUnaryCall(getUpdateAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public void exportAgent( com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getExportAgentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -492,7 +548,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ public static final class AgentsStub extends io.grpc.stub.AbstractAsyncStub { private AgentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -503,7 +565,13 @@ protected AgentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpti return new AgentsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public void listAgents( com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request, io.grpc.stub.StreamObserver @@ -512,7 +580,13 @@ public void listAgents( getChannel().newCall(getListAgentsMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public void getAgent( com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request, io.grpc.stub.StreamObserver @@ -521,7 +595,13 @@ public void getAgent( getChannel().newCall(getGetAgentMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public void createAgent( com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request, io.grpc.stub.StreamObserver @@ -532,7 +612,13 @@ public void createAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public void updateAgent( com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request, io.grpc.stub.StreamObserver @@ -543,7 +629,13 @@ public void updateAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public void deleteAgent( com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -553,7 +645,13 @@ public void deleteAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public void exportAgent( com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -563,7 +661,15 @@ public void exportAgent( responseObserver); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public void restoreAgent( com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -574,7 +680,13 @@ public void restoreAgent( } } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ public static final class AgentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private AgentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -586,50 +698,100 @@ protected AgentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new AgentsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse listAgents( com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request) { return blockingUnaryCall(getChannel(), getListAgentsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Agent getAgent( com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request) { return blockingUnaryCall(getChannel(), getGetAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Agent createAgent( com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request) { return blockingUnaryCall(getChannel(), getCreateAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Agent updateAgent( com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request) { return blockingUnaryCall(getChannel(), getUpdateAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public com.google.protobuf.Empty deleteAgent( com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request) { return blockingUnaryCall(getChannel(), getDeleteAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public com.google.longrunning.Operation exportAgent( com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request) { return blockingUnaryCall(getChannel(), getExportAgentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public com.google.longrunning.Operation restoreAgent( com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request) { return blockingUnaryCall(getChannel(), getRestoreAgentMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Agents][google.cloud.dialogflow.cx.v3beta1.Agent].
+   * 
+ */ public static final class AgentsFutureStub extends io.grpc.stub.AbstractFutureStub { private AgentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -641,7 +803,13 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new AgentsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all agents in the specified location.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListAgentsResponse> listAgents(com.google.cloud.dialogflow.cx.v3beta1.ListAgentsRequest request) { @@ -649,14 +817,26 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getListAgentsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Agent> getAgent(com.google.cloud.dialogflow.cx.v3beta1.GetAgentRequest request) { return futureUnaryCall(getChannel().newCall(getGetAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an agent in the specified location.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Agent> createAgent(com.google.cloud.dialogflow.cx.v3beta1.CreateAgentRequest request) { @@ -664,7 +844,13 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getCreateAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Agent> updateAgent(com.google.cloud.dialogflow.cx.v3beta1.UpdateAgentRequest request) { @@ -672,21 +858,41 @@ protected AgentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions ca getChannel().newCall(getUpdateAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteAgent(com.google.cloud.dialogflow.cx.v3beta1.DeleteAgentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Exports the specified agent to a binary file.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture exportAgent(com.google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest request) { return futureUnaryCall( getChannel().newCall(getExportAgentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Restores the specified agent from a binary file.
+     * Replaces the current agent with a new one. Note that all existing resources
+     * in agent (e.g. intents, entity types, flows) will be removed.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture restoreAgent(com.google.cloud.dialogflow.cx.v3beta1.RestoreAgentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java index 2bbee4fbe..d31f19492 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/entity_type.proto") @@ -304,10 +310,22 @@ public EntityTypesFutureStub newStub( return EntityTypesFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ public abstract static class EntityTypesImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -315,7 +333,13 @@ public void listEntityTypes( asyncUnimplementedUnaryCall(getListEntityTypesMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public void getEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -323,7 +347,13 @@ public void getEntityType( asyncUnimplementedUnaryCall(getGetEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public void createEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -331,7 +361,13 @@ public void createEntityType( asyncUnimplementedUnaryCall(getCreateEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -339,7 +375,13 @@ public void updateEntityType( asyncUnimplementedUnaryCall(getUpdateEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -387,7 +429,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ public static final class EntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private EntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -399,7 +447,13 @@ protected EntityTypesStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new EntityTypesStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public void listEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request, io.grpc.stub.StreamObserver @@ -410,7 +464,13 @@ public void listEntityTypes( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public void getEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -421,7 +481,13 @@ public void getEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public void createEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -432,7 +498,13 @@ public void createEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public void updateEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -443,7 +515,13 @@ public void updateEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public void deleteEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -454,7 +532,13 @@ public void deleteEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ public static final class EntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EntityTypesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -467,33 +551,63 @@ protected EntityTypesBlockingStub build( return new EntityTypesBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse listEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request) { return blockingUnaryCall(getChannel(), getListEntityTypesMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.EntityType getEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request) { return blockingUnaryCall(getChannel(), getGetEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.EntityType createEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.EntityType updateEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public com.google.protobuf.Empty deleteEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request) { return blockingUnaryCall( @@ -501,7 +615,13 @@ public com.google.protobuf.Empty deleteEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [EntityTypes][google.cloud.dialogflow.cx.v3beta1.EntityType].
+   * 
+ */ public static final class EntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private EntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -514,7 +634,13 @@ protected EntityTypesFutureStub build( return new EntityTypesFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all entity types in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse> listEntityTypes(com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest request) { @@ -522,7 +648,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getListEntityTypesMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.EntityType> getEntityType(com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest request) { @@ -530,7 +662,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getGetEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an entity type in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.EntityType> createEntityType(com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest request) { @@ -538,7 +676,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getCreateEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.EntityType> updateEntityType(com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest request) { @@ -546,7 +690,13 @@ protected EntityTypesFutureStub build( getChannel().newCall(getUpdateEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteEntityType(com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java index 970ae710a..8b917626f 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/environment.proto") @@ -356,10 +362,22 @@ public EnvironmentsFutureStub newStub( return EnvironmentsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ public abstract static class EnvironmentsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -367,7 +385,13 @@ public void listEnvironments( asyncUnimplementedUnaryCall(getListEnvironmentsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -375,28 +399,52 @@ public void getEnvironment( asyncUnimplementedUnaryCall(getGetEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteEnvironmentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -451,7 +499,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ public static final class EnvironmentsStub extends io.grpc.stub.AbstractAsyncStub { private EnvironmentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -463,7 +517,13 @@ protected EnvironmentsStub build(io.grpc.Channel channel, io.grpc.CallOptions ca return new EnvironmentsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public void listEnvironments( com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request, io.grpc.stub.StreamObserver @@ -474,7 +534,13 @@ public void listEnvironments( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void getEnvironment( com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request, io.grpc.stub.StreamObserver @@ -485,7 +551,13 @@ public void getEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public void createEnvironment( com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -495,7 +567,13 @@ public void createEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void updateEnvironment( com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -505,7 +583,13 @@ public void updateEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void deleteEnvironment( com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -515,7 +599,13 @@ public void deleteEnvironment( responseObserver); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public void lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request, io.grpc.stub.StreamObserver< @@ -528,7 +618,13 @@ public void lookupEnvironmentHistory( } } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ public static final class EnvironmentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private EnvironmentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -541,41 +637,77 @@ protected EnvironmentsBlockingStub build( return new EnvironmentsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse listEnvironments( com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request) { return blockingUnaryCall( getChannel(), getListEnvironmentsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Environment getEnvironment( com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request) { return blockingUnaryCall(getChannel(), getGetEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public com.google.longrunning.Operation createEnvironment( com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getCreateEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.longrunning.Operation updateEnvironment( com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getUpdateEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.protobuf.Empty deleteEnvironment( com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request) { return blockingUnaryCall( getChannel(), getDeleteEnvironmentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse lookupEnvironmentHistory( com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryRequest request) { @@ -584,7 +716,13 @@ public com.google.protobuf.Empty deleteEnvironment( } } - /** */ + /** + * + * + *
+   * Service for managing [Environments][google.cloud.dialogflow.cx.v3beta1.Environment].
+   * 
+ */ public static final class EnvironmentsFutureStub extends io.grpc.stub.AbstractFutureStub { private EnvironmentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -597,7 +735,13 @@ protected EnvironmentsFutureStub build( return new EnvironmentsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all environments in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsResponse> listEnvironments(com.google.cloud.dialogflow.cx.v3beta1.ListEnvironmentsRequest request) { @@ -605,7 +749,13 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getListEnvironmentsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Environment> getEnvironment(com.google.cloud.dialogflow.cx.v3beta1.GetEnvironmentRequest request) { @@ -613,28 +763,52 @@ protected EnvironmentsFutureStub build( getChannel().newCall(getGetEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an [Environment][google.cloud.dialogflow.cx.v3beta1.Environment] in the specified [Agent][google.cloud.dialogflow.cx.v3beta1.Agent].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture createEnvironment(com.google.cloud.dialogflow.cx.v3beta1.CreateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getCreateEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture updateEnvironment(com.google.cloud.dialogflow.cx.v3beta1.UpdateEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getUpdateEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteEnvironment(com.google.cloud.dialogflow.cx.v3beta1.DeleteEnvironmentRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteEnvironmentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Looks up the history of the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.LookupEnvironmentHistoryResponse> lookupEnvironmentHistory( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java index dc32c1aa0..02652bcb6 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/flow.proto") @@ -338,24 +344,48 @@ public FlowsFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return FlowsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ public abstract static class FlowsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public void createFlow( com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public void listFlows( com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -363,21 +393,40 @@ public void listFlows( asyncUnimplementedUnaryCall(getListFlowsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public void getFlow( com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public void updateFlow( com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdateFlowMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ public void trainFlow( com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -428,7 +477,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ public static final class FlowsStub extends io.grpc.stub.AbstractAsyncStub { private FlowsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -439,7 +494,13 @@ protected FlowsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new FlowsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public void createFlow( com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -447,7 +508,13 @@ public void createFlow( getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public void deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -455,7 +522,13 @@ public void deleteFlow( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public void listFlows( com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request, io.grpc.stub.StreamObserver @@ -464,7 +537,13 @@ public void listFlows( getChannel().newCall(getListFlowsMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public void getFlow( com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -472,7 +551,13 @@ public void getFlow( getChannel().newCall(getGetFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public void updateFlow( com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -480,7 +565,14 @@ public void updateFlow( getChannel().newCall(getUpdateFlowMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ public void trainFlow( com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -489,7 +581,13 @@ public void trainFlow( } } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ public static final class FlowsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private FlowsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -501,44 +599,87 @@ protected FlowsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new FlowsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Flow createFlow( com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request) { return blockingUnaryCall(getChannel(), getCreateFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public com.google.protobuf.Empty deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request) { return blockingUnaryCall(getChannel(), getDeleteFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse listFlows( com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request) { return blockingUnaryCall(getChannel(), getListFlowsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Flow getFlow( com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request) { return blockingUnaryCall(getChannel(), getGetFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Flow updateFlow( com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request) { return blockingUnaryCall(getChannel(), getUpdateFlowMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Trains the specified flow. Note that only the flow in 'draft' environment
+     * is trained.
+     * 
+ */ public com.google.longrunning.Operation trainFlow( com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request) { return blockingUnaryCall(getChannel(), getTrainFlowMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Flows][google.cloud.dialogflow.cx.v3beta1.Flow].
+   * 
+ */ public static final class FlowsFutureStub extends io.grpc.stub.AbstractFutureStub { private FlowsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -550,7 +691,13 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new FlowsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Creates a flow in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Flow> createFlow(com.google.cloud.dialogflow.cx.v3beta1.CreateFlowRequest request) { @@ -558,28 +705,52 @@ protected FlowsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreateFlowMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes a specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteFlow( com.google.cloud.dialogflow.cx.v3beta1.DeleteFlowRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteFlowMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Returns the list of all flows in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListFlowsResponse> listFlows(com.google.cloud.dialogflow.cx.v3beta1.ListFlowsRequest request) { return futureUnaryCall(getChannel().newCall(getListFlowsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Flow> getFlow(com.google.cloud.dialogflow.cx.v3beta1.GetFlowRequest request) { return futureUnaryCall(getChannel().newCall(getGetFlowMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Flow> updateFlow(com.google.cloud.dialogflow.cx.v3beta1.UpdateFlowRequest request) { @@ -587,7 +758,14 @@ public com.google.common.util.concurrent.ListenableFuture + * Trains the specified flow. Note that only the flow in 'draft' environment + * is trained. + * + */ public com.google.common.util.concurrent.ListenableFuture trainFlow(com.google.cloud.dialogflow.cx.v3beta1.TrainFlowRequest request) { return futureUnaryCall(getChannel().newCall(getTrainFlowMethod(), getCallOptions()), request); diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java index aa5ce6010..8d49ad05b 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/intent.proto") @@ -296,10 +302,22 @@ public IntentsFutureStub newStub( return IntentsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ public abstract static class IntentsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public void listIntents( com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -307,7 +325,13 @@ public void listIntents( asyncUnimplementedUnaryCall(getListIntentsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public void getIntent( com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request, io.grpc.stub.StreamObserver @@ -315,7 +339,13 @@ public void getIntent( asyncUnimplementedUnaryCall(getGetIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public void createIntent( com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request, io.grpc.stub.StreamObserver @@ -323,7 +353,13 @@ public void createIntent( asyncUnimplementedUnaryCall(getCreateIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public void updateIntent( com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request, io.grpc.stub.StreamObserver @@ -331,7 +367,13 @@ public void updateIntent( asyncUnimplementedUnaryCall(getUpdateIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -376,7 +418,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ public static final class IntentsStub extends io.grpc.stub.AbstractAsyncStub { private IntentsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -387,7 +435,13 @@ protected IntentsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOpt return new IntentsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public void listIntents( com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request, io.grpc.stub.StreamObserver @@ -398,7 +452,13 @@ public void listIntents( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public void getIntent( com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request, io.grpc.stub.StreamObserver @@ -407,7 +467,13 @@ public void getIntent( getChannel().newCall(getGetIntentMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public void createIntent( com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request, io.grpc.stub.StreamObserver @@ -418,7 +484,13 @@ public void createIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public void updateIntent( com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request, io.grpc.stub.StreamObserver @@ -429,7 +501,13 @@ public void updateIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public void deleteIntent( com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -440,7 +518,13 @@ public void deleteIntent( } } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ public static final class IntentsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private IntentsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -452,38 +536,74 @@ protected IntentsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions return new IntentsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse listIntents( com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request) { return blockingUnaryCall(getChannel(), getListIntentsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Intent getIntent( com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request) { return blockingUnaryCall(getChannel(), getGetIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Intent createIntent( com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request) { return blockingUnaryCall(getChannel(), getCreateIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Intent updateIntent( com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request) { return blockingUnaryCall(getChannel(), getUpdateIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public com.google.protobuf.Empty deleteIntent( com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request) { return blockingUnaryCall(getChannel(), getDeleteIntentMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Intents][google.cloud.dialogflow.cx.v3beta1.Intent].
+   * 
+ */ public static final class IntentsFutureStub extends io.grpc.stub.AbstractFutureStub { private IntentsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -495,7 +615,13 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new IntentsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all intents in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListIntentsResponse> listIntents(com.google.cloud.dialogflow.cx.v3beta1.ListIntentsRequest request) { @@ -503,14 +629,26 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getListIntentsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified intent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Intent> getIntent(com.google.cloud.dialogflow.cx.v3beta1.GetIntentRequest request) { return futureUnaryCall(getChannel().newCall(getGetIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an intent in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Intent> createIntent(com.google.cloud.dialogflow.cx.v3beta1.CreateIntentRequest request) { @@ -518,7 +656,13 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getCreateIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified intent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Intent> updateIntent(com.google.cloud.dialogflow.cx.v3beta1.UpdateIntentRequest request) { @@ -526,7 +670,13 @@ protected IntentsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions c getChannel().newCall(getUpdateIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified intent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteIntent(com.google.cloud.dialogflow.cx.v3beta1.DeleteIntentRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java index d6cd0a42b..c96f2ce69 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/page.proto") @@ -295,10 +301,22 @@ public PagesFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions call return PagesFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ public abstract static class PagesImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public void listPages( com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -306,28 +324,52 @@ public void listPages( asyncUnimplementedUnaryCall(getListPagesMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public void getPage( com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getGetPageMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public void createPage( com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreatePageMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public void updatePage( com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getUpdatePageMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public void deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -372,7 +414,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ public static final class PagesStub extends io.grpc.stub.AbstractAsyncStub { private PagesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -383,7 +431,13 @@ protected PagesStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptio return new PagesStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public void listPages( com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request, io.grpc.stub.StreamObserver @@ -392,7 +446,13 @@ public void listPages( getChannel().newCall(getListPagesMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public void getPage( com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -400,7 +460,13 @@ public void getPage( getChannel().newCall(getGetPageMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public void createPage( com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -408,7 +474,13 @@ public void createPage( getChannel().newCall(getCreatePageMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public void updatePage( com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -416,7 +488,13 @@ public void updatePage( getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public void deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -425,7 +503,13 @@ public void deletePage( } } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ public static final class PagesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private PagesBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -437,38 +521,74 @@ protected PagesBlockingStub build(io.grpc.Channel channel, io.grpc.CallOptions c return new PagesBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse listPages( com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request) { return blockingUnaryCall(getChannel(), getListPagesMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Page getPage( com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request) { return blockingUnaryCall(getChannel(), getGetPageMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Page createPage( com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request) { return blockingUnaryCall(getChannel(), getCreatePageMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Page updatePage( com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request) { return blockingUnaryCall(getChannel(), getUpdatePageMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public com.google.protobuf.Empty deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request) { return blockingUnaryCall(getChannel(), getDeletePageMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Pages][google.cloud.dialogflow.cx.v3beta1.Page].
+   * 
+ */ public static final class PagesFutureStub extends io.grpc.stub.AbstractFutureStub { private PagesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -480,21 +600,39 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal return new PagesFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all pages in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListPagesResponse> listPages(com.google.cloud.dialogflow.cx.v3beta1.ListPagesRequest request) { return futureUnaryCall(getChannel().newCall(getListPagesMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified page.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Page> getPage(com.google.cloud.dialogflow.cx.v3beta1.GetPageRequest request) { return futureUnaryCall(getChannel().newCall(getGetPageMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a page in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Page> createPage(com.google.cloud.dialogflow.cx.v3beta1.CreatePageRequest request) { @@ -502,7 +640,13 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getCreatePageMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified page.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Page> updatePage(com.google.cloud.dialogflow.cx.v3beta1.UpdatePageRequest request) { @@ -510,7 +654,13 @@ protected PagesFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions cal getChannel().newCall(getUpdatePageMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified page.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deletePage( com.google.cloud.dialogflow.cx.v3beta1.DeletePageRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java index fa28e15c0..7ebafc045 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/session_entity_type.proto") @@ -327,10 +333,22 @@ public SessionEntityTypesFutureStub newStub( return SessionEntityTypesFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ public abstract static class SessionEntityTypesImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -339,7 +357,13 @@ public void listSessionEntityTypes( asyncUnimplementedUnaryCall(getListSessionEntityTypesMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -347,7 +371,15 @@ public void getSessionEntityType( asyncUnimplementedUnaryCall(getGetSessionEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -355,7 +387,13 @@ public void createSessionEntityType( asyncUnimplementedUnaryCall(getCreateSessionEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -363,7 +401,13 @@ public void updateSessionEntityType( asyncUnimplementedUnaryCall(getUpdateSessionEntityTypeMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -411,7 +455,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ public static final class SessionEntityTypesStub extends io.grpc.stub.AbstractAsyncStub { private SessionEntityTypesStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -424,7 +474,13 @@ protected SessionEntityTypesStub build( return new SessionEntityTypesStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public void listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request, io.grpc.stub.StreamObserver< @@ -436,7 +492,13 @@ public void listSessionEntityTypes( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public void getSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -447,7 +509,15 @@ public void getSessionEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public void createSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -458,7 +528,13 @@ public void createSessionEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public void updateSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request, io.grpc.stub.StreamObserver @@ -469,7 +545,13 @@ public void updateSessionEntityType( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public void deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -480,7 +562,13 @@ public void deleteSessionEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ public static final class SessionEntityTypesBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionEntityTypesBlockingStub( @@ -494,7 +582,13 @@ protected SessionEntityTypesBlockingStub build( return new SessionEntityTypesBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse listSessionEntityTypes( com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesRequest request) { @@ -502,28 +596,54 @@ protected SessionEntityTypesBlockingStub build( getChannel(), getListSessionEntityTypesMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType getSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.GetSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getGetSessionEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType createSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.CreateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getCreateSessionEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType updateSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.UpdateSessionEntityTypeRequest request) { return blockingUnaryCall( getChannel(), getUpdateSessionEntityTypeMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public com.google.protobuf.Empty deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request) { return blockingUnaryCall( @@ -531,7 +651,13 @@ public com.google.protobuf.Empty deleteSessionEntityType( } } - /** */ + /** + * + * + *
+   * Service for managing [SessionEntityTypes][google.cloud.dialogflow.cx.v3beta1.SessionEntityType].
+   * 
+ */ public static final class SessionEntityTypesFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionEntityTypesFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -544,7 +670,13 @@ protected SessionEntityTypesFutureStub build( return new SessionEntityTypesFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all session entity types in the specified session.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListSessionEntityTypesResponse> listSessionEntityTypes( @@ -553,7 +685,13 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getListSessionEntityTypesMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> getSessionEntityType( @@ -562,7 +700,15 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getGetSessionEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a session entity type.
+     * If the specified session entity type already exists, overrides the
+     * session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> createSessionEntityType( @@ -571,7 +717,13 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getCreateSessionEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.SessionEntityType> updateSessionEntityType( @@ -580,7 +732,13 @@ protected SessionEntityTypesFutureStub build( getChannel().newCall(getUpdateSessionEntityTypeMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified session entity type.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteSessionEntityType( com.google.cloud.dialogflow.cx.v3beta1.DeleteSessionEntityTypeRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java index c7e0a98df..ad3ac2aac 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java @@ -25,7 +25,15 @@ import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * A session represents an interaction with a user. You retrieve user input
+ * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+ * user intent and respond.
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/session.proto") @@ -263,10 +271,27 @@ public SessionsFutureStub newStub( return SessionsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public abstract static class SessionsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public void detectIntent( com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -274,7 +299,15 @@ public void detectIntent( asyncUnimplementedUnaryCall(getDetectIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Processes a natural language query in audio format in a streaming fashion
+     * and returns structured, actionable data as a result. This method is only
+     * available via the gRPC API (not REST).
+     * 
+ */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest> streamingDetectIntent( @@ -284,7 +317,14 @@ public void detectIntent( return asyncUnimplementedStreamingCall(getStreamingDetectIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public void matchIntent( com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -292,7 +332,15 @@ public void matchIntent( asyncUnimplementedUnaryCall(getMatchIntentMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -335,7 +383,15 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public static final class SessionsStub extends io.grpc.stub.AbstractAsyncStub { private SessionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -346,7 +402,16 @@ protected SessionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new SessionsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public void detectIntent( com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request, io.grpc.stub.StreamObserver @@ -357,7 +422,15 @@ public void detectIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Processes a natural language query in audio format in a streaming fashion
+     * and returns structured, actionable data as a result. This method is only
+     * available via the gRPC API (not REST).
+     * 
+ */ public io.grpc.stub.StreamObserver< com.google.cloud.dialogflow.cx.v3beta1.StreamingDetectIntentRequest> streamingDetectIntent( @@ -369,7 +442,14 @@ public void detectIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public void matchIntent( com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request, io.grpc.stub.StreamObserver @@ -380,7 +460,15 @@ public void matchIntent( responseObserver); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public void fulfillIntent( com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request, io.grpc.stub.StreamObserver @@ -392,7 +480,15 @@ public void fulfillIntent( } } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public static final class SessionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private SessionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -404,26 +500,58 @@ protected SessionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new SessionsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detectIntent( com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request) { return blockingUnaryCall(getChannel(), getDetectIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse matchIntent( com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request) { return blockingUnaryCall(getChannel(), getMatchIntentMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse fulfillIntent( com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request) { return blockingUnaryCall(getChannel(), getFulfillIntentMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * A session represents an interaction with a user. You retrieve user input
+   * and pass it to the [DetectIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.DetectIntent] method to determine
+   * user intent and respond.
+   * 
+ */ public static final class SessionsFutureStub extends io.grpc.stub.AbstractFutureStub { private SessionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -435,7 +563,16 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new SessionsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Processes a natural language query and returns structured, actionable data
+     * as a result. This method is not idempotent, because it may cause session
+     * entity types to be updated, which in turn might affect results of future
+     * queries.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse> detectIntent(com.google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest request) { @@ -443,7 +580,14 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getDetectIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Returns preliminary intent match results, doesn't change the session
+     * status.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse> matchIntent(com.google.cloud.dialogflow.cx.v3beta1.MatchIntentRequest request) { @@ -451,7 +595,15 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getMatchIntentMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent].
+     * Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3beta1.Sessions.MatchIntent], with input from
+     * [MatchIntentResponse][google.cloud.dialogflow.cx.v3beta1.MatchIntentResponse]. Otherwise, the behavior is undefined.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentResponse> fulfillIntent(com.google.cloud.dialogflow.cx.v3beta1.FulfillIntentRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java index 750119af9..d78032c42 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/transition_route_group.proto") @@ -339,10 +345,22 @@ public TransitionRouteGroupsFutureStub newStub( return TransitionRouteGroupsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ public abstract static class TransitionRouteGroupsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -351,7 +369,13 @@ public void listTransitionRouteGroups( asyncUnimplementedUnaryCall(getListTransitionRouteGroupsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -359,7 +383,13 @@ public void getTransitionRouteGroup( asyncUnimplementedUnaryCall(getGetTransitionRouteGroupMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -367,7 +397,13 @@ public void createTransitionRouteGroup( asyncUnimplementedUnaryCall(getCreateTransitionRouteGroupMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -375,7 +411,13 @@ public void updateTransitionRouteGroup( asyncUnimplementedUnaryCall(getUpdateTransitionRouteGroupMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -423,7 +465,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ public static final class TransitionRouteGroupsStub extends io.grpc.stub.AbstractAsyncStub { private TransitionRouteGroupsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -436,7 +484,13 @@ protected TransitionRouteGroupsStub build( return new TransitionRouteGroupsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public void listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request, io.grpc.stub.StreamObserver< @@ -448,7 +502,13 @@ public void listTransitionRouteGroups( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public void getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -459,7 +519,13 @@ public void getTransitionRouteGroup( responseObserver); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public void createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -470,7 +536,13 @@ public void createTransitionRouteGroup( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public void updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver @@ -481,7 +553,13 @@ public void updateTransitionRouteGroup( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public void deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -492,7 +570,13 @@ public void deleteTransitionRouteGroup( } } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ public static final class TransitionRouteGroupsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private TransitionRouteGroupsBlockingStub( @@ -506,7 +590,13 @@ protected TransitionRouteGroupsBlockingStub build( return new TransitionRouteGroupsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse listTransitionRouteGroups( com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest request) { @@ -514,28 +604,52 @@ protected TransitionRouteGroupsBlockingStub build( getChannel(), getListTransitionRouteGroupsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup getTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.GetTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getGetTransitionRouteGroupMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup createTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.CreateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getCreateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup updateTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.UpdateTransitionRouteGroupRequest request) { return blockingUnaryCall( getChannel(), getUpdateTransitionRouteGroupMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public com.google.protobuf.Empty deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request) { return blockingUnaryCall( @@ -543,7 +657,13 @@ public com.google.protobuf.Empty deleteTransitionRouteGroup( } } - /** */ + /** + * + * + *
+   * Service for managing [TransitionRouteGroups][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+   * 
+ */ public static final class TransitionRouteGroupsFutureStub extends io.grpc.stub.AbstractFutureStub { private TransitionRouteGroupsFutureStub( @@ -557,7 +677,13 @@ protected TransitionRouteGroupsFutureStub build( return new TransitionRouteGroupsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all transition route groups in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsResponse> listTransitionRouteGroups( @@ -566,7 +692,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getListTransitionRouteGroupsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> getTransitionRouteGroup( @@ -575,7 +707,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getGetTransitionRouteGroupMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates an [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] in the specified flow.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> createTransitionRouteGroup( @@ -584,7 +722,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getCreateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup> updateTransitionRouteGroup( @@ -593,7 +737,13 @@ protected TransitionRouteGroupsFutureStub build( getChannel().newCall(getUpdateTransitionRouteGroupMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteTransitionRouteGroup( com.google.cloud.dialogflow.cx.v3beta1.DeleteTransitionRouteGroupRequest request) { diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java index 20f990ccf..66cebc75c 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/version.proto") @@ -341,10 +347,22 @@ public VersionsFutureStub newStub( return VersionsFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ public abstract static class VersionsImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public void listVersions( com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -352,7 +370,13 @@ public void listVersions( asyncUnimplementedUnaryCall(getListVersionsMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public void getVersion( com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request, io.grpc.stub.StreamObserver @@ -360,14 +384,26 @@ public void getVersion( asyncUnimplementedUnaryCall(getGetVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public void createVersion( com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getCreateVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public void updateVersion( com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request, io.grpc.stub.StreamObserver @@ -375,14 +411,26 @@ public void updateVersion( asyncUnimplementedUnaryCall(getUpdateVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getDeleteVersionMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public void loadVersion( com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -434,7 +482,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ public static final class VersionsStub extends io.grpc.stub.AbstractAsyncStub { private VersionsStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -445,7 +499,13 @@ protected VersionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new VersionsStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public void listVersions( com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request, io.grpc.stub.StreamObserver @@ -456,7 +516,13 @@ public void listVersions( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public void getVersion( com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request, io.grpc.stub.StreamObserver @@ -465,7 +531,13 @@ public void getVersion( getChannel().newCall(getGetVersionMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public void createVersion( com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -475,7 +547,13 @@ public void createVersion( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public void updateVersion( com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request, io.grpc.stub.StreamObserver @@ -486,7 +564,13 @@ public void updateVersion( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public void deleteVersion( com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -496,7 +580,13 @@ public void deleteVersion( responseObserver); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public void loadVersion( com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -507,7 +597,13 @@ public void loadVersion( } } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ public static final class VersionsBlockingStub extends io.grpc.stub.AbstractBlockingStub { private VersionsBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -519,44 +615,86 @@ protected VersionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new VersionsBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse listVersions( com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request) { return blockingUnaryCall(getChannel(), getListVersionsMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Version getVersion( com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request) { return blockingUnaryCall(getChannel(), getGetVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public com.google.longrunning.Operation createVersion( com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request) { return blockingUnaryCall(getChannel(), getCreateVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Version updateVersion( com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request) { return blockingUnaryCall(getChannel(), getUpdateVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public com.google.protobuf.Empty deleteVersion( com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request) { return blockingUnaryCall(getChannel(), getDeleteVersionMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public com.google.longrunning.Operation loadVersion( com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request) { return blockingUnaryCall(getChannel(), getLoadVersionMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Versions][google.cloud.dialogflow.cx.v3beta1.Version].
+   * 
+ */ public static final class VersionsFutureStub extends io.grpc.stub.AbstractFutureStub { private VersionsFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -568,7 +706,13 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new VersionsFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all versions in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListVersionsResponse> listVersions(com.google.cloud.dialogflow.cx.v3beta1.ListVersionsRequest request) { @@ -576,7 +720,13 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListVersionsMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Version> getVersion(com.google.cloud.dialogflow.cx.v3beta1.GetVersionRequest request) { @@ -584,14 +734,26 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a [Version][google.cloud.dialogflow.cx.v3beta1.Version] in the specified [Flow][google.cloud.dialogflow.cx.v3beta1.Flow].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture createVersion(com.google.cloud.dialogflow.cx.v3beta1.CreateVersionRequest request) { return futureUnaryCall( getChannel().newCall(getCreateVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Version> updateVersion(com.google.cloud.dialogflow.cx.v3beta1.UpdateVersionRequest request) { @@ -599,14 +761,26 @@ protected VersionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version].
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteVersion(com.google.cloud.dialogflow.cx.v3beta1.DeleteVersionRequest request) { return futureUnaryCall( getChannel().newCall(getDeleteVersionMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Loads a specified version to draft version.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture loadVersion(com.google.cloud.dialogflow.cx.v3beta1.LoadVersionRequest request) { return futureUnaryCall( diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java index fa381f35f..7dacfd048 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksGrpc.java @@ -22,7 +22,13 @@ import static io.grpc.stub.ServerCalls.asyncUnaryCall; import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; -/** */ +/** + * + * + *
+ * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+ * 
+ */ @javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/cloud/dialogflow/cx/v3beta1/webhook.proto") @@ -296,10 +302,22 @@ public WebhooksFutureStub newStub( return WebhooksFutureStub.newStub(factory, channel); } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ public abstract static class WebhooksImplBase implements io.grpc.BindableService { - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -307,7 +325,13 @@ public void listWebhooks( asyncUnimplementedUnaryCall(getListWebhooksMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public void getWebhook( com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request, io.grpc.stub.StreamObserver @@ -315,7 +339,13 @@ public void getWebhook( asyncUnimplementedUnaryCall(getGetWebhookMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public void createWebhook( com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request, io.grpc.stub.StreamObserver @@ -323,7 +353,13 @@ public void createWebhook( asyncUnimplementedUnaryCall(getCreateWebhookMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request, io.grpc.stub.StreamObserver @@ -331,7 +367,13 @@ public void updateWebhook( asyncUnimplementedUnaryCall(getUpdateWebhookMethod(), responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -378,7 +420,13 @@ public final io.grpc.ServerServiceDefinition bindService() { } } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ public static final class WebhooksStub extends io.grpc.stub.AbstractAsyncStub { private WebhooksStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); @@ -389,7 +437,13 @@ protected WebhooksStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp return new WebhooksStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public void listWebhooks( com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request, io.grpc.stub.StreamObserver @@ -400,7 +454,13 @@ public void listWebhooks( responseObserver); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public void getWebhook( com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request, io.grpc.stub.StreamObserver @@ -409,7 +469,13 @@ public void getWebhook( getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request, responseObserver); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public void createWebhook( com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request, io.grpc.stub.StreamObserver @@ -420,7 +486,13 @@ public void createWebhook( responseObserver); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public void updateWebhook( com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request, io.grpc.stub.StreamObserver @@ -431,7 +503,13 @@ public void updateWebhook( responseObserver); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public void deleteWebhook( com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request, io.grpc.stub.StreamObserver responseObserver) { @@ -442,7 +520,13 @@ public void deleteWebhook( } } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ public static final class WebhooksBlockingStub extends io.grpc.stub.AbstractBlockingStub { private WebhooksBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -454,38 +538,74 @@ protected WebhooksBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption return new WebhooksBlockingStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse listWebhooks( com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request) { return blockingUnaryCall(getChannel(), getListWebhooksMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Webhook getWebhook( com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request) { return blockingUnaryCall(getChannel(), getGetWebhookMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Webhook createWebhook( com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request) { return blockingUnaryCall(getChannel(), getCreateWebhookMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public com.google.cloud.dialogflow.cx.v3beta1.Webhook updateWebhook( com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request) { return blockingUnaryCall(getChannel(), getUpdateWebhookMethod(), getCallOptions(), request); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public com.google.protobuf.Empty deleteWebhook( com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request) { return blockingUnaryCall(getChannel(), getDeleteWebhookMethod(), getCallOptions(), request); } } - /** */ + /** + * + * + *
+   * Service for managing [Webhooks][google.cloud.dialogflow.cx.v3beta1.Webhook].
+   * 
+ */ public static final class WebhooksFutureStub extends io.grpc.stub.AbstractFutureStub { private WebhooksFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { @@ -497,7 +617,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions return new WebhooksFutureStub(channel, callOptions); } - /** */ + /** + * + * + *
+     * Returns the list of all webhooks in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksResponse> listWebhooks(com.google.cloud.dialogflow.cx.v3beta1.ListWebhooksRequest request) { @@ -505,7 +631,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getListWebhooksMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Retrieves the specified webhook.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Webhook> getWebhook(com.google.cloud.dialogflow.cx.v3beta1.GetWebhookRequest request) { @@ -513,7 +645,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getGetWebhookMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Creates a webhook in the specified agent.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Webhook> createWebhook(com.google.cloud.dialogflow.cx.v3beta1.CreateWebhookRequest request) { @@ -521,7 +659,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getCreateWebhookMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Updates the specified webhook.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture< com.google.cloud.dialogflow.cx.v3beta1.Webhook> updateWebhook(com.google.cloud.dialogflow.cx.v3beta1.UpdateWebhookRequest request) { @@ -529,7 +673,13 @@ protected WebhooksFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions getChannel().newCall(getUpdateWebhookMethod(), getCallOptions()), request); } - /** */ + /** + * + * + *
+     * Deletes the specified webhook.
+     * 
+ */ public com.google.common.util.concurrent.ListenableFuture deleteWebhook(com.google.cloud.dialogflow.cx.v3beta1.DeleteWebhookRequest request) { return futureUnaryCall( diff --git a/synth.metadata b/synth.metadata index 8a82c5c95..ae359c8a5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ca7389d35c91ba8aae893fbafd68127d1ff535d2", - "internalRef": "345049577" + "sha": "8cfc6c874574b649b4524a4ef6a0651533325a84", + "internalRef": "345067549" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ca7389d35c91ba8aae893fbafd68127d1ff535d2", - "internalRef": "345049577" + "sha": "8cfc6c874574b649b4524a4ef6a0651533325a84", + "internalRef": "345067549" } }, { From 988f7d459becc8d42ae103e4c5b329a588ed35b6 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:33:52 -0800 Subject: [PATCH 6/9] fix: Update gapic-generator-java to 0.0.7 Committer: @miraleung PiperOrigin-RevId: 345476969 Source-Author: Google APIs Source-Date: Thu Dec 3 10:07:32 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 7be2c821dd88109038c55c89f7dd48f092eeab9d Source-Link: https://github.com/googleapis/googleapis/commit/7be2c821dd88109038c55c89f7dd48f092eeab9d --- .../cloud/dialogflow/cx/v3/AgentsClient.java | 13 ++++-------- .../dialogflow/cx/v3/EntityTypesClient.java | 13 ++++-------- .../dialogflow/cx/v3/EnvironmentsClient.java | 13 +++++------- .../cloud/dialogflow/cx/v3/FlowsClient.java | 17 +++++----------- .../cloud/dialogflow/cx/v3/IntentsClient.java | 13 ++++-------- .../cloud/dialogflow/cx/v3/PagesClient.java | 13 ++++-------- .../cx/v3/SecuritySettingsServiceClient.java | 9 ++++----- .../cx/v3/SessionEntityTypesClient.java | 9 ++++----- .../cx/v3/TransitionRouteGroupsClient.java | 9 ++++----- .../dialogflow/cx/v3/VersionsClient.java | 17 +++++----------- .../dialogflow/cx/v3/WebhooksClient.java | 13 ++++-------- .../cx/v3/stub/AgentsStubSettings.java | 3 +-- .../cx/v3/stub/EntityTypesStubSettings.java | 3 +-- .../cx/v3/stub/EnvironmentsStubSettings.java | 5 ++--- .../cx/v3/stub/FlowsStubSettings.java | 3 +-- .../cx/v3/stub/IntentsStubSettings.java | 3 +-- .../cx/v3/stub/PagesStubSettings.java | 3 +-- .../SecuritySettingsServiceStubSettings.java | 3 +-- .../stub/SessionEntityTypesStubSettings.java | 3 +-- .../TransitionRouteGroupsStubSettings.java | 3 +-- .../cx/v3/stub/VersionsStubSettings.java | 3 +-- .../cx/v3/stub/WebhooksStubSettings.java | 3 +-- .../dialogflow/cx/v3beta1/AgentsClient.java | 13 ++++-------- .../cx/v3beta1/EntityTypesClient.java | 13 ++++-------- .../cx/v3beta1/EnvironmentsClient.java | 13 +++++------- .../dialogflow/cx/v3beta1/FlowsClient.java | 17 +++++----------- .../dialogflow/cx/v3beta1/IntentsClient.java | 13 ++++-------- .../dialogflow/cx/v3beta1/PagesClient.java | 13 ++++-------- .../cx/v3beta1/SessionEntityTypesClient.java | 9 ++++----- .../v3beta1/TransitionRouteGroupsClient.java | 9 ++++----- .../dialogflow/cx/v3beta1/VersionsClient.java | 17 +++++----------- .../dialogflow/cx/v3beta1/WebhooksClient.java | 13 ++++-------- .../cx/v3beta1/stub/AgentsStubSettings.java | 3 +-- .../v3beta1/stub/EntityTypesStubSettings.java | 3 +-- .../stub/EnvironmentsStubSettings.java | 5 ++--- .../cx/v3beta1/stub/FlowsStubSettings.java | 3 +-- .../cx/v3beta1/stub/IntentsStubSettings.java | 3 +-- .../cx/v3beta1/stub/PagesStubSettings.java | 3 +-- .../stub/SessionEntityTypesStubSettings.java | 3 +-- .../TransitionRouteGroupsStubSettings.java | 3 +-- .../cx/v3beta1/stub/VersionsStubSettings.java | 3 +-- .../cx/v3beta1/stub/WebhooksStubSettings.java | 3 +-- .../cloud/dialogflow/cx/v3/AgentName.java | 12 +++++------ .../dialogflow/cx/v3/EntityTypeName.java | 14 ++++++------- .../dialogflow/cx/v3/EnvironmentName.java | 14 ++++++------- .../cloud/dialogflow/cx/v3/FlowName.java | 14 ++++++------- .../cloud/dialogflow/cx/v3/IntentName.java | 14 ++++++------- .../cloud/dialogflow/cx/v3/LocationName.java | 10 +++++----- .../cloud/dialogflow/cx/v3/PageName.java | 16 +++++++-------- .../cx/v3/SecuritySettingsName.java | 12 +++++------ .../cx/v3/SessionEntityTypeName.java | 20 +++++++++---------- .../cloud/dialogflow/cx/v3/SessionName.java | 18 ++++++++--------- .../cx/v3/TransitionRouteGroupName.java | 16 +++++++-------- .../cloud/dialogflow/cx/v3/VersionName.java | 16 +++++++-------- .../cloud/dialogflow/cx/v3/WebhookName.java | 14 ++++++------- .../dialogflow/cx/v3beta1/AgentName.java | 12 +++++------ .../dialogflow/cx/v3beta1/EntityTypeName.java | 14 ++++++------- .../cx/v3beta1/EnvironmentName.java | 14 ++++++------- .../cloud/dialogflow/cx/v3beta1/FlowName.java | 14 ++++++------- .../dialogflow/cx/v3beta1/IntentName.java | 14 ++++++------- .../dialogflow/cx/v3beta1/LocationName.java | 10 +++++----- .../cloud/dialogflow/cx/v3beta1/PageName.java | 16 +++++++-------- .../cx/v3beta1/SessionEntityTypeName.java | 20 +++++++++---------- .../dialogflow/cx/v3beta1/SessionName.java | 18 ++++++++--------- .../cx/v3beta1/TransitionRouteGroupName.java | 16 +++++++-------- .../dialogflow/cx/v3beta1/VersionName.java | 16 +++++++-------- .../dialogflow/cx/v3beta1/WebhookName.java | 14 ++++++------- synth.metadata | 8 ++++---- 68 files changed, 301 insertions(+), 411 deletions(-) diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java index ddc46b8fc..2587ee70c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -167,9 +166,7 @@ public final OperationsClient getOperationsClient() { */ public final ListAgentsPagedResponse listAgents(LocationName parent) { ListAgentsRequest request = - ListAgentsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) - .build(); + ListAgentsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listAgents(request); } @@ -227,7 +224,7 @@ public final UnaryCallable listAgentsCall */ public final Agent getAgent(AgentName name) { GetAgentRequest request = - GetAgentRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); + GetAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getAgent(request); } @@ -277,7 +274,7 @@ public final UnaryCallable getAgentCallable() { public final Agent createAgent(LocationName parent, Agent agent) { CreateAgentRequest request = CreateAgentRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setAgent(agent) .build(); return createAgent(request); @@ -365,9 +362,7 @@ public final UnaryCallable updateAgentCallable() { */ public final void deleteAgent(AgentName name) { DeleteAgentRequest request = - DeleteAgentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteAgent(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java index 2bd7d5fcc..c065f82b9 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -155,7 +154,7 @@ public EntityTypesStub getStub() { public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) { ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listEntityTypes(request); } @@ -217,9 +216,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest */ public final EntityType getEntityType(EntityTypeName name) { GetEntityTypeRequest request = - GetEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getEntityType(request); } @@ -270,7 +267,7 @@ public final UnaryCallable getEntityTypeCallab public final EntityType createEntityType(AgentName parent, EntityType entityType) { CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setEntityType(entityType) .build(); return createEntityType(request); @@ -361,9 +358,7 @@ public final UnaryCallable updateEntityType */ public final void deleteEntityType(EntityTypeName name) { DeleteEntityTypeRequest request = - DeleteEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteEntityType(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java index 018f38810..d9b98a192 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -173,7 +172,7 @@ public final OperationsClient getOperationsClient() { public final ListEnvironmentsPagedResponse listEnvironments(AgentName parent) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listEnvironments(request); } @@ -241,9 +240,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ */ public final Environment getEnvironment(EnvironmentName name) { GetEnvironmentRequest request = - GetEnvironmentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetEnvironmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getEnvironment(request); } @@ -297,7 +294,7 @@ public final OperationFuture createEnvironmentAsync( AgentName parent, Environment environment) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setEnvironment(environment) .build(); return createEnvironmentAsync(request); @@ -420,7 +417,7 @@ public final UnaryCallable updateEnvironmen public final void deleteEnvironment(EnvironmentName name) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); deleteEnvironment(request); } @@ -473,7 +470,7 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( EnvironmentName name) { LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); return lookupEnvironmentHistory(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java index 7137c7557..6d5428fee 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -169,7 +168,7 @@ public final OperationsClient getOperationsClient() { public final Flow createFlow(AgentName parent, Flow flow) { CreateFlowRequest request = CreateFlowRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setFlow(flow) .build(); return createFlow(request); @@ -221,9 +220,7 @@ public final UnaryCallable createFlowCallable() { */ public final void deleteFlow(FlowName name) { DeleteFlowRequest request = - DeleteFlowRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteFlow(request); } @@ -271,9 +268,7 @@ public final UnaryCallable deleteFlowCallable() { */ public final ListFlowsPagedResponse listFlows(AgentName parent) { ListFlowsRequest request = - ListFlowsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) - .build(); + ListFlowsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listFlows(request); } @@ -331,7 +326,7 @@ public final UnaryCallable listFlowsCallabl */ public final Flow getFlow(FlowName name) { GetFlowRequest request = - GetFlowRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); + GetFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getFlow(request); } @@ -415,9 +410,7 @@ public final UnaryCallable updateFlowCallable() { */ public final OperationFuture trainFlowAsync(FlowName name) { TrainFlowRequest request = - TrainFlowRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + TrainFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return trainFlowAsync(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java index 486e8f4b4..d2f92b12d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -152,7 +151,7 @@ public IntentsStub getStub() { public final ListIntentsPagedResponse listIntents(AgentName parent) { ListIntentsRequest request = ListIntentsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listIntents(request); } @@ -212,9 +211,7 @@ public final UnaryCallable listIntentsC */ public final Intent getIntent(IntentName name) { GetIntentRequest request = - GetIntentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getIntent(request); } @@ -264,7 +261,7 @@ public final UnaryCallable getIntentCallable() { public final Intent createIntent(AgentName parent, Intent intent) { CreateIntentRequest request = CreateIntentRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setIntent(intent) .build(); return createIntent(request); @@ -352,9 +349,7 @@ public final UnaryCallable updateIntentCallable() { */ public final void deleteIntent(IntentName name) { DeleteIntentRequest request = - DeleteIntentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteIntent(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java index a81e49b7e..8b597eba6 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -151,9 +150,7 @@ public PagesStub getStub() { */ public final ListPagesPagedResponse listPages(FlowName parent) { ListPagesRequest request = - ListPagesRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) - .build(); + ListPagesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listPages(request); } @@ -212,7 +209,7 @@ public final UnaryCallable listPagesCallabl */ public final Page getPage(PageName name) { GetPageRequest request = - GetPageRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); + GetPageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getPage(request); } @@ -263,7 +260,7 @@ public final UnaryCallable getPageCallable() { public final Page createPage(FlowName parent, Page page) { CreatePageRequest request = CreatePageRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setPage(page) .build(); return createPage(request); @@ -352,9 +349,7 @@ public final UnaryCallable updatePageCallable() { */ public final void deletePage(PageName name) { DeletePageRequest request = - DeletePageRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeletePageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deletePage(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java index 1363dd168..c9d5bf0aa 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -162,7 +161,7 @@ public final SecuritySettings createSecuritySettings( LocationName parent, SecuritySettings securitySettings) { CreateSecuritySettingsRequest request = CreateSecuritySettingsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setSecuritySettings(securitySettings) .build(); return createSecuritySettings(request); @@ -222,7 +221,7 @@ public final SecuritySettings createSecuritySettings(CreateSecuritySettingsReque public final SecuritySettings getSecuritySettings(SecuritySettingsName name) { GetSecuritySettingsRequest request = GetSecuritySettingsRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); return getSecuritySettings(request); } @@ -319,7 +318,7 @@ public final SecuritySettings updateSecuritySettings(UpdateSecuritySettingsReque public final ListSecuritySettingsPagedResponse listSecuritySettings(LocationName parent) { ListSecuritySettingsRequest request = ListSecuritySettingsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listSecuritySettings(request); } @@ -385,7 +384,7 @@ public final ListSecuritySettingsPagedResponse listSecuritySettings( public final void deleteSecuritySettings(SecuritySettingsName name) { DeleteSecuritySettingsRequest request = DeleteSecuritySettingsRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); deleteSecuritySettings(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java index 256578c63..11c4e0e70 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -162,7 +161,7 @@ public SessionEntityTypesStub getStub() { public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionName parent) { ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listSessionEntityTypes(request); } @@ -233,7 +232,7 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( public final SessionEntityType getSessionEntityType(SessionEntityTypeName name) { GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); return getSessionEntityType(request); } @@ -296,7 +295,7 @@ public final SessionEntityType createSessionEntityType( SessionName parent, SessionEntityType sessionEntityType) { CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setSessionEntityType(sessionEntityType) .build(); return createSessionEntityType(request); @@ -414,7 +413,7 @@ public final SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRe public final void deleteSessionEntityType(SessionEntityTypeName name) { DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); deleteSessionEntityType(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java index aca1b06c5..ecb1520cc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -160,7 +159,7 @@ public TransitionRouteGroupsStub getStub() { public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(FlowName parent) { ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listTransitionRouteGroups(request); } @@ -229,7 +228,7 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( public final TransitionRouteGroup getTransitionRouteGroup(TransitionRouteGroupName name) { GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); return getTransitionRouteGroup(request); } @@ -292,7 +291,7 @@ public final TransitionRouteGroup createTransitionRouteGroup( FlowName parent, TransitionRouteGroup transitionRouteGroup) { CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setTransitionRouteGroup(transitionRouteGroup) .build(); return createTransitionRouteGroup(request); @@ -403,7 +402,7 @@ public final TransitionRouteGroup updateTransitionRouteGroup( public final void deleteTransitionRouteGroup(TransitionRouteGroupName name) { DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); deleteTransitionRouteGroup(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java index 0f19f98e6..fbf064354 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -170,7 +169,7 @@ public final OperationsClient getOperationsClient() { public final ListVersionsPagedResponse listVersions(FlowName parent) { ListVersionsRequest request = ListVersionsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listVersions(request); } @@ -232,9 +231,7 @@ public final UnaryCallable listVersio */ public final Version getVersion(VersionName name) { GetVersionRequest request = - GetVersionRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getVersion(request); } @@ -288,7 +285,7 @@ public final OperationFuture createVers FlowName parent, Version version) { CreateVersionRequest request = CreateVersionRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setVersion(version) .build(); return createVersionAsync(request); @@ -395,9 +392,7 @@ public final UnaryCallable updateVersionCallable( */ public final void deleteVersion(VersionName name) { DeleteVersionRequest request = - DeleteVersionRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteVersion(request); } @@ -447,9 +442,7 @@ public final UnaryCallable deleteVersionCallable() */ public final OperationFuture loadVersionAsync(VersionName name) { LoadVersionRequest request = - LoadVersionRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + LoadVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return loadVersionAsync(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java index 9856c2fcd..bb3308da3 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -153,7 +152,7 @@ public WebhooksStub getStub() { public final ListWebhooksPagedResponse listWebhooks(AgentName parent) { ListWebhooksRequest request = ListWebhooksRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listWebhooks(request); } @@ -213,9 +212,7 @@ public final UnaryCallable listWebhoo */ public final Webhook getWebhook(WebhookName name) { GetWebhookRequest request = - GetWebhookRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getWebhook(request); } @@ -265,7 +262,7 @@ public final UnaryCallable getWebhookCallable() { public final Webhook createWebhook(AgentName parent, Webhook webhook) { CreateWebhookRequest request = CreateWebhookRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setWebhook(webhook) .build(); return createWebhook(request); @@ -353,9 +350,7 @@ public final UnaryCallable updateWebhookCallable( */ public final void deleteWebhook(WebhookName name) { DeleteWebhookRequest request = - DeleteWebhookRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteWebhook(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java index 3df57023e..173f21d7b 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/AgentsStubSettings.java @@ -63,7 +63,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -151,7 +150,7 @@ public String extractNextToken(ListAgentsResponse payload) { @Override public Iterable extractResources(ListAgentsResponse payload) { - return Objects.isNull(payload.getAgentsList()) + return payload.getAgentsList() == null ? ImmutableList.of() : payload.getAgentsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java index 751d92c19..1e2472785 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EntityTypesStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -141,7 +140,7 @@ public String extractNextToken(ListEntityTypesResponse payload) { @Override public Iterable extractResources(ListEntityTypesResponse payload) { - return Objects.isNull(payload.getEntityTypesList()) + return payload.getEntityTypesList() == null ? ImmutableList.of() : payload.getEntityTypesList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java index ef0e240c7..255e92ce6 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/EnvironmentsStubSettings.java @@ -63,7 +63,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -160,7 +159,7 @@ public String extractNextToken(ListEnvironmentsResponse payload) { @Override public Iterable extractResources(ListEnvironmentsResponse payload) { - return Objects.isNull(payload.getEnvironmentsList()) + return payload.getEnvironmentsList() == null ? ImmutableList.of() : payload.getEnvironmentsList(); } @@ -205,7 +204,7 @@ public String extractNextToken(LookupEnvironmentHistoryResponse payload) { @Override public Iterable extractResources( LookupEnvironmentHistoryResponse payload) { - return Objects.isNull(payload.getEnvironmentsList()) + return payload.getEnvironmentsList() == null ? ImmutableList.of() : payload.getEnvironmentsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java index 02cf29af6..7df591e9c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/FlowsStubSettings.java @@ -61,7 +61,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -145,7 +144,7 @@ public String extractNextToken(ListFlowsResponse payload) { @Override public Iterable extractResources(ListFlowsResponse payload) { - return Objects.isNull(payload.getFlowsList()) + return payload.getFlowsList() == null ? ImmutableList.of() : payload.getFlowsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java index 5bc773043..78a9999da 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/IntentsStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -136,7 +135,7 @@ public String extractNextToken(ListIntentsResponse payload) { @Override public Iterable extractResources(ListIntentsResponse payload) { - return Objects.isNull(payload.getIntentsList()) + return payload.getIntentsList() == null ? ImmutableList.of() : payload.getIntentsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java index 94c042157..446f70bb5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/PagesStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -136,7 +135,7 @@ public String extractNextToken(ListPagesResponse payload) { @Override public Iterable extractResources(ListPagesResponse payload) { - return Objects.isNull(payload.getPagesList()) + return payload.getPagesList() == null ? ImmutableList.of() : payload.getPagesList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java index 400351705..460e733b3 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SecuritySettingsServiceStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -151,7 +150,7 @@ public String extractNextToken(ListSecuritySettingsResponse payload) { @Override public Iterable extractResources( ListSecuritySettingsResponse payload) { - return Objects.isNull(payload.getSecuritySettingsList()) + return payload.getSecuritySettingsList() == null ? ImmutableList.of() : payload.getSecuritySettingsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java index 1a8657bfc..26022ad38 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/SessionEntityTypesStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -152,7 +151,7 @@ public String extractNextToken(ListSessionEntityTypesResponse payload) { @Override public Iterable extractResources( ListSessionEntityTypesResponse payload) { - return Objects.isNull(payload.getSessionEntityTypesList()) + return payload.getSessionEntityTypesList() == null ? ImmutableList.of() : payload.getSessionEntityTypesList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java index 6efad2f46..65e998d4e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/TransitionRouteGroupsStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -157,7 +156,7 @@ public String extractNextToken(ListTransitionRouteGroupsResponse payload) { @Override public Iterable extractResources( ListTransitionRouteGroupsResponse payload) { - return Objects.isNull(payload.getTransitionRouteGroupsList()) + return payload.getTransitionRouteGroupsList() == null ? ImmutableList.of() : payload.getTransitionRouteGroupsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java index dcbb15fda..bbbc4ecc3 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/VersionsStubSettings.java @@ -62,7 +62,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -150,7 +149,7 @@ public String extractNextToken(ListVersionsResponse payload) { @Override public Iterable extractResources(ListVersionsResponse payload) { - return Objects.isNull(payload.getVersionsList()) + return payload.getVersionsList() == null ? ImmutableList.of() : payload.getVersionsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java index cfb726f2c..a2c6f1661 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/WebhooksStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -137,7 +136,7 @@ public String extractNextToken(ListWebhooksResponse payload) { @Override public Iterable extractResources(ListWebhooksResponse payload) { - return Objects.isNull(payload.getWebhooksList()) + return payload.getWebhooksList() == null ? ImmutableList.of() : payload.getWebhooksList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java index fb9dfe06d..93dd9994a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -167,9 +166,7 @@ public final OperationsClient getOperationsClient() { */ public final ListAgentsPagedResponse listAgents(LocationName parent) { ListAgentsRequest request = - ListAgentsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) - .build(); + ListAgentsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listAgents(request); } @@ -227,7 +224,7 @@ public final UnaryCallable listAgentsCall */ public final Agent getAgent(AgentName name) { GetAgentRequest request = - GetAgentRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); + GetAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getAgent(request); } @@ -277,7 +274,7 @@ public final UnaryCallable getAgentCallable() { public final Agent createAgent(LocationName parent, Agent agent) { CreateAgentRequest request = CreateAgentRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setAgent(agent) .build(); return createAgent(request); @@ -365,9 +362,7 @@ public final UnaryCallable updateAgentCallable() { */ public final void deleteAgent(AgentName name) { DeleteAgentRequest request = - DeleteAgentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteAgent(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java index d0aceaa07..4d864998e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -155,7 +154,7 @@ public EntityTypesStub getStub() { public final ListEntityTypesPagedResponse listEntityTypes(AgentName parent) { ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listEntityTypes(request); } @@ -217,9 +216,7 @@ public final ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest */ public final EntityType getEntityType(EntityTypeName name) { GetEntityTypeRequest request = - GetEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getEntityType(request); } @@ -270,7 +267,7 @@ public final UnaryCallable getEntityTypeCallab public final EntityType createEntityType(AgentName parent, EntityType entityType) { CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setEntityType(entityType) .build(); return createEntityType(request); @@ -361,9 +358,7 @@ public final UnaryCallable updateEntityType */ public final void deleteEntityType(EntityTypeName name) { DeleteEntityTypeRequest request = - DeleteEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteEntityType(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java index ae5cbebbf..4c0655f49 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -173,7 +172,7 @@ public final OperationsClient getOperationsClient() { public final ListEnvironmentsPagedResponse listEnvironments(AgentName parent) { ListEnvironmentsRequest request = ListEnvironmentsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listEnvironments(request); } @@ -242,9 +241,7 @@ public final ListEnvironmentsPagedResponse listEnvironments(ListEnvironmentsRequ */ public final Environment getEnvironment(EnvironmentName name) { GetEnvironmentRequest request = - GetEnvironmentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetEnvironmentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getEnvironment(request); } @@ -299,7 +296,7 @@ public final OperationFuture createEnvironmentAsync( AgentName parent, Environment environment) { CreateEnvironmentRequest request = CreateEnvironmentRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setEnvironment(environment) .build(); return createEnvironmentAsync(request); @@ -423,7 +420,7 @@ public final UnaryCallable updateEnvironmen public final void deleteEnvironment(EnvironmentName name) { DeleteEnvironmentRequest request = DeleteEnvironmentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); deleteEnvironment(request); } @@ -478,7 +475,7 @@ public final LookupEnvironmentHistoryPagedResponse lookupEnvironmentHistory( EnvironmentName name) { LookupEnvironmentHistoryRequest request = LookupEnvironmentHistoryRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); return lookupEnvironmentHistory(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java index 2530247b0..7f43e6bfb 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -169,7 +168,7 @@ public final OperationsClient getOperationsClient() { public final Flow createFlow(AgentName parent, Flow flow) { CreateFlowRequest request = CreateFlowRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setFlow(flow) .build(); return createFlow(request); @@ -221,9 +220,7 @@ public final UnaryCallable createFlowCallable() { */ public final void deleteFlow(FlowName name) { DeleteFlowRequest request = - DeleteFlowRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteFlow(request); } @@ -271,9 +268,7 @@ public final UnaryCallable deleteFlowCallable() { */ public final ListFlowsPagedResponse listFlows(AgentName parent) { ListFlowsRequest request = - ListFlowsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) - .build(); + ListFlowsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listFlows(request); } @@ -331,7 +326,7 @@ public final UnaryCallable listFlowsCallabl */ public final Flow getFlow(FlowName name) { GetFlowRequest request = - GetFlowRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); + GetFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getFlow(request); } @@ -415,9 +410,7 @@ public final UnaryCallable updateFlowCallable() { */ public final OperationFuture trainFlowAsync(FlowName name) { TrainFlowRequest request = - TrainFlowRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + TrainFlowRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return trainFlowAsync(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java index 76e866a11..b8bf1b85c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -152,7 +151,7 @@ public IntentsStub getStub() { public final ListIntentsPagedResponse listIntents(AgentName parent) { ListIntentsRequest request = ListIntentsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listIntents(request); } @@ -212,9 +211,7 @@ public final UnaryCallable listIntentsC */ public final Intent getIntent(IntentName name) { GetIntentRequest request = - GetIntentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getIntent(request); } @@ -264,7 +261,7 @@ public final UnaryCallable getIntentCallable() { public final Intent createIntent(AgentName parent, Intent intent) { CreateIntentRequest request = CreateIntentRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setIntent(intent) .build(); return createIntent(request); @@ -352,9 +349,7 @@ public final UnaryCallable updateIntentCallable() { */ public final void deleteIntent(IntentName name) { DeleteIntentRequest request = - DeleteIntentRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteIntent(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java index f3d5c4e5d..21ba2a1bf 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -151,9 +150,7 @@ public PagesStub getStub() { */ public final ListPagesPagedResponse listPages(FlowName parent) { ListPagesRequest request = - ListPagesRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) - .build(); + ListPagesRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); return listPages(request); } @@ -212,7 +209,7 @@ public final UnaryCallable listPagesCallabl */ public final Page getPage(PageName name) { GetPageRequest request = - GetPageRequest.newBuilder().setName(Objects.isNull(name) ? null : name.toString()).build(); + GetPageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getPage(request); } @@ -263,7 +260,7 @@ public final UnaryCallable getPageCallable() { public final Page createPage(FlowName parent, Page page) { CreatePageRequest request = CreatePageRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setPage(page) .build(); return createPage(request); @@ -352,9 +349,7 @@ public final UnaryCallable updatePageCallable() { */ public final void deletePage(PageName name) { DeletePageRequest request = - DeletePageRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeletePageRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deletePage(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java index cd9278e0e..ef3b3394e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -162,7 +161,7 @@ public SessionEntityTypesStub getStub() { public final ListSessionEntityTypesPagedResponse listSessionEntityTypes(SessionName parent) { ListSessionEntityTypesRequest request = ListSessionEntityTypesRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listSessionEntityTypes(request); } @@ -233,7 +232,7 @@ public final ListSessionEntityTypesPagedResponse listSessionEntityTypes( public final SessionEntityType getSessionEntityType(SessionEntityTypeName name) { GetSessionEntityTypeRequest request = GetSessionEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); return getSessionEntityType(request); } @@ -296,7 +295,7 @@ public final SessionEntityType createSessionEntityType( SessionName parent, SessionEntityType sessionEntityType) { CreateSessionEntityTypeRequest request = CreateSessionEntityTypeRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setSessionEntityType(sessionEntityType) .build(); return createSessionEntityType(request); @@ -414,7 +413,7 @@ public final SessionEntityType updateSessionEntityType(UpdateSessionEntityTypeRe public final void deleteSessionEntityType(SessionEntityTypeName name) { DeleteSessionEntityTypeRequest request = DeleteSessionEntityTypeRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); deleteSessionEntityType(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java index 065e3eeba..035b2e922 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -160,7 +159,7 @@ public TransitionRouteGroupsStub getStub() { public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups(FlowName parent) { ListTransitionRouteGroupsRequest request = ListTransitionRouteGroupsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listTransitionRouteGroups(request); } @@ -229,7 +228,7 @@ public final ListTransitionRouteGroupsPagedResponse listTransitionRouteGroups( public final TransitionRouteGroup getTransitionRouteGroup(TransitionRouteGroupName name) { GetTransitionRouteGroupRequest request = GetTransitionRouteGroupRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); return getTransitionRouteGroup(request); } @@ -292,7 +291,7 @@ public final TransitionRouteGroup createTransitionRouteGroup( FlowName parent, TransitionRouteGroup transitionRouteGroup) { CreateTransitionRouteGroupRequest request = CreateTransitionRouteGroupRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setTransitionRouteGroup(transitionRouteGroup) .build(); return createTransitionRouteGroup(request); @@ -403,7 +402,7 @@ public final TransitionRouteGroup updateTransitionRouteGroup( public final void deleteTransitionRouteGroup(TransitionRouteGroupName name) { DeleteTransitionRouteGroupRequest request = DeleteTransitionRouteGroupRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) + .setName(name == null ? null : name.toString()) .build(); deleteTransitionRouteGroup(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java index a707d7793..889728c6d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java @@ -38,7 +38,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -171,7 +170,7 @@ public final OperationsClient getOperationsClient() { public final ListVersionsPagedResponse listVersions(FlowName parent) { ListVersionsRequest request = ListVersionsRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listVersions(request); } @@ -237,9 +236,7 @@ public final UnaryCallable listVersio */ public final Version getVersion(VersionName name) { GetVersionRequest request = - GetVersionRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getVersion(request); } @@ -293,7 +290,7 @@ public final OperationFuture createVers FlowName parent, Version version) { CreateVersionRequest request = CreateVersionRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setVersion(version) .build(); return createVersionAsync(request); @@ -400,9 +397,7 @@ public final UnaryCallable updateVersionCallable( */ public final void deleteVersion(VersionName name) { DeleteVersionRequest request = - DeleteVersionRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteVersion(request); } @@ -452,9 +447,7 @@ public final UnaryCallable deleteVersionCallable() */ public final OperationFuture loadVersionAsync(VersionName name) { LoadVersionRequest request = - LoadVersionRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + LoadVersionRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return loadVersionAsync(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java index e28a038f5..ca9fcf14d 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java @@ -33,7 +33,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; import java.util.List; -import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -153,7 +152,7 @@ public WebhooksStub getStub() { public final ListWebhooksPagedResponse listWebhooks(AgentName parent) { ListWebhooksRequest request = ListWebhooksRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .build(); return listWebhooks(request); } @@ -213,9 +212,7 @@ public final UnaryCallable listWebhoo */ public final Webhook getWebhook(WebhookName name) { GetWebhookRequest request = - GetWebhookRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + GetWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getWebhook(request); } @@ -265,7 +262,7 @@ public final UnaryCallable getWebhookCallable() { public final Webhook createWebhook(AgentName parent, Webhook webhook) { CreateWebhookRequest request = CreateWebhookRequest.newBuilder() - .setParent(Objects.isNull(parent) ? null : parent.toString()) + .setParent(parent == null ? null : parent.toString()) .setWebhook(webhook) .build(); return createWebhook(request); @@ -353,9 +350,7 @@ public final UnaryCallable updateWebhookCallable( */ public final void deleteWebhook(WebhookName name) { DeleteWebhookRequest request = - DeleteWebhookRequest.newBuilder() - .setName(Objects.isNull(name) ? null : name.toString()) - .build(); + DeleteWebhookRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteWebhook(request); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java index a85b671d0..3daccfc7e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/AgentsStubSettings.java @@ -63,7 +63,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -151,7 +150,7 @@ public String extractNextToken(ListAgentsResponse payload) { @Override public Iterable extractResources(ListAgentsResponse payload) { - return Objects.isNull(payload.getAgentsList()) + return payload.getAgentsList() == null ? ImmutableList.of() : payload.getAgentsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java index beb629541..741a49822 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -141,7 +140,7 @@ public String extractNextToken(ListEntityTypesResponse payload) { @Override public Iterable extractResources(ListEntityTypesResponse payload) { - return Objects.isNull(payload.getEntityTypesList()) + return payload.getEntityTypesList() == null ? ImmutableList.of() : payload.getEntityTypesList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java index 6900d2b78..3b444dbfc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EnvironmentsStubSettings.java @@ -63,7 +63,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -160,7 +159,7 @@ public String extractNextToken(ListEnvironmentsResponse payload) { @Override public Iterable extractResources(ListEnvironmentsResponse payload) { - return Objects.isNull(payload.getEnvironmentsList()) + return payload.getEnvironmentsList() == null ? ImmutableList.of() : payload.getEnvironmentsList(); } @@ -205,7 +204,7 @@ public String extractNextToken(LookupEnvironmentHistoryResponse payload) { @Override public Iterable extractResources( LookupEnvironmentHistoryResponse payload) { - return Objects.isNull(payload.getEnvironmentsList()) + return payload.getEnvironmentsList() == null ? ImmutableList.of() : payload.getEnvironmentsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java index b8626367b..70165ad17 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/FlowsStubSettings.java @@ -61,7 +61,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -145,7 +144,7 @@ public String extractNextToken(ListFlowsResponse payload) { @Override public Iterable extractResources(ListFlowsResponse payload) { - return Objects.isNull(payload.getFlowsList()) + return payload.getFlowsList() == null ? ImmutableList.of() : payload.getFlowsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java index c37ce3912..9a59dd958 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/IntentsStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -136,7 +135,7 @@ public String extractNextToken(ListIntentsResponse payload) { @Override public Iterable extractResources(ListIntentsResponse payload) { - return Objects.isNull(payload.getIntentsList()) + return payload.getIntentsList() == null ? ImmutableList.of() : payload.getIntentsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java index bf42997f8..19b518cba 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/PagesStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -136,7 +135,7 @@ public String extractNextToken(ListPagesResponse payload) { @Override public Iterable extractResources(ListPagesResponse payload) { - return Objects.isNull(payload.getPagesList()) + return payload.getPagesList() == null ? ImmutableList.of() : payload.getPagesList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java index 1a27251ce..dc7ab63a5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/SessionEntityTypesStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -152,7 +151,7 @@ public String extractNextToken(ListSessionEntityTypesResponse payload) { @Override public Iterable extractResources( ListSessionEntityTypesResponse payload) { - return Objects.isNull(payload.getSessionEntityTypesList()) + return payload.getSessionEntityTypesList() == null ? ImmutableList.of() : payload.getSessionEntityTypesList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java index b737a48fe..53fe13e76 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/TransitionRouteGroupsStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -157,7 +156,7 @@ public String extractNextToken(ListTransitionRouteGroupsResponse payload) { @Override public Iterable extractResources( ListTransitionRouteGroupsResponse payload) { - return Objects.isNull(payload.getTransitionRouteGroupsList()) + return payload.getTransitionRouteGroupsList() == null ? ImmutableList.of() : payload.getTransitionRouteGroupsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java index 47be991f8..8c149dec2 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/VersionsStubSettings.java @@ -62,7 +62,6 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -150,7 +149,7 @@ public String extractNextToken(ListVersionsResponse payload) { @Override public Iterable extractResources(ListVersionsResponse payload) { - return Objects.isNull(payload.getVersionsList()) + return payload.getVersionsList() == null ? ImmutableList.of() : payload.getVersionsList(); } diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java index 3b300d6ce..3cfb9e995 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/WebhooksStubSettings.java @@ -54,7 +54,6 @@ import com.google.protobuf.Empty; import java.io.IOException; import java.util.List; -import java.util.Objects; import javax.annotation.Generated; import org.threeten.bp.Duration; @@ -137,7 +136,7 @@ public String extractNextToken(ListWebhooksResponse payload) { @Override public Iterable extractResources(ListWebhooksResponse payload) { - return Objects.isNull(payload.getWebhooksList()) + return payload.getWebhooksList() == null ? ImmutableList.of() : payload.getWebhooksList(); } diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java index faccab986..989ecb038 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentName.java @@ -104,7 +104,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (AgentName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -119,17 +119,17 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java index 590e75c6d..5171a11fb 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypeName.java @@ -122,7 +122,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (EntityTypeName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -137,20 +137,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(entityType)) { + if (entityType != null) { fieldMapBuilder.put("entity_type", entityType); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java index 29c9e0271..f1ce80ed6 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentName.java @@ -122,7 +122,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (EnvironmentName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -137,20 +137,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(environment)) { + if (environment != null) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java index 2b8de6862..ed82fedc7 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowName.java @@ -121,7 +121,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (FlowName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -136,20 +136,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java index 66a29b866..e23481cd9 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentName.java @@ -121,7 +121,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (IntentName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -136,20 +136,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(intent)) { + if (intent != null) { fieldMapBuilder.put("intent", intent); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java index 89cacf8ce..0a36f1f10 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/LocationName.java @@ -91,7 +91,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (LocationName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -106,14 +106,14 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java index 5f9be81e5..fb8f17c14 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/PageName.java @@ -133,7 +133,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (PageName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -148,23 +148,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } - if (!Objects.isNull(page)) { + if (page != null) { fieldMapBuilder.put("page", page); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java index b24a8ff36..0e7a849bc 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsName.java @@ -108,7 +108,7 @@ public static List parseList(List formattedStrings public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SecuritySettingsName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -123,17 +123,17 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(securitySettings)) { + if (securitySettings != null) { fieldMapBuilder.put("security_settings", securitySettings); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java index f9765ef7a..14428ef1e 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypeName.java @@ -244,7 +244,7 @@ public static List parseList(List formattedString public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionEntityTypeName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -260,26 +260,26 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(session)) { + if (session != null) { fieldMapBuilder.put("session", session); } - if (!Objects.isNull(entityType)) { + if (entityType != null) { fieldMapBuilder.put("entity_type", entityType); } - if (!Objects.isNull(environment)) { + if (environment != null) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -295,7 +295,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java index e5747929c..d583bbcb2 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionName.java @@ -214,7 +214,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -230,23 +230,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(session)) { + if (session != null) { fieldMapBuilder.put("session", session); } - if (!Objects.isNull(environment)) { + if (environment != null) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -262,7 +262,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java index b410698a9..7f4c1d6f8 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupName.java @@ -133,7 +133,7 @@ public static List parseList(List formattedStr public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (TransitionRouteGroupName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -148,23 +148,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } - if (!Objects.isNull(transitionRouteGroup)) { + if (transitionRouteGroup != null) { fieldMapBuilder.put("transition_route_group", transitionRouteGroup); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java index 6365304d4..3e4937e96 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionName.java @@ -133,7 +133,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (VersionName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -148,23 +148,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } - if (!Objects.isNull(version)) { + if (version != null) { fieldMapBuilder.put("version", version); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java index 5b5418f63..57c0abd47 100644 --- a/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java +++ b/proto-google-cloud-dialogflow-cx-v3/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhookName.java @@ -121,7 +121,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (WebhookName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -136,20 +136,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(webhook)) { + if (webhook != null) { fieldMapBuilder.put("webhook", webhook); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java index 70014f42a..c917368e7 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentName.java @@ -104,7 +104,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (AgentName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -119,17 +119,17 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java index 44212df00..e7c815495 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypeName.java @@ -122,7 +122,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (EntityTypeName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -137,20 +137,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(entityType)) { + if (entityType != null) { fieldMapBuilder.put("entity_type", entityType); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java index 957ba450d..21f3ad2c0 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentName.java @@ -122,7 +122,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (EnvironmentName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -137,20 +137,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(environment)) { + if (environment != null) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java index 13b8ab73d..bdf8742b1 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowName.java @@ -121,7 +121,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (FlowName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -136,20 +136,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java index d7470c66f..d1f44f085 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentName.java @@ -121,7 +121,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (IntentName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -136,20 +136,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(intent)) { + if (intent != null) { fieldMapBuilder.put("intent", intent); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java index bed1bbb99..260decf0e 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/LocationName.java @@ -91,7 +91,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (LocationName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -106,14 +106,14 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java index bf96e47b2..4a06c7142 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PageName.java @@ -133,7 +133,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (PageName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -148,23 +148,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } - if (!Objects.isNull(page)) { + if (page != null) { fieldMapBuilder.put("page", page); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java index 5ecfda594..fdce63a97 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypeName.java @@ -244,7 +244,7 @@ public static List parseList(List formattedString public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionEntityTypeName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -260,26 +260,26 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(session)) { + if (session != null) { fieldMapBuilder.put("session", session); } - if (!Objects.isNull(entityType)) { + if (entityType != null) { fieldMapBuilder.put("entity_type", entityType); } - if (!Objects.isNull(environment)) { + if (environment != null) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -295,7 +295,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java index 7ea36ab03..6fe145f31 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionName.java @@ -214,7 +214,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (SessionName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -230,23 +230,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(session)) { + if (session != null) { fieldMapBuilder.put("session", session); } - if (!Objects.isNull(environment)) { + if (environment != null) { fieldMapBuilder.put("environment", environment); } fieldValuesMap = fieldMapBuilder.build(); @@ -262,7 +262,7 @@ public String getFieldValue(String fieldName) { @Override public String toString() { - return !Objects.isNull(fixedValue) ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); } @Override diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java index ef76ef8b6..05f5ec73c 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupName.java @@ -133,7 +133,7 @@ public static List parseList(List formattedStr public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (TransitionRouteGroupName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -148,23 +148,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } - if (!Objects.isNull(transitionRouteGroup)) { + if (transitionRouteGroup != null) { fieldMapBuilder.put("transition_route_group", transitionRouteGroup); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java index 43633c778..120e80ac6 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionName.java @@ -133,7 +133,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (VersionName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -148,23 +148,23 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(flow)) { + if (flow != null) { fieldMapBuilder.put("flow", flow); } - if (!Objects.isNull(version)) { + if (version != null) { fieldMapBuilder.put("version", version); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java index 06633d7a1..100f6c5ef 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhookName.java @@ -121,7 +121,7 @@ public static List parseList(List formattedStrings) { public static List toStringList(List values) { List list = new ArrayList<>(values.size()); for (WebhookName value : values) { - if (Objects.isNull(value)) { + if (value == null) { list.add(""); } else { list.add(value.toString()); @@ -136,20 +136,20 @@ public static boolean isParsableFrom(String formattedString) { @Override public Map getFieldValuesMap() { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { synchronized (this) { - if (Objects.isNull(fieldValuesMap)) { + if (fieldValuesMap == null) { ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); - if (!Objects.isNull(project)) { + if (project != null) { fieldMapBuilder.put("project", project); } - if (!Objects.isNull(location)) { + if (location != null) { fieldMapBuilder.put("location", location); } - if (!Objects.isNull(agent)) { + if (agent != null) { fieldMapBuilder.put("agent", agent); } - if (!Objects.isNull(webhook)) { + if (webhook != null) { fieldMapBuilder.put("webhook", webhook); } fieldValuesMap = fieldMapBuilder.build(); diff --git a/synth.metadata b/synth.metadata index ae359c8a5..8d1a12f8f 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8cfc6c874574b649b4524a4ef6a0651533325a84", - "internalRef": "345067549" + "sha": "7be2c821dd88109038c55c89f7dd48f092eeab9d", + "internalRef": "345476969" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8cfc6c874574b649b4524a4ef6a0651533325a84", - "internalRef": "345067549" + "sha": "7be2c821dd88109038c55c89f7dd48f092eeab9d", + "internalRef": "345476969" } }, { From 02ae670e9c77514f0ec8e1475d13895354f9a954 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:42:00 -0800 Subject: [PATCH 7/9] chore: update gapic-generator-java to 0.0.8 Committer: @miraleung PiperOrigin-RevId: 346126713 Source-Author: Google APIs Source-Date: Mon Dec 7 10:39:38 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: b8b2f8c288cec1f673bf10aa5008819c1576bf2e Source-Link: https://github.com/googleapis/googleapis/commit/b8b2f8c288cec1f673bf10aa5008819c1576bf2e --- .../dialogflow/cx/v3/AgentsClientTest.java | 44 +++++++++---------- .../cx/v3/EntityTypesClientTest.java | 10 ++--- .../cx/v3/EnvironmentsClientTest.java | 10 ++--- .../dialogflow/cx/v3/FlowsClientTest.java | 10 ++--- .../dialogflow/cx/v3/IntentsClientTest.java | 10 ++--- .../dialogflow/cx/v3/PagesClientTest.java | 10 ++--- .../v3/SecuritySettingsServiceClientTest.java | 20 ++++----- .../dialogflow/cx/v3/SessionsClientTest.java | 4 +- .../v3/TransitionRouteGroupsClientTest.java | 10 ++--- .../dialogflow/cx/v3/VersionsClientTest.java | 10 ++--- .../dialogflow/cx/v3/WebhooksClientTest.java | 10 ++--- .../cx/v3beta1/AgentsClientTest.java | 44 +++++++++---------- .../cx/v3beta1/EntityTypesClientTest.java | 10 ++--- .../cx/v3beta1/EnvironmentsClientTest.java | 10 ++--- .../cx/v3beta1/FlowsClientTest.java | 10 ++--- .../cx/v3beta1/IntentsClientTest.java | 10 ++--- .../cx/v3beta1/PagesClientTest.java | 10 ++--- .../cx/v3beta1/SessionsClientTest.java | 4 +- .../TransitionRouteGroupsClientTest.java | 10 ++--- .../cx/v3beta1/VersionsClientTest.java | 10 ++--- .../cx/v3beta1/WebhooksClientTest.java | 10 ++--- synth.metadata | 8 ++-- 22 files changed, 142 insertions(+), 142 deletions(-) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java index 588e7da9c..262bea6e2 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/AgentsClientTest.java @@ -177,11 +177,11 @@ public void getAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -224,11 +224,11 @@ public void getAgentTest2() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -271,11 +271,11 @@ public void createAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -321,11 +321,11 @@ public void createAgentTest2() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -371,11 +371,11 @@ public void updateAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -498,7 +498,7 @@ public void exportAgentTest() throws Exception { ExportAgentRequest request = ExportAgentRequest.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setAgentUri("agent_uri-1700713166") + .setAgentUri("agentUri1469149223") .build(); ExportAgentResponse actualResponse = client.exportAgentAsync(request).get(); @@ -525,7 +525,7 @@ public void exportAgentExceptionTest() throws Exception { ExportAgentRequest request = ExportAgentRequest.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setAgentUri("agent_uri-1700713166") + .setAgentUri("agentUri1469149223") .build(); client.exportAgentAsync(request).get(); Assert.fail("No exception raised"); diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java index 17aa5d6eb..db0cab2fa 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClientTest.java @@ -175,7 +175,7 @@ public void getEntityTypeTest() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -219,7 +219,7 @@ public void getEntityTypeTest2() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -262,7 +262,7 @@ public void createEntityTypeTest() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -308,7 +308,7 @@ public void createEntityTypeTest2() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -354,7 +354,7 @@ public void updateEntityTypeTest() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java index 200ffb7f3..02846ffa9 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClientTest.java @@ -182,7 +182,7 @@ public void getEnvironmentTest() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -228,7 +228,7 @@ public void getEnvironmentTest2() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -272,7 +272,7 @@ public void createEnvironmentTest() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -327,7 +327,7 @@ public void createEnvironmentTest2() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -382,7 +382,7 @@ public void updateEnvironmentTest() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java index 7792bffac..1e630dd95 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/FlowsClientTest.java @@ -90,7 +90,7 @@ public void createFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -136,7 +136,7 @@ public void createFlowTest2() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -338,7 +338,7 @@ public void getFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -381,7 +381,7 @@ public void getFlowTest2() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -424,7 +424,7 @@ public void updateFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java index e5b8867c0..db2d2dd0b 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/IntentsClientTest.java @@ -175,7 +175,7 @@ public void getIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -220,7 +220,7 @@ public void getIntentTest2() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -265,7 +265,7 @@ public void createIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -313,7 +313,7 @@ public void createIntentTest2() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -361,7 +361,7 @@ public void updateIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java index 02bce500d..ef354691a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/PagesClientTest.java @@ -175,7 +175,7 @@ public void getPageTest() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -220,7 +220,7 @@ public void getPageTest2() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -265,7 +265,7 @@ public void createPageTest() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -313,7 +313,7 @@ public void createPageTest2() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -361,7 +361,7 @@ public void updatePageTest() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java index 16e596863..d36fa7b57 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClientTest.java @@ -89,8 +89,8 @@ public void createSecuritySettingsTest() throws Exception { .setName( SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") .toString()) - .setDisplayName("display_name1615086568") - .setInspectTemplate("inspect_template-159468987") + .setDisplayName("displayName1714148973") + .setInspectTemplate("inspectTemplate-2053620050") .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -136,8 +136,8 @@ public void createSecuritySettingsTest2() throws Exception { .setName( SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") .toString()) - .setDisplayName("display_name1615086568") - .setInspectTemplate("inspect_template-159468987") + .setDisplayName("displayName1714148973") + .setInspectTemplate("inspectTemplate-2053620050") .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -183,8 +183,8 @@ public void getSecuritySettingsTest() throws Exception { .setName( SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") .toString()) - .setDisplayName("display_name1615086568") - .setInspectTemplate("inspect_template-159468987") + .setDisplayName("displayName1714148973") + .setInspectTemplate("inspectTemplate-2053620050") .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -228,8 +228,8 @@ public void getSecuritySettingsTest2() throws Exception { .setName( SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") .toString()) - .setDisplayName("display_name1615086568") - .setInspectTemplate("inspect_template-159468987") + .setDisplayName("displayName1714148973") + .setInspectTemplate("inspectTemplate-2053620050") .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); @@ -271,8 +271,8 @@ public void updateSecuritySettingsTest() throws Exception { .setName( SecuritySettingsName.of("[PROJECT]", "[LOCATION]", "[SECURITY_SETTINGS]") .toString()) - .setDisplayName("display_name1615086568") - .setInspectTemplate("inspect_template-159468987") + .setDisplayName("displayName1714148973") + .setInspectTemplate("inspectTemplate-2053620050") .addAllPurgeDataTypes(new ArrayList()) .build(); mockSecuritySettingsService.addResponse(expectedResponse); diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java index 0414e62c1..d24ca79a0 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/SessionsClientTest.java @@ -86,7 +86,7 @@ public void tearDown() throws Exception { public void detectIntentTest() throws Exception { DetectIntentResponse expectedResponse = DetectIntentResponse.newBuilder() - .setResponseId("response_id1847552473") + .setResponseId("responseId-633138884") .setQueryResult(QueryResult.newBuilder().build()) .setOutputAudio(ByteString.EMPTY) .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) @@ -270,7 +270,7 @@ public void matchIntentExceptionTest() throws Exception { public void fulfillIntentTest() throws Exception { FulfillIntentResponse expectedResponse = FulfillIntentResponse.newBuilder() - .setResponseId("response_id1847552473") + .setResponseId("responseId-633138884") .setQueryResult(QueryResult.newBuilder().build()) .setOutputAudio(ByteString.EMPTY) .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java index a84776e4e..f4e632d90 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClientTest.java @@ -182,7 +182,7 @@ public void getTransitionRouteGroupTest() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -230,7 +230,7 @@ public void getTransitionRouteGroupTest2() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -274,7 +274,7 @@ public void createTransitionRouteGroupTest() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -322,7 +322,7 @@ public void createTransitionRouteGroupTest2() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -370,7 +370,7 @@ public void updateTransitionRouteGroupTest() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java index bfb195824..945d3dcd3 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/VersionsClientTest.java @@ -180,7 +180,7 @@ public void getVersionTest() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -225,7 +225,7 @@ public void getVersionTest2() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -269,7 +269,7 @@ public void createVersionTest() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -324,7 +324,7 @@ public void createVersionTest2() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -379,7 +379,7 @@ public void updateVersionTest() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java index daf085640..87cd03d0d 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3/WebhooksClientTest.java @@ -174,7 +174,7 @@ public void getWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -215,7 +215,7 @@ public void getWebhookTest2() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -256,7 +256,7 @@ public void createWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -300,7 +300,7 @@ public void createWebhookTest2() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -344,7 +344,7 @@ public void updateWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java index a9ad800d1..66d6dc0dd 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClientTest.java @@ -177,11 +177,11 @@ public void getAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -224,11 +224,11 @@ public void getAgentTest2() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -271,11 +271,11 @@ public void createAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -321,11 +321,11 @@ public void createAgentTest2() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -371,11 +371,11 @@ public void updateAgentTest() throws Exception { Agent expectedResponse = Agent.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setDisplayName("display_name1615086568") - .setDefaultLanguageCode("default_language_code856575222") - .setTimeZone("time_zone36848094") + .setDisplayName("displayName1714148973") + .setDefaultLanguageCode("defaultLanguageCode2069633606") + .setTimeZone("timeZone-2077180903") .setDescription("description-1724546052") - .setAvatarUri("avatar_uri-402824826") + .setAvatarUri("avatarUri-428646061") .setSpeechToTextSettings(SpeechToTextSettings.newBuilder().build()) .setStartFlow(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) .setEnableStackdriverLogging(true) @@ -498,7 +498,7 @@ public void exportAgentTest() throws Exception { ExportAgentRequest request = ExportAgentRequest.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setAgentUri("agent_uri-1700713166") + .setAgentUri("agentUri1469149223") .build(); ExportAgentResponse actualResponse = client.exportAgentAsync(request).get(); @@ -525,7 +525,7 @@ public void exportAgentExceptionTest() throws Exception { ExportAgentRequest request = ExportAgentRequest.newBuilder() .setName(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) - .setAgentUri("agent_uri-1700713166") + .setAgentUri("agentUri1469149223") .build(); client.exportAgentAsync(request).get(); Assert.fail("No exception raised"); diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java index eeddf4172..57c97ae89 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClientTest.java @@ -175,7 +175,7 @@ public void getEntityTypeTest() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -219,7 +219,7 @@ public void getEntityTypeTest2() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -262,7 +262,7 @@ public void createEntityTypeTest() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -308,7 +308,7 @@ public void createEntityTypeTest2() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) @@ -354,7 +354,7 @@ public void updateEntityTypeTest() throws Exception { EntityType.newBuilder() .setName( EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllEntities(new ArrayList()) .addAllExcludedPhrases(new ArrayList()) .setEnableFuzzyExtraction(true) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java index 1d0aa0739..5c08ddf49 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClientTest.java @@ -182,7 +182,7 @@ public void getEnvironmentTest() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -228,7 +228,7 @@ public void getEnvironmentTest2() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -272,7 +272,7 @@ public void createEnvironmentTest() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -327,7 +327,7 @@ public void createEnvironmentTest2() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) @@ -382,7 +382,7 @@ public void updateEnvironmentTest() throws Exception { .setName( EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllVersionConfigs(new ArrayList()) .setUpdateTime(Timestamp.newBuilder().build()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java index be72c2da6..0d6a45d82 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClientTest.java @@ -90,7 +90,7 @@ public void createFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -136,7 +136,7 @@ public void createFlowTest2() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -338,7 +338,7 @@ public void getFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -381,7 +381,7 @@ public void getFlowTest2() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) @@ -424,7 +424,7 @@ public void updateFlowTest() throws Exception { Flow expectedResponse = Flow.newBuilder() .setName(FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .addAllTransitionRoutes(new ArrayList()) .addAllEventHandlers(new ArrayList()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java index a69e4a8f0..60452c8e9 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClientTest.java @@ -175,7 +175,7 @@ public void getIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -220,7 +220,7 @@ public void getIntentTest2() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -265,7 +265,7 @@ public void createIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -313,7 +313,7 @@ public void createIntentTest2() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) @@ -361,7 +361,7 @@ public void updateIntentTest() throws Exception { Intent expectedResponse = Intent.newBuilder() .setName(IntentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[INTENT]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTrainingPhrases(new ArrayList()) .addAllParameters(new ArrayList()) .setPriority(-1165461084) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java index 3277d618a..11495dbab 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClientTest.java @@ -175,7 +175,7 @@ public void getPageTest() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -220,7 +220,7 @@ public void getPageTest2() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -265,7 +265,7 @@ public void createPageTest() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -313,7 +313,7 @@ public void createPageTest2() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) @@ -361,7 +361,7 @@ public void updatePageTest() throws Exception { Page.newBuilder() .setName( PageName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[PAGE]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setEntryFulfillment(Fulfillment.newBuilder().build()) .setForm(Form.newBuilder().build()) .addAllTransitionRouteGroups(new ArrayList()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java index cf1b57b2a..94621025a 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClientTest.java @@ -86,7 +86,7 @@ public void tearDown() throws Exception { public void detectIntentTest() throws Exception { DetectIntentResponse expectedResponse = DetectIntentResponse.newBuilder() - .setResponseId("response_id1847552473") + .setResponseId("responseId-633138884") .setQueryResult(QueryResult.newBuilder().build()) .setOutputAudio(ByteString.EMPTY) .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) @@ -270,7 +270,7 @@ public void matchIntentExceptionTest() throws Exception { public void fulfillIntentTest() throws Exception { FulfillIntentResponse expectedResponse = FulfillIntentResponse.newBuilder() - .setResponseId("response_id1847552473") + .setResponseId("responseId-633138884") .setQueryResult(QueryResult.newBuilder().build()) .setOutputAudio(ByteString.EMPTY) .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java index 3ea5aae66..aa6487fa3 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClientTest.java @@ -182,7 +182,7 @@ public void getTransitionRouteGroupTest() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -230,7 +230,7 @@ public void getTransitionRouteGroupTest2() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -274,7 +274,7 @@ public void createTransitionRouteGroupTest() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -322,7 +322,7 @@ public void createTransitionRouteGroupTest2() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); @@ -370,7 +370,7 @@ public void updateTransitionRouteGroupTest() throws Exception { TransitionRouteGroupName.of( "[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[TRANSITION_ROUTE_GROUP]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .addAllTransitionRoutes(new ArrayList()) .build(); mockTransitionRouteGroups.addResponse(expectedResponse); diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java index b9722943d..4811a4ea6 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClientTest.java @@ -180,7 +180,7 @@ public void getVersionTest() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -225,7 +225,7 @@ public void getVersionTest2() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -269,7 +269,7 @@ public void createVersionTest() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -324,7 +324,7 @@ public void createVersionTest2() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -379,7 +379,7 @@ public void updateVersionTest() throws Exception { .setName( VersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]", "[VERSION]") .toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setDescription("description-1724546052") .setNluSettings(NluSettings.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) diff --git a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java index 783f4f859..772973a7f 100644 --- a/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java +++ b/google-cloud-dialogflow-cx/src/test/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClientTest.java @@ -174,7 +174,7 @@ public void getWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -215,7 +215,7 @@ public void getWebhookTest2() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -256,7 +256,7 @@ public void createWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -300,7 +300,7 @@ public void createWebhookTest2() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); @@ -344,7 +344,7 @@ public void updateWebhookTest() throws Exception { Webhook expectedResponse = Webhook.newBuilder() .setName(WebhookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[WEBHOOK]").toString()) - .setDisplayName("display_name1615086568") + .setDisplayName("displayName1714148973") .setTimeout(Duration.newBuilder().build()) .setDisabled(true) .build(); diff --git a/synth.metadata b/synth.metadata index 8d1a12f8f..7e2843a19 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7be2c821dd88109038c55c89f7dd48f092eeab9d", - "internalRef": "345476969" + "sha": "b8b2f8c288cec1f673bf10aa5008819c1576bf2e", + "internalRef": "346126713" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "7be2c821dd88109038c55c89f7dd48f092eeab9d", - "internalRef": "345476969" + "sha": "b8b2f8c288cec1f673bf10aa5008819c1576bf2e", + "internalRef": "346126713" } }, { From d8275023c42b367119627ebc3cd2e82795584f2e Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:47:40 -0800 Subject: [PATCH 8/9] chore: update gapic-generator-java to 0.0.9 Committer: @miraleung PiperOrigin-RevId: 346372957 Source-Author: Google APIs Source-Date: Tue Dec 8 11:37:30 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: 857f70daef9f4c38f042fb3dfb7b8423ae18fd19 Source-Link: https://github.com/googleapis/googleapis/commit/857f70daef9f4c38f042fb3dfb7b8423ae18fd19 --- .../google/cloud/dialogflow/cx/v3/AgentsClient.java | 4 ++-- .../cloud/dialogflow/cx/v3/EntityTypesClient.java | 8 ++++---- .../cloud/dialogflow/cx/v3/EnvironmentsClient.java | 2 +- .../com/google/cloud/dialogflow/cx/v3/FlowsClient.java | 2 +- .../google/cloud/dialogflow/cx/v3/IntentsClient.java | 4 ++-- .../com/google/cloud/dialogflow/cx/v3/PagesClient.java | 4 ++-- .../cx/v3/SecuritySettingsServiceClient.java | 8 ++++---- .../dialogflow/cx/v3/SessionEntityTypesClient.java | 8 ++++---- .../dialogflow/cx/v3/TransitionRouteGroupsClient.java | 8 ++++---- .../google/cloud/dialogflow/cx/v3/VersionsClient.java | 2 +- .../google/cloud/dialogflow/cx/v3/WebhooksClient.java | 4 ++-- .../cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java | 8 ++++++++ .../dialogflow/cx/v3/stub/GrpcEntityTypesStub.java | 10 ++++++++++ .../dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java | 10 ++++++++++ .../cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java | 8 ++++++++ .../cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java | 8 ++++++++ .../cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java | 8 ++++++++ .../cx/v3/stub/GrpcSecuritySettingsServiceStub.java | 10 ++++++++++ .../cx/v3/stub/GrpcSessionEntityTypesStub.java | 10 ++++++++++ .../cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java | 8 ++++++++ .../cx/v3/stub/GrpcTransitionRouteGroupsStub.java | 10 ++++++++++ .../cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java | 8 ++++++++ .../cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java | 8 ++++++++ .../cloud/dialogflow/cx/v3beta1/AgentsClient.java | 4 ++-- .../cloud/dialogflow/cx/v3beta1/EntityTypesClient.java | 8 ++++---- .../dialogflow/cx/v3beta1/EnvironmentsClient.java | 2 +- .../cloud/dialogflow/cx/v3beta1/FlowsClient.java | 2 +- .../cloud/dialogflow/cx/v3beta1/IntentsClient.java | 4 ++-- .../cloud/dialogflow/cx/v3beta1/PagesClient.java | 4 ++-- .../cx/v3beta1/SessionEntityTypesClient.java | 8 ++++---- .../cx/v3beta1/TransitionRouteGroupsClient.java | 8 ++++---- .../cloud/dialogflow/cx/v3beta1/VersionsClient.java | 2 +- .../cloud/dialogflow/cx/v3beta1/WebhooksClient.java | 4 ++-- .../dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java | 8 ++++++++ .../cx/v3beta1/stub/GrpcEntityTypesStub.java | 10 ++++++++++ .../cx/v3beta1/stub/GrpcEnvironmentsStub.java | 10 ++++++++++ .../dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java | 8 ++++++++ .../dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java | 8 ++++++++ .../dialogflow/cx/v3beta1/stub/GrpcPagesStub.java | 8 ++++++++ .../cx/v3beta1/stub/GrpcSessionEntityTypesStub.java | 10 ++++++++++ .../dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java | 8 ++++++++ .../cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java | 10 ++++++++++ .../dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java | 8 ++++++++ .../dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java | 8 ++++++++ synth.metadata | 8 ++++---- 45 files changed, 256 insertions(+), 54 deletions(-) diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java index 2587ee70c..883f81f71 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/AgentsClient.java @@ -321,8 +321,8 @@ public final UnaryCallable createAgentCallable() { * Updates the specified agent. * * @param agent Required. The agent to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Agent updateAgent(Agent agent, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java index c065f82b9..e68c0f94f 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java @@ -261,7 +261,7 @@ public final UnaryCallable getEntityTypeCallab * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entity_type Required. The entity type to create. + * @param entityType Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(AgentName parent, EntityType entityType) { @@ -279,7 +279,7 @@ public final EntityType createEntityType(AgentName parent, EntityType entityType * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entity_type Required. The entity type to create. + * @param entityType Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(String parent, EntityType entityType) { @@ -313,8 +313,8 @@ public final UnaryCallable createEntityType /** * Updates the specified entity type. * - * @param entity_type Required. The entity type to update. - * @param update_mask The mask to control which fields get updated. + * @param entityType Required. The entity type to update. + * @param updateMask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType updateEntityType(EntityType entityType, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java index d9b98a192..dcfa30aa0 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EnvironmentsClient.java @@ -359,7 +359,7 @@ public final UnaryCallable createEnvironmen * Updates the specified [Environment][google.cloud.dialogflow.cx.v3.Environment]. * * @param environment Required. The environment to update. - * @param update_mask Required. The mask to control which fields get updated. + * @param updateMask Required. The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture updateEnvironmentAsync( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java index 6d5428fee..71497dbd2 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/FlowsClient.java @@ -369,7 +369,7 @@ public final UnaryCallable getFlowCallable() { * Updates the specified flow. * * @param flow Required. The flow to update. - * @param update_mask Required. The mask to control which fields get updated. If `update_mask` is + * @param updateMask Required. The mask to control which fields get updated. If `update_mask` is * not specified, an error will be returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java index d2f92b12d..9589c02e6 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/IntentsClient.java @@ -308,8 +308,8 @@ public final UnaryCallable createIntentCallable() { * Updates the specified intent. * * @param intent Required. The intent to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Intent updateIntent(Intent intent, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java index 8b597eba6..7be5669f5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/PagesClient.java @@ -307,8 +307,8 @@ public final UnaryCallable createPageCallable() { * Updates the specified page. * * @param page Required. The page to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Page updatePage(Page page, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java index c9d5bf0aa..7b603ce44 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SecuritySettingsServiceClient.java @@ -154,7 +154,7 @@ public SecuritySettingsServiceStub getStub() { * @param parent Required. The location to create an * [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. Format: * `projects/<Project ID>/locations/<Location ID>`. - * @param security_settings Required. The security settings to create. + * @param securitySettings Required. The security settings to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SecuritySettings createSecuritySettings( @@ -174,7 +174,7 @@ public final SecuritySettings createSecuritySettings( * @param parent Required. The location to create an * [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings] for. Format: * `projects/<Project ID>/locations/<Location ID>`. - * @param security_settings Required. The security settings to create. + * @param securitySettings Required. The security settings to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SecuritySettings createSecuritySettings( @@ -269,9 +269,9 @@ public final SecuritySettings getSecuritySettings(GetSecuritySettingsRequest req /** * Updates the specified [SecuritySettings][google.cloud.dialogflow.cx.v3.SecuritySettings]. * - * @param security_settings Required. [SecuritySettings] object that contains values for each of + * @param securitySettings Required. [SecuritySettings] object that contains values for each of * the fields to update. - * @param update_mask Required. The mask to control which fields get updated. If the mask is not + * @param updateMask Required. The mask to control which fields get updated. If the mask is not * present, all fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java index 11c4e0e70..a692241b5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/SessionEntityTypesClient.java @@ -288,7 +288,7 @@ public final SessionEntityType getSessionEntityType(GetSessionEntityTypeRequest * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param session_entity_type Required. The session entity type to create. + * @param sessionEntityType Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( @@ -312,7 +312,7 @@ public final SessionEntityType createSessionEntityType( * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param session_entity_type Required. The session entity type to create. + * @param sessionEntityType Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( @@ -355,14 +355,14 @@ public final SessionEntityType createSessionEntityType(CreateSessionEntityTypeRe /** * Updates the specified session entity type. * - * @param session_entity_type Required. The session entity type to update. Format: + * @param sessionEntityType Required. The session entity type to update. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>`. If `Environment ID` is not specified, we assume * default 'draft' environment. - * @param update_mask The mask to control which fields get updated. + * @param updateMask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType updateSessionEntityType( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java index ecb1520cc..13807556e 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/TransitionRouteGroupsClient.java @@ -284,7 +284,7 @@ public final TransitionRouteGroup getTransitionRouteGroup( * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transition_route_group Required. The transition route group to create. + * @param transitionRouteGroup Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( @@ -306,7 +306,7 @@ public final TransitionRouteGroup createTransitionRouteGroup( * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup] for. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transition_route_group Required. The transition route group to create. + * @param transitionRouteGroup Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( @@ -349,8 +349,8 @@ public final TransitionRouteGroup createTransitionRouteGroup( * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]. * - * @param transition_route_group Required. The transition route group to update. - * @param update_mask The mask to control which fields get updated. + * @param transitionRouteGroup Required. The transition route group to update. + * @param updateMask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup updateTransitionRouteGroup( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java index fbf064354..6e043c97c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/VersionsClient.java @@ -350,7 +350,7 @@ public final UnaryCallable createVersionCallabl * Updates the specified [Version][google.cloud.dialogflow.cx.v3.Version]. * * @param version Required. The version to update. - * @param update_mask Required. The mask to control which fields get updated. Currently only + * @param updateMask Required. The mask to control which fields get updated. Currently only * `description` and `display_name` can be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java index bb3308da3..ae19f0602 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/WebhooksClient.java @@ -309,8 +309,8 @@ public final UnaryCallable createWebhookCallable( * Updates the specified webhook. * * @param webhook Required. The webhook to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java index cca5894f8..47f4a8ec8 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcAgentsStub.java @@ -144,11 +144,19 @@ public static final GrpcAgentsStub create( AgentsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcAgentsStub(AgentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcAgentsCallableFactory()); } + /** + * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcAgentsStub( AgentsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java index d951188c4..64ec3c7ea 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEntityTypesStub.java @@ -129,11 +129,21 @@ public static final GrpcEntityTypesStub create( EntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEntityTypesStub(EntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEntityTypesCallableFactory()); } + /** + * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEntityTypesStub( EntityTypesStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java index de036e1c3..601fc7468 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcEnvironmentsStub.java @@ -158,11 +158,21 @@ public static final GrpcEnvironmentsStub create( EnvironmentsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEnvironmentsStub(EnvironmentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEnvironmentsCallableFactory()); } + /** + * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEnvironmentsStub( EnvironmentsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java index c72f56163..6d07ec3dc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcFlowsStub.java @@ -130,11 +130,19 @@ public static final GrpcFlowsStub create( FlowsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcFlowsStub(FlowsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcFlowsCallableFactory()); } + /** + * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcFlowsStub( FlowsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java index f84636d20..55ca6f342 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcIntentsStub.java @@ -118,11 +118,19 @@ public static final GrpcIntentsStub create( IntentsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcIntentsStub(IntentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcIntentsCallableFactory()); } + /** + * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcIntentsStub( IntentsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java index fffec43f3..b52f66cfd 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcPagesStub.java @@ -116,11 +116,19 @@ public static final GrpcPagesStub create( PagesStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcPagesStub(PagesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcPagesCallableFactory()); } + /** + * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcPagesStub( PagesStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java index c6489d91b..920c68bb4 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSecuritySettingsServiceStub.java @@ -139,12 +139,22 @@ public static final GrpcSecuritySettingsServiceStub create( SecuritySettingsServiceStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcSecuritySettingsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcSecuritySettingsServiceStub( SecuritySettingsServiceStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSecuritySettingsServiceCallableFactory()); } + /** + * Constructs an instance of GrpcSecuritySettingsServiceStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcSecuritySettingsServiceStub( SecuritySettingsServiceStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java index a8535750e..53a22136c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionEntityTypesStub.java @@ -142,11 +142,21 @@ public static final GrpcSessionEntityTypesStub create( SessionEntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionEntityTypesCallableFactory()); } + /** + * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java index 14527090a..d40d66ca8 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcSessionsStub.java @@ -115,11 +115,19 @@ public static final GrpcSessionsStub create( SessionsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcSessionsStub(SessionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionsCallableFactory()); } + /** + * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcSessionsStub( SessionsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java index ed5c22720..00bb534c4 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcTransitionRouteGroupsStub.java @@ -146,11 +146,21 @@ public static final GrpcTransitionRouteGroupsStub create( TransitionRouteGroupsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcTransitionRouteGroupsCallableFactory()); } + /** + * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java index 3b781baec..ea32efd63 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcVersionsStub.java @@ -139,11 +139,19 @@ public static final GrpcVersionsStub create( VersionsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcVersionsStub(VersionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcVersionsCallableFactory()); } + /** + * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcVersionsStub( VersionsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java index a2ef507b3..8ba87efee 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/stub/GrpcWebhooksStub.java @@ -122,11 +122,19 @@ public static final GrpcWebhooksStub create( WebhooksStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcWebhooksStub(WebhooksStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcWebhooksCallableFactory()); } + /** + * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcWebhooksStub( WebhooksStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java index 93dd9994a..41c7c8ebc 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/AgentsClient.java @@ -321,8 +321,8 @@ public final UnaryCallable createAgentCallable() { * Updates the specified agent. * * @param agent Required. The agent to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Agent updateAgent(Agent agent, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java index 4d864998e..621a86e16 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EntityTypesClient.java @@ -261,7 +261,7 @@ public final UnaryCallable getEntityTypeCallab * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entity_type Required. The entity type to create. + * @param entityType Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(AgentName parent, EntityType entityType) { @@ -279,7 +279,7 @@ public final EntityType createEntityType(AgentName parent, EntityType entityType * * @param parent Required. The agent to create a entity type for. Format: `projects/<Project * ID>/locations/<Location ID>/agents/<Agent ID>`. - * @param entity_type Required. The entity type to create. + * @param entityType Required. The entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType createEntityType(String parent, EntityType entityType) { @@ -313,8 +313,8 @@ public final UnaryCallable createEntityType /** * Updates the specified entity type. * - * @param entity_type Required. The entity type to update. - * @param update_mask The mask to control which fields get updated. + * @param entityType Required. The entity type to update. + * @param updateMask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final EntityType updateEntityType(EntityType entityType, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java index 4c0655f49..4e698d3f6 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/EnvironmentsClient.java @@ -361,7 +361,7 @@ public final UnaryCallable createEnvironmen * Updates the specified [Environment][google.cloud.dialogflow.cx.v3beta1.Environment]. * * @param environment Required. The environment to update. - * @param update_mask Required. The mask to control which fields get updated. + * @param updateMask Required. The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final OperationFuture updateEnvironmentAsync( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java index 7f43e6bfb..23117a2a8 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/FlowsClient.java @@ -369,7 +369,7 @@ public final UnaryCallable getFlowCallable() { * Updates the specified flow. * * @param flow Required. The flow to update. - * @param update_mask Required. The mask to control which fields get updated. If `update_mask` is + * @param updateMask Required. The mask to control which fields get updated. If `update_mask` is * not specified, an error will be returned. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java index b8bf1b85c..261ffdf6c 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/IntentsClient.java @@ -308,8 +308,8 @@ public final UnaryCallable createIntentCallable() { * Updates the specified intent. * * @param intent Required. The intent to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Intent updateIntent(Intent intent, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java index 21ba2a1bf..246ba5ed5 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/PagesClient.java @@ -307,8 +307,8 @@ public final UnaryCallable createPageCallable() { * Updates the specified page. * * @param page Required. The page to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Page updatePage(Page page, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java index ef3b3394e..a031cbe21 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionEntityTypesClient.java @@ -288,7 +288,7 @@ public final SessionEntityType getSessionEntityType(GetSessionEntityTypeRequest * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param session_entity_type Required. The session entity type to create. + * @param sessionEntityType Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( @@ -312,7 +312,7 @@ public final SessionEntityType createSessionEntityType( * ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location * ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session * ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. - * @param session_entity_type Required. The session entity type to create. + * @param sessionEntityType Required. The session entity type to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType createSessionEntityType( @@ -355,14 +355,14 @@ public final SessionEntityType createSessionEntityType(CreateSessionEntityTypeRe /** * Updates the specified session entity type. * - * @param session_entity_type Required. The session entity type to update. Format: + * @param sessionEntityType Required. The session entity type to update. Format: * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or * `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/environments/<Environment ID>/sessions/<Session * ID>/entityTypes/<Entity Type ID>`. If `Environment ID` is not specified, we assume * default 'draft' environment. - * @param update_mask The mask to control which fields get updated. + * @param updateMask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SessionEntityType updateSessionEntityType( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java index 035b2e922..9d99d6894 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/TransitionRouteGroupsClient.java @@ -284,7 +284,7 @@ public final TransitionRouteGroup getTransitionRouteGroup( * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transition_route_group Required. The transition route group to create. + * @param transitionRouteGroup Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( @@ -306,7 +306,7 @@ public final TransitionRouteGroup createTransitionRouteGroup( * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup] for. * Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent * ID>/flows/<Flow ID>`. - * @param transition_route_group Required. The transition route group to create. + * @param transitionRouteGroup Required. The transition route group to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup createTransitionRouteGroup( @@ -349,8 +349,8 @@ public final TransitionRouteGroup createTransitionRouteGroup( * Updates the specified * [TransitionRouteGroup][google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup]. * - * @param transition_route_group Required. The transition route group to update. - * @param update_mask The mask to control which fields get updated. + * @param transitionRouteGroup Required. The transition route group to update. + * @param updateMask The mask to control which fields get updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final TransitionRouteGroup updateTransitionRouteGroup( diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java index 889728c6d..6446f5708 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/VersionsClient.java @@ -355,7 +355,7 @@ public final UnaryCallable createVersionCallabl * Updates the specified [Version][google.cloud.dialogflow.cx.v3beta1.Version]. * * @param version Required. The version to update. - * @param update_mask Required. The mask to control which fields get updated. Currently only + * @param updateMask Required. The mask to control which fields get updated. Currently only * `description` and `display_name` can be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java index ca9fcf14d..b0a44e5d7 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/WebhooksClient.java @@ -309,8 +309,8 @@ public final UnaryCallable createWebhookCallable( * Updates the specified webhook. * * @param webhook Required. The webhook to update. - * @param update_mask The mask to control which fields get updated. If the mask is not present, - * all fields will be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Webhook updateWebhook(Webhook webhook, FieldMask updateMask) { diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java index c5b505c9f..a8afd6d19 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcAgentsStub.java @@ -144,11 +144,19 @@ public static final GrpcAgentsStub create( AgentsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcAgentsStub(AgentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcAgentsCallableFactory()); } + /** + * Constructs an instance of GrpcAgentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcAgentsStub( AgentsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java index 8117758d2..980ecd845 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEntityTypesStub.java @@ -129,11 +129,21 @@ public static final GrpcEntityTypesStub create( EntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEntityTypesStub(EntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEntityTypesCallableFactory()); } + /** + * Constructs an instance of GrpcEntityTypesStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEntityTypesStub( EntityTypesStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java index 739c3d4c1..f5fe09034 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcEnvironmentsStub.java @@ -161,11 +161,21 @@ public static final GrpcEnvironmentsStub create( EnvironmentsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEnvironmentsStub(EnvironmentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcEnvironmentsCallableFactory()); } + /** + * Constructs an instance of GrpcEnvironmentsStub, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ protected GrpcEnvironmentsStub( EnvironmentsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java index cea391dfb..a55275c88 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcFlowsStub.java @@ -130,11 +130,19 @@ public static final GrpcFlowsStub create( FlowsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcFlowsStub(FlowsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcFlowsCallableFactory()); } + /** + * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcFlowsStub( FlowsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java index 85f225fd5..d6c143678 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcIntentsStub.java @@ -118,11 +118,19 @@ public static final GrpcIntentsStub create( IntentsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcIntentsStub(IntentsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcIntentsCallableFactory()); } + /** + * Constructs an instance of GrpcIntentsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcIntentsStub( IntentsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java index 710e7d633..3f3170f1a 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcPagesStub.java @@ -116,11 +116,19 @@ public static final GrpcPagesStub create( PagesStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcPagesStub(PagesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcPagesCallableFactory()); } + /** + * Constructs an instance of GrpcPagesStub, using the given settings. This is protected so that it + * is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcPagesStub( PagesStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java index cc747bb8a..858cfcc04 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionEntityTypesStub.java @@ -142,11 +142,21 @@ public static final GrpcSessionEntityTypesStub create( SessionEntityTypesStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionEntityTypesCallableFactory()); } + /** + * Constructs an instance of GrpcSessionEntityTypesStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcSessionEntityTypesStub( SessionEntityTypesStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java index 94945987c..211e04241 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcSessionsStub.java @@ -116,11 +116,19 @@ public static final GrpcSessionsStub create( SessionsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcSessionsStub(SessionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcSessionsCallableFactory()); } + /** + * Constructs an instance of GrpcSessionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcSessionsStub( SessionsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java index 91fb5d1ab..983c4dcfa 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcTransitionRouteGroupsStub.java @@ -146,11 +146,21 @@ public static final GrpcTransitionRouteGroupsStub create( TransitionRouteGroupsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcTransitionRouteGroupsCallableFactory()); } + /** + * Constructs an instance of GrpcTransitionRouteGroupsStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ protected GrpcTransitionRouteGroupsStub( TransitionRouteGroupsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java index 258ebc0f6..3422b9a34 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcVersionsStub.java @@ -139,11 +139,19 @@ public static final GrpcVersionsStub create( VersionsStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcVersionsStub(VersionsStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcVersionsCallableFactory()); } + /** + * Constructs an instance of GrpcVersionsStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcVersionsStub( VersionsStubSettings settings, ClientContext clientContext, diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java index faa226bfa..e0de461bb 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/GrpcWebhooksStub.java @@ -122,11 +122,19 @@ public static final GrpcWebhooksStub create( WebhooksStubSettings.newBuilder().build(), clientContext, callableFactory); } + /** + * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcWebhooksStub(WebhooksStubSettings settings, ClientContext clientContext) throws IOException { this(settings, clientContext, new GrpcWebhooksCallableFactory()); } + /** + * Constructs an instance of GrpcWebhooksStub, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ protected GrpcWebhooksStub( WebhooksStubSettings settings, ClientContext clientContext, diff --git a/synth.metadata b/synth.metadata index 7e2843a19..da99289b5 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b8b2f8c288cec1f673bf10aa5008819c1576bf2e", - "internalRef": "346126713" + "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19", + "internalRef": "346372957" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "b8b2f8c288cec1f673bf10aa5008819c1576bf2e", - "internalRef": "346126713" + "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19", + "internalRef": "346372957" } }, { From c7ffbf4e6ba7e014503d3400678aea2030de5160 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Fri, 11 Dec 2020 18:50:04 -0800 Subject: [PATCH 9/9] feat: allowed custom to specify webhook headers through query parameters docs: suggested to always use version for production traffic when calling DetectIntent PiperOrigin-RevId: 346434847 Source-Author: Google APIs Source-Date: Tue Dec 8 16:24:31 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: e4d01555afeb93d2f3b467056ea884b092567d1b Source-Link: https://github.com/googleapis/googleapis/commit/e4d01555afeb93d2f3b467056ea884b092567d1b --- .../dialogflow/cx/v3beta1/SessionsClient.java | 9 + .../dialogflow/cx/v3beta1/SessionsGrpc.java | 18 + .../cx/v3beta1/DetectIntentRequest.java | 21 + .../v3beta1/DetectIntentRequestOrBuilder.java | 6 + .../cx/v3beta1/QueryParameters.java | 407 ++ .../cx/v3beta1/QueryParametersOrBuilder.java | 89 + .../cx/v3beta1/ResponseMessage.java | 4880 ++++++++--------- .../cx/v3beta1/ResponseMessageProto.java | 68 +- .../dialogflow/cx/v3beta1/SessionProto.java | 247 +- .../v3beta1/StreamingDetectIntentRequest.java | 21 + ...StreamingDetectIntentRequestOrBuilder.java | 6 + .../cx/v3beta1/response_message.proto | 38 +- .../cloud/dialogflow/cx/v3beta1/session.proto | 26 + synth.metadata | 8 +- 14 files changed, 3233 insertions(+), 2611 deletions(-) diff --git a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java index 1494cea1c..9c58e1f25 100644 --- a/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java +++ b/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsClient.java @@ -139,6 +139,9 @@ public SessionsStub getStub() { * method is not idempotent, because it may cause session entity types to be updated, which in * turn might affect results of future queries. * + *

Note: Always use agent versions for production traffic. See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ @@ -152,6 +155,9 @@ public final DetectIntentResponse detectIntent(DetectIntentRequest request) { * method is not idempotent, because it may cause session entity types to be updated, which in * turn might affect results of future queries. * + *

Note: Always use agent versions for production traffic. See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * *

Sample code: */ public final UnaryCallable detectIntentCallable() { @@ -164,6 +170,9 @@ public final UnaryCallable detectInte * structured, actionable data as a result. This method is only available via the gRPC API (not * REST). * + *

Note: Always use agent versions for production traffic. See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). + * *

Sample code: */ public final BidiStreamingCallable diff --git a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java index ad3ac2aac..0fcea04c1 100644 --- a/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java +++ b/grpc-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionsGrpc.java @@ -290,6 +290,9 @@ public abstract static class SessionsImplBase implements io.grpc.BindableService * as a result. This method is not idempotent, because it may cause session * entity types to be updated, which in turn might affect results of future * queries. + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * */ public void detectIntent( @@ -306,6 +309,9 @@ public void detectIntent( * Processes a natural language query in audio format in a streaming fashion * and returns structured, actionable data as a result. This method is only * available via the gRPC API (not REST). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * */ public io.grpc.stub.StreamObserver< @@ -410,6 +416,9 @@ protected SessionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp * as a result. This method is not idempotent, because it may cause session * entity types to be updated, which in turn might affect results of future * queries. + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * */ public void detectIntent( @@ -429,6 +438,9 @@ public void detectIntent( * Processes a natural language query in audio format in a streaming fashion * and returns structured, actionable data as a result. This method is only * available via the gRPC API (not REST). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * */ public io.grpc.stub.StreamObserver< @@ -508,6 +520,9 @@ protected SessionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption * as a result. This method is not idempotent, because it may cause session * entity types to be updated, which in turn might affect results of future * queries. + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * */ public com.google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse detectIntent( @@ -571,6 +586,9 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions * as a result. This method is not idempotent, because it may cause session * entity types to be updated, which in turn might affect results of future * queries. + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * */ public com.google.common.util.concurrent.ListenableFuture< diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequest.java index ae90df790..bd285892d 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequest.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequest.java @@ -179,6 +179,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * @@ -214,6 +217,9 @@ public java.lang.String getSession() { * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * @@ -805,6 +811,9 @@ public Builder mergeFrom( * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * @@ -839,6 +848,9 @@ public java.lang.String getSession() { * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * @@ -873,6 +885,9 @@ public com.google.protobuf.ByteString getSessionBytes() { * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * @@ -906,6 +921,9 @@ public Builder setSession(java.lang.String value) { * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * @@ -935,6 +953,9 @@ public Builder clearSession() { * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequestOrBuilder.java index 777218531..6c5a1da3d 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequestOrBuilder.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/DetectIntentRequestOrBuilder.java @@ -38,6 +38,9 @@ public interface DetectIntentRequestOrBuilder * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * @@ -62,6 +65,9 @@ public interface DetectIntentRequestOrBuilder * The length of the `Session ID` must not exceed 36 characters. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParameters.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParameters.java index 1b53c5605..4bacb3ae3 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParameters.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParameters.java @@ -141,6 +141,23 @@ private QueryParameters( analyzeQueryTextSentiment_ = input.readBool(); break; } + case 82: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + webhookHeaders_ = + com.google.protobuf.MapField.newMapField( + WebhookHeadersDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry webhookHeaders__ = + input.readMessage( + WebhookHeadersDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + webhookHeaders_ + .getMutableMap() + .put(webhookHeaders__.getKey(), webhookHeaders__.getValue()); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -168,6 +185,17 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor; } + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetWebhookHeaders(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -525,6 +553,135 @@ public boolean getAnalyzeQueryTextSentiment() { return analyzeQueryTextSentiment_; } + public static final int WEBHOOK_HEADERS_FIELD_NUMBER = 10; + + private static final class WebhookHeadersDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.dialogflow.cx.v3beta1.SessionProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_WebhookHeadersEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + private com.google.protobuf.MapField webhookHeaders_; + + private com.google.protobuf.MapField + internalGetWebhookHeaders() { + if (webhookHeaders_ == null) { + return com.google.protobuf.MapField.emptyMapField( + WebhookHeadersDefaultEntryHolder.defaultEntry); + } + return webhookHeaders_; + } + + public int getWebhookHeadersCount() { + return internalGetWebhookHeaders().getMap().size(); + } + /** + * + * + *

+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public boolean containsWebhookHeaders(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetWebhookHeaders().getMap().containsKey(key); + } + /** Use {@link #getWebhookHeadersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getWebhookHeaders() { + return getWebhookHeadersMap(); + } + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public java.util.Map getWebhookHeadersMap() { + return internalGetWebhookHeaders().getMap(); + } + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public java.lang.String getWebhookHeadersOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetWebhookHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public java.lang.String getWebhookHeadersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetWebhookHeaders().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -557,6 +714,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (analyzeQueryTextSentiment_ != false) { output.writeBool(8, analyzeQueryTextSentiment_); } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetWebhookHeaders(), WebhookHeadersDefaultEntryHolder.defaultEntry, 10); unknownFields.writeTo(output); } @@ -585,6 +744,16 @@ public int getSerializedSize() { if (analyzeQueryTextSentiment_ != false) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, analyzeQueryTextSentiment_); } + for (java.util.Map.Entry entry : + internalGetWebhookHeaders().getMap().entrySet()) { + com.google.protobuf.MapEntry webhookHeaders__ = + WebhookHeadersDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, webhookHeaders__); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -616,6 +785,7 @@ public boolean equals(final java.lang.Object obj) { if (!getParameters().equals(other.getParameters())) return false; } if (getAnalyzeQueryTextSentiment() != other.getAnalyzeQueryTextSentiment()) return false; + if (!internalGetWebhookHeaders().equals(other.internalGetWebhookHeaders())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -647,6 +817,10 @@ public int hashCode() { } hash = (37 * hash) + ANALYZE_QUERY_TEXT_SENTIMENT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAnalyzeQueryTextSentiment()); + if (!internalGetWebhookHeaders().getMap().isEmpty()) { + hash = (37 * hash) + WEBHOOK_HEADERS_FIELD_NUMBER; + hash = (53 * hash) + internalGetWebhookHeaders().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -766,6 +940,26 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { .internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor; } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField(int number) { + switch (number) { + case 10: + return internalGetWebhookHeaders(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField(int number) { + switch (number) { + case 10: + return internalGetMutableWebhookHeaders(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { @@ -823,6 +1017,7 @@ public Builder clear() { } analyzeQueryTextSentiment_ = false; + internalGetMutableWebhookHeaders().clear(); return this; } @@ -877,6 +1072,8 @@ public com.google.cloud.dialogflow.cx.v3beta1.QueryParameters buildPartial() { result.parameters_ = parametersBuilder_.build(); } result.analyzeQueryTextSentiment_ = analyzeQueryTextSentiment_; + result.webhookHeaders_ = internalGetWebhookHeaders(); + result.webhookHeaders_.makeImmutable(); onBuilt(); return result; } @@ -970,6 +1167,7 @@ public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.QueryParameters if (other.getAnalyzeQueryTextSentiment() != false) { setAnalyzeQueryTextSentiment(other.getAnalyzeQueryTextSentiment()); } + internalGetMutableWebhookHeaders().mergeFrom(other.internalGetWebhookHeaders()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2297,6 +2495,215 @@ public Builder clearAnalyzeQueryTextSentiment() { return this; } + private com.google.protobuf.MapField webhookHeaders_; + + private com.google.protobuf.MapField + internalGetWebhookHeaders() { + if (webhookHeaders_ == null) { + return com.google.protobuf.MapField.emptyMapField( + WebhookHeadersDefaultEntryHolder.defaultEntry); + } + return webhookHeaders_; + } + + private com.google.protobuf.MapField + internalGetMutableWebhookHeaders() { + onChanged(); + ; + if (webhookHeaders_ == null) { + webhookHeaders_ = + com.google.protobuf.MapField.newMapField(WebhookHeadersDefaultEntryHolder.defaultEntry); + } + if (!webhookHeaders_.isMutable()) { + webhookHeaders_ = webhookHeaders_.copy(); + } + return webhookHeaders_; + } + + public int getWebhookHeadersCount() { + return internalGetWebhookHeaders().getMap().size(); + } + /** + * + * + *
+     * This field can be used to pass HTTP headers for a webhook
+     * call. These headers will be sent to webhook along with the headers that
+     * have been configured through Dialogflow web console. The headers defined
+     * within this field will overwrite the headers configured through Dialogflow
+     * console if there is a conflict. Header names are case-insensitive.
+     * Google's specified headers are not allowed. Including: "Host",
+     * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+     * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+     * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public boolean containsWebhookHeaders(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + return internalGetWebhookHeaders().getMap().containsKey(key); + } + /** Use {@link #getWebhookHeadersMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getWebhookHeaders() { + return getWebhookHeadersMap(); + } + /** + * + * + *
+     * This field can be used to pass HTTP headers for a webhook
+     * call. These headers will be sent to webhook along with the headers that
+     * have been configured through Dialogflow web console. The headers defined
+     * within this field will overwrite the headers configured through Dialogflow
+     * console if there is a conflict. Header names are case-insensitive.
+     * Google's specified headers are not allowed. Including: "Host",
+     * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+     * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+     * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public java.util.Map getWebhookHeadersMap() { + return internalGetWebhookHeaders().getMap(); + } + /** + * + * + *
+     * This field can be used to pass HTTP headers for a webhook
+     * call. These headers will be sent to webhook along with the headers that
+     * have been configured through Dialogflow web console. The headers defined
+     * within this field will overwrite the headers configured through Dialogflow
+     * console if there is a conflict. Header names are case-insensitive.
+     * Google's specified headers are not allowed. Including: "Host",
+     * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+     * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+     * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public java.lang.String getWebhookHeadersOrDefault( + java.lang.String key, java.lang.String defaultValue) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetWebhookHeaders().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * This field can be used to pass HTTP headers for a webhook
+     * call. These headers will be sent to webhook along with the headers that
+     * have been configured through Dialogflow web console. The headers defined
+     * within this field will overwrite the headers configured through Dialogflow
+     * console if there is a conflict. Header names are case-insensitive.
+     * Google's specified headers are not allowed. Including: "Host",
+     * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+     * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+     * 
+ * + * map<string, string> webhook_headers = 10; + */ + @java.lang.Override + public java.lang.String getWebhookHeadersOrThrow(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + java.util.Map map = internalGetWebhookHeaders().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearWebhookHeaders() { + internalGetMutableWebhookHeaders().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * This field can be used to pass HTTP headers for a webhook
+     * call. These headers will be sent to webhook along with the headers that
+     * have been configured through Dialogflow web console. The headers defined
+     * within this field will overwrite the headers configured through Dialogflow
+     * console if there is a conflict. Header names are case-insensitive.
+     * Google's specified headers are not allowed. Including: "Host",
+     * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+     * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+     * 
+ * + * map<string, string> webhook_headers = 10; + */ + public Builder removeWebhookHeaders(java.lang.String key) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableWebhookHeaders().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableWebhookHeaders() { + return internalGetMutableWebhookHeaders().getMutableMap(); + } + /** + * + * + *
+     * This field can be used to pass HTTP headers for a webhook
+     * call. These headers will be sent to webhook along with the headers that
+     * have been configured through Dialogflow web console. The headers defined
+     * within this field will overwrite the headers configured through Dialogflow
+     * console if there is a conflict. Header names are case-insensitive.
+     * Google's specified headers are not allowed. Including: "Host",
+     * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+     * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+     * 
+ * + * map<string, string> webhook_headers = 10; + */ + public Builder putWebhookHeaders(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + internalGetMutableWebhookHeaders().getMutableMap().put(key, value); + return this; + } + /** + * + * + *
+     * This field can be used to pass HTTP headers for a webhook
+     * call. These headers will be sent to webhook along with the headers that
+     * have been configured through Dialogflow web console. The headers defined
+     * within this field will overwrite the headers configured through Dialogflow
+     * console if there is a conflict. Header names are case-insensitive.
+     * Google's specified headers are not allowed. Including: "Host",
+     * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+     * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+     * 
+ * + * map<string, string> webhook_headers = 10; + */ + public Builder putAllWebhookHeaders(java.util.Map values) { + internalGetMutableWebhookHeaders().getMutableMap().putAll(values); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParametersOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParametersOrBuilder.java index bf4c5c493..25f0f3901 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParametersOrBuilder.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/QueryParametersOrBuilder.java @@ -289,4 +289,93 @@ com.google.cloud.dialogflow.cx.v3beta1.SessionEntityTypeOrBuilder getSessionEnti * @return The analyzeQueryTextSentiment. */ boolean getAnalyzeQueryTextSentiment(); + + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + int getWebhookHeadersCount(); + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + boolean containsWebhookHeaders(java.lang.String key); + /** Use {@link #getWebhookHeadersMap()} instead. */ + @java.lang.Deprecated + java.util.Map getWebhookHeaders(); + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + java.util.Map getWebhookHeadersMap(); + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + java.lang.String getWebhookHeadersOrDefault(java.lang.String key, java.lang.String defaultValue); + /** + * + * + *
+   * This field can be used to pass HTTP headers for a webhook
+   * call. These headers will be sent to webhook along with the headers that
+   * have been configured through Dialogflow web console. The headers defined
+   * within this field will overwrite the headers configured through Dialogflow
+   * console if there is a conflict. Header names are case-insensitive.
+   * Google's specified headers are not allowed. Including: "Host",
+   * "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding",
+   * "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc.
+   * 
+ * + * map<string, string> webhook_headers = 10; + */ + java.lang.String getWebhookHeadersOrThrow(java.lang.String key); } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessage.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessage.java index c48702eea..c37b6cd79 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessage.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessage.java @@ -3926,111 +3926,81 @@ public com.google.protobuf.Parser getParserForType() { } } - public interface MixedAudioOrBuilder + public interface PlayAudioOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) com.google.protobuf.MessageOrBuilder { /** * * *
-     * Segments this audio response is composed of.
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
      * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - java.util.List - getSegmentsList(); - /** - * - * - *
-     * Segments this audio response is composed of.
-     * 
+ * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * @return The audioUri. */ - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( - int index); + java.lang.String getAudioUri(); /** * * *
-     * Segments this audio response is composed of.
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
      * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - int getSegmentsCount(); - /** - * - * - *
-     * Segments this audio response is composed of.
-     * 
+ * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * @return The bytes for audioUri. */ - java.util.List< - ? extends - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> - getSegmentsOrBuilderList(); + com.google.protobuf.ByteString getAudioUriBytes(); + /** * * *
-     * Segments this audio response is composed of.
+     * Output only. Whether the playback of this message can be interrupted by the end
+     * user's speech and the client can then starts the next Dialogflow
+     * request.
      * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * + * + * @return The allowPlaybackInterruption. */ - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder - getSegmentsOrBuilder(int index); + boolean getAllowPlaybackInterruption(); } /** * * *
-   * Represents an audio message that is composed of both segments
-   * synthesized from the Dialogflow agent prompts and ones hosted externally
-   * at the specified URIs.
-   * The external URIs are specified via
-   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
-   * This message is generated by Dialogflow only and not supposed to be
-   * defined by the user.
+   * Specifies an audio clip to be played by the client as part of the response.
    * 
* - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} */ - public static final class MixedAudio extends com.google.protobuf.GeneratedMessageV3 + public static final class PlayAudio extends com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) - MixedAudioOrBuilder { + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + PlayAudioOrBuilder { private static final long serialVersionUID = 0L; - // Use MixedAudio.newBuilder() to construct. - private MixedAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + // Use PlayAudio.newBuilder() to construct. + private PlayAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private MixedAudio() { - segments_ = java.util.Collections.emptyList(); + private PlayAudio() { + audioUri_ = ""; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new MixedAudio(); + return new PlayAudio(); } @java.lang.Override @@ -4038,7 +4008,7 @@ public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } - private MixedAudio( + private PlayAudio( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4046,7 +4016,6 @@ private MixedAudio( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -4059,18 +4028,14 @@ private MixedAudio( break; case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - segments_ = - new java.util.ArrayList< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - .Segment>(); - mutable_bitField0_ |= 0x00000001; - } - segments_.add( - input.readMessage( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - .parser(), - extensionRegistry)); + java.lang.String s = input.readStringRequireUtf8(); + + audioUri_ = s; + break; + } + case 16: + { + allowPlaybackInterruption_ = input.readBool(); break; } default: @@ -4087,9 +4052,6 @@ private MixedAudio( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - segments_ = java.util.Collections.unmodifiableList(segments_); - } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -4097,1279 +4059,876 @@ private MixedAudio( public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder.class); + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder.class); } - public interface SegmentOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-       * Raw audio synthesized from the Dialogflow agent's response using
-       * the output config specified in the request.
-       * 
- * - * bytes audio = 1; - * - * @return The audio. - */ - com.google.protobuf.ByteString getAudio(); - - /** - * - * - *
-       * Client-specific URI that points to an audio clip accessible to the
-       * client. Dialogflow does not impose any validation on it.
-       * 
- * - * string uri = 2; - * - * @return The uri. - */ - java.lang.String getUri(); - /** - * - * - *
-       * Client-specific URI that points to an audio clip accessible to the
-       * client. Dialogflow does not impose any validation on it.
-       * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - com.google.protobuf.ByteString getUriBytes(); - - /** - * - * - *
-       * Output only. Whether the playback of this segment can be interrupted by the end
-       * user's speech and the client should then start the next Dialogflow
-       * request.
-       * 
- * - * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The allowPlaybackInterruption. - */ - boolean getAllowPlaybackInterruption(); - - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.ContentCase - getContentCase(); - } + public static final int AUDIO_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object audioUri_; /** * * *
-     * Represents one segment of audio.
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
      * 
* - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The audioUri. */ - public static final class Segment extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) - SegmentOrBuilder { - private static final long serialVersionUID = 0L; - // Use Segment.newBuilder() to construct. - private Segment(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private Segment() {} - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new Segment(); + @java.lang.Override + public java.lang.String getAudioUri() { + java.lang.Object ref = audioUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audioUri_ = s; + return s; } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + } + /** + * + * + *
+     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+     * value. It is specific to the client that reads it.
+     * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for audioUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAudioUriBytes() { + java.lang.Object ref = audioUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audioUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } - private Segment( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - contentCase_ = 1; - content_ = input.readBytes(); - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); - contentCase_ = 2; - content_ = s; - break; - } - case 24: - { - allowPlaybackInterruption_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e) - .setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 2; + private boolean allowPlaybackInterruption_; + /** + * + * + *
+     * Output only. Whether the playback of this message can be interrupted by the end
+     * user's speech and the client can then starts the next Dialogflow
+     * request.
+     * 
+ * + * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getAudioUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, audioUri_); + } + if (allowPlaybackInterruption_ != false) { + output.writeBool(2, allowPlaybackInterruption_); } + unknownFields.writeTo(output); + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAudioUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, audioUri_); + } + if (allowPlaybackInterruption_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowPlaybackInterruption_); } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - .class); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) obj; - private int contentCase_ = 0; - private java.lang.Object content_; + if (!getAudioUri().equals(other.getAudioUri())) return false; + if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - public enum ContentCase - implements - com.google.protobuf.Internal.EnumLite, - com.google.protobuf.AbstractMessage.InternalOneOfEnum { - AUDIO(1), - URI(2), - CONTENT_NOT_SET(0); - private final int value; + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + AUDIO_URI_FIELD_NUMBER; + hash = (53 * hash) + getAudioUri().hashCode(); + hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - private ContentCase(int value) { - this.value = value; - } - /** - * @param value The number of the enum to look for. - * @return The enum associated with the given number. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static ContentCase valueOf(int value) { - return forNumber(value); - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - public static ContentCase forNumber(int value) { - switch (value) { - case 1: - return AUDIO; - case 2: - return URI; - case 0: - return CONTENT_NOT_SET; - default: - return null; - } - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public int getNumber() { - return this.value; - } - }; + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - public ContentCase getContentCase() { - return ContentCase.forNumber(contentCase_); - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public static final int AUDIO_FIELD_NUMBER = 1; - /** - * - * - *
-       * Raw audio synthesized from the Dialogflow agent's response using
-       * the output config specified in the request.
-       * 
- * - * bytes audio = 1; - * - * @return The audio. - */ - @java.lang.Override - public com.google.protobuf.ByteString getAudio() { - if (contentCase_ == 1) { - return (com.google.protobuf.ByteString) content_; - } - return com.google.protobuf.ByteString.EMPTY; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - public static final int URI_FIELD_NUMBER = 2; - /** - * - * - *
-       * Client-specific URI that points to an audio clip accessible to the
-       * client. Dialogflow does not impose any validation on it.
-       * 
- * - * string uri = 2; - * - * @return The uri. - */ - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (contentCase_ == 2) { - ref = content_; - } - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (contentCase_ == 2) { - content_ = s; - } - return s; - } - } - /** - * - * - *
-       * Client-specific URI that points to an audio clip accessible to the
-       * client. Dialogflow does not impose any validation on it.
-       * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (contentCase_ == 2) { - ref = content_; - } - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (contentCase_ == 2) { - content_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Specifies an audio clip to be played by the client as part of the response.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; } - public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 3; - private boolean allowPlaybackInterruption_; - /** - * - * - *
-       * Output only. Whether the playback of this segment can be interrupted by the end
-       * user's speech and the client should then start the next Dialogflow
-       * request.
-       * 
- * - * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The allowPlaybackInterruption. - */ @java.lang.Override - public boolean getAllowPlaybackInterruption() { - return allowPlaybackInterruption_; + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder.class); } - private byte memoizedIsInitialized = -1; + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + public Builder clear() { + super.clear(); + audioUri_ = ""; - memoizedIsInitialized = 1; - return true; + allowPlaybackInterruption_ = false; + + return this; } @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (contentCase_ == 1) { - output.writeBytes(1, (com.google.protobuf.ByteString) content_); - } - if (contentCase_ == 2) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); - } - if (allowPlaybackInterruption_ != false) { - output.writeBool(3, allowPlaybackInterruption_); - } - unknownFields.writeTo(output); + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; } @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance(); + } - size = 0; - if (contentCase_ == 1) { - size += - com.google.protobuf.CodedOutputStream.computeBytesSize( - 1, (com.google.protobuf.ByteString) content_); - } - if (contentCase_ == 2) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); - } - if (allowPlaybackInterruption_ != false) { - size += - com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowPlaybackInterruption_); + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; + return result; } @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment)) { - return super.equals(obj); - } - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment other = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) obj; + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(this); + result.audioUri_ = audioUri_; + result.allowPlaybackInterruption_ = allowPlaybackInterruption_; + onBuilt(); + return result; + } - if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) return false; - if (!getContentCase().equals(other.getContentCase())) return false; - switch (contentCase_) { - case 1: - if (!getAudio().equals(other.getAudio())) return false; - break; - case 2: - if (!getUri().equals(other.getUri())) return false; - break; - case 0: - default: - } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; + @java.lang.Override + public Builder clone() { + return super.clone(); } @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; - hash = - (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); - switch (contentCase_) { - case 1: - hash = (37 * hash) + AUDIO_FIELD_NUMBER; - hash = (53 * hash) + getAudio().hashCode(); - break; - case 2: - hash = (37 * hash) + URI_FIELD_NUMBER; - hash = (53 * hash) + getUri().hashCode(); - break; - case 0: - default: - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) other); + } else { + super.mergeFrom(other); + return this; + } } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + .getDefaultInstance()) return this; + if (!other.getAudioUri().isEmpty()) { + audioUri_ = other.audioUri_; + onChanged(); + } + if (other.getAllowPlaybackInterruption() != false) { + setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); + @java.lang.Override + public final boolean isInitialized() { + return true; } @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); + private java.lang.Object audioUri_ = ""; + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The audioUri. + */ + public java.lang.String getAudioUri() { + java.lang.Object ref = audioUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + audioUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - - public static Builder newBuilder( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for audioUri. + */ + public com.google.protobuf.ByteString getAudioUriBytes() { + java.lang.Object ref = audioUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + audioUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The audioUri to set. + * @return This builder for chaining. + */ + public Builder setAudioUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + audioUri_ = value; + onChanged(); + return this; } + /** + * + * + *
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
+       * 
+ * + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearAudioUri() { - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; + audioUri_ = getDefaultInstance().getAudioUri(); + onChanged(); + return this; } /** * * *
-       * Represents one segment of audio.
+       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
+       * value. It is specific to the client that reads it.
        * 
* - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} + * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for audioUri to set. + * @return This builder for chaining. */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + public Builder setAudioUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } + checkByteStringIsUtf8(value); - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - .class); - } + audioUri_ = value; + onChanged(); + return this; + } - // Construct using - // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + private boolean allowPlaybackInterruption_; + /** + * + * + *
+       * Output only. Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + /** + * + * + *
+       * Output only. Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The allowPlaybackInterruption to set. + * @return This builder for chaining. + */ + public Builder setAllowPlaybackInterruption(boolean value) { - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } + allowPlaybackInterruption_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Output only. Whether the playback of this message can be interrupted by the end
+       * user's speech and the client can then starts the next Dialogflow
+       * request.
+       * 
+ * + * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAllowPlaybackInterruption() { - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } + allowPlaybackInterruption_ = false; + onChanged(); + return this; + } - @java.lang.Override - public Builder clear() { - super.clear(); - allowPlaybackInterruption_ = false; + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - contentCase_ = 0; - content_ = null; - return this; - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; - } + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + } - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - getDefaultInstanceForType() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - .getDefaultInstance(); - } + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + DEFAULT_INSTANCE; - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment build() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(); + } - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - buildPartial() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment result = - new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(this); - if (contentCase_ == 1) { - result.content_ = content_; - } - if (contentCase_ == 2) { - result.content_ = content_; + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PlayAudio parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PlayAudio(input, extensionRegistry); } - result.allowPlaybackInterruption_ = allowPlaybackInterruption_; - result.contentCase_ = contentCase_; - onBuilt(); - return result; - } + }; - @java.lang.Override - public Builder clone() { - return super.clone(); - } + public static com.google.protobuf.Parser parser() { + return PARSER; + } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } + public interface EndInteractionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + com.google.protobuf.MessageOrBuilder {} + /** + * + * + *
+   * Indicates that interaction with the Dialogflow agent has ended.
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} + */ + public static final class EndInteraction extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + EndInteractionOrBuilder { + private static final long serialVersionUID = 0L; + // Use EndInteraction.newBuilder() to construct. + private EndInteraction(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } + private EndInteraction() {} - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EndInteraction(); + } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) { - return mergeFrom( - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) other); - } else { - super.mergeFrom(other); - return this; - } - } + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } - public Builder mergeFrom( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment other) { - if (other - == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - .getDefaultInstance()) return this; - if (other.getAllowPlaybackInterruption() != false) { - setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); - } - switch (other.getContentCase()) { - case AUDIO: - { - setAudio(other.getAudio()); - break; - } - case URI: - { - contentCase_ = 2; - content_ = other.content_; - onChanged(); - break; - } - case CONTENT_NOT_SET: + private EndInteraction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } break; } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } - @java.lang.Override - public final boolean isInitialized() { - return true; - } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; + } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment parsedMessage = - null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder.class); + } - private int contentCase_ = 0; - private java.lang.Object content_; + private byte memoizedIsInitialized = -1; - public ContentCase getContentCase() { - return ContentCase.forNumber(contentCase_); - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - public Builder clearContent() { - contentCase_ = 0; - content_ = null; - onChanged(); - return this; - } + memoizedIsInitialized = 1; + return true; + } - /** - * - * - *
-         * Raw audio synthesized from the Dialogflow agent's response using
-         * the output config specified in the request.
-         * 
- * - * bytes audio = 1; - * - * @return The audio. - */ - public com.google.protobuf.ByteString getAudio() { - if (contentCase_ == 1) { - return (com.google.protobuf.ByteString) content_; - } - return com.google.protobuf.ByteString.EMPTY; - } - /** - * - * - *
-         * Raw audio synthesized from the Dialogflow agent's response using
-         * the output config specified in the request.
-         * 
- * - * bytes audio = 1; - * - * @param value The audio to set. - * @return This builder for chaining. - */ - public Builder setAudio(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - contentCase_ = 1; - content_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * Raw audio synthesized from the Dialogflow agent's response using
-         * the output config specified in the request.
-         * 
- * - * bytes audio = 1; - * - * @return This builder for chaining. - */ - public Builder clearAudio() { - if (contentCase_ == 1) { - contentCase_ = 0; - content_ = null; - onChanged(); - } - return this; - } + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } - /** - * - * - *
-         * Client-specific URI that points to an audio clip accessible to the
-         * client. Dialogflow does not impose any validation on it.
-         * 
- * - * string uri = 2; - * - * @return The uri. - */ - @java.lang.Override - public java.lang.String getUri() { - java.lang.Object ref = ""; - if (contentCase_ == 2) { - ref = content_; - } - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (contentCase_ == 2) { - content_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * Client-specific URI that points to an audio clip accessible to the
-         * client. Dialogflow does not impose any validation on it.
-         * 
- * - * string uri = 2; - * - * @return The bytes for uri. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUriBytes() { - java.lang.Object ref = ""; - if (contentCase_ == 2) { - ref = content_; - } - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - if (contentCase_ == 2) { - content_ = b; - } - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * Client-specific URI that points to an audio clip accessible to the
-         * client. Dialogflow does not impose any validation on it.
-         * 
- * - * string uri = 2; - * - * @param value The uri to set. - * @return This builder for chaining. - */ - public Builder setUri(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - contentCase_ = 2; - content_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * Client-specific URI that points to an audio clip accessible to the
-         * client. Dialogflow does not impose any validation on it.
-         * 
- * - * string uri = 2; - * - * @return This builder for chaining. - */ - public Builder clearUri() { - if (contentCase_ == 2) { - contentCase_ = 0; - content_ = null; - onChanged(); - } - return this; - } - /** - * - * - *
-         * Client-specific URI that points to an audio clip accessible to the
-         * client. Dialogflow does not impose any validation on it.
-         * 
- * - * string uri = 2; - * - * @param value The bytes for uri to set. - * @return This builder for chaining. - */ - public Builder setUriBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - contentCase_ = 2; - content_ = value; - onChanged(); - return this; - } + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - private boolean allowPlaybackInterruption_; - /** - * - * - *
-         * Output only. Whether the playback of this segment can be interrupted by the end
-         * user's speech and the client should then start the next Dialogflow
-         * request.
-         * 
- * - * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The allowPlaybackInterruption. - */ - @java.lang.Override - public boolean getAllowPlaybackInterruption() { - return allowPlaybackInterruption_; - } - /** - * - * - *
-         * Output only. Whether the playback of this segment can be interrupted by the end
-         * user's speech and the client should then start the next Dialogflow
-         * request.
-         * 
- * - * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @param value The allowPlaybackInterruption to set. - * @return This builder for chaining. - */ - public Builder setAllowPlaybackInterruption(boolean value) { + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - allowPlaybackInterruption_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * Output only. Whether the playback of this segment can be interrupted by the end
-         * user's speech and the client should then start the next Dialogflow
-         * request.
-         * 
- * - * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return This builder for chaining. - */ - public Builder clearAllowPlaybackInterruption() { + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) obj; - allowPlaybackInterruption_ = false; - onChanged(); - return this; - } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) - private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - DEFAULT_INSTANCE; + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - static { - DEFAULT_INSTANCE = - new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(); - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - getDefaultInstance() { - return DEFAULT_INSTANCE; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Segment parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Segment(input, extensionRegistry); - } - }; + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public static com.google.protobuf.Parser parser() { - return PARSER; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static final int SEGMENTS_FIELD_NUMBER = 1; - private java.util.List< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> - segments_; - /** - * - * - *
-     * Segments this audio response is composed of.
-     * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - @java.lang.Override - public java.util.List - getSegmentsList() { - return segments_; - } - /** - * - * - *
-     * Segments this audio response is composed of.
-     * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - @java.lang.Override - public java.util.List< - ? extends - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> - getSegmentsOrBuilderList() { - return segments_; - } - /** - * - * - *
-     * Segments this audio response is composed of.
-     * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - @java.lang.Override - public int getSegmentsCount() { - return segments_.size(); - } - /** - * - * - *
-     * Segments this audio response is composed of.
-     * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( - int index) { - return segments_.get(index); - } - /** - * - * - *
-     * Segments this audio response is composed of.
-     * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder - getSegmentsOrBuilder(int index) { - return segments_.get(index); - } - - private byte memoizedIsInitialized = -1; - - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - for (int i = 0; i < segments_.size(); i++) { - output.writeMessage(1, segments_.get(i)); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < segments_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, segments_.get(i)); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio)) { - return super.equals(obj); - } - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio other = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) obj; - - if (!getSegmentsList().equals(other.getSegmentsList())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getSegmentsCount() > 0) { - hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; - hash = (53 * hash) + getSegmentsList().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -5387,7 +4946,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio prototype) { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -5406,39 +4965,36 @@ protected Builder newBuilderForType( * * *
-     * Represents an audio message that is composed of both segments
-     * synthesized from the Dialogflow agent prompts and ones hosted externally
-     * at the specified URIs.
-     * The external URIs are specified via
-     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * Indicates that interaction with the Dialogflow agent has ended.
      * This message is generated by Dialogflow only and not supposed to be
      * defined by the user.
      * 
* - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder { + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder.class); + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder + .class); } // Construct using - // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.newBuilder() + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -5449,39 +5005,32 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getSegmentsFieldBuilder(); - } + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); - if (segmentsBuilder_ == null) { - segments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - segmentsBuilder_.clear(); - } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; } @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction getDefaultInstanceForType() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction .getDefaultInstance(); } @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio build() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio result = buildPartial(); + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction result = + buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -5489,19 +5038,9 @@ public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio build() } @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio buildPartial() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio result = - new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(this); - int from_bitField0_ = bitField0_; - if (segmentsBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - segments_ = java.util.Collections.unmodifiableList(segments_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.segments_ = segments_; - } else { - result.segments_ = segmentsBuilder_.build(); - } + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(this); onBuilt(); return result; } @@ -5543,9 +5082,10 @@ public Builder addRepeatedField( @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) { + if (other + instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) { return mergeFrom( - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) other); + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) other); } else { super.mergeFrom(other); return this; @@ -5553,37 +5093,10 @@ public Builder mergeFrom(com.google.protobuf.Message other) { } public Builder mergeFrom( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio other) { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction other) { if (other - == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction .getDefaultInstance()) return this; - if (segmentsBuilder_ == null) { - if (!other.segments_.isEmpty()) { - if (segments_.isEmpty()) { - segments_ = other.segments_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureSegmentsIsMutable(); - segments_.addAll(other.segments_); - } - onChanged(); - } - } else { - if (!other.segments_.isEmpty()) { - if (segmentsBuilder_.isEmpty()) { - segmentsBuilder_.dispose(); - segmentsBuilder_ = null; - segments_ = other.segments_; - bitField0_ = (bitField0_ & ~0x00000001); - segmentsBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getSegmentsFieldBuilder() - : null; - } else { - segmentsBuilder_.addAllMessages(other.segments_); - } - } - } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -5599,12 +5112,12 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parsedMessage = null; + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { @@ -5615,1165 +5128,1372 @@ public Builder mergeFrom( return this; } - private int bitField0_; - - private java.util.List< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> - segments_ = java.util.Collections.emptyList(); + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - private void ensureSegmentsIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - segments_ = - new java.util.ArrayList< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment>( - segments_); - bitField0_ |= 0x00000001; - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> - segmentsBuilder_; + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public java.util.List< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> - getSegmentsList() { - if (segmentsBuilder_ == null) { - return java.util.Collections.unmodifiableList(segments_); - } else { - return segmentsBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public int getSegmentsCount() { - if (segmentsBuilder_ == null) { - return segments_.size(); - } else { - return segmentsBuilder_.getCount(); - } - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( - int index) { - if (segmentsBuilder_ == null) { - return segments_.get(index); - } else { - return segmentsBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public Builder setSegments( - int index, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { - if (segmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSegmentsIsMutable(); - segments_.set(index, value); - onChanged(); - } else { - segmentsBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public Builder setSegments( - int index, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - builderForValue) { - if (segmentsBuilder_ == null) { - ensureSegmentsIsMutable(); - segments_.set(index, builderForValue.build()); - onChanged(); - } else { - segmentsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public Builder addSegments( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { - if (segmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureSegmentsIsMutable(); - segments_.add(value); - onChanged(); - } else { - segmentsBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public Builder addSegments( - int index, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { - if (segmentsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); + } + + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EndInteraction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EndInteraction(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MixedAudioOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + java.util.List + getSegmentsList(); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( + int index); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + int getSegmentsCount(); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsOrBuilderList(); + /** + * + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index); + } + /** + * + * + *
+   * Represents an audio message that is composed of both segments
+   * synthesized from the Dialogflow agent prompts and ones hosted externally
+   * at the specified URIs.
+   * The external URIs are specified via
+   * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+   * This message is generated by Dialogflow only and not supposed to be
+   * defined by the user.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} + */ + public static final class MixedAudio extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + MixedAudioOrBuilder { + private static final long serialVersionUID = 0L; + // Use MixedAudio.newBuilder() to construct. + private MixedAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MixedAudio() { + segments_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MixedAudio(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MixedAudio( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + segments_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .Segment>(); + mutable_bitField0_ |= 0x00000001; + } + segments_.add( + input.readMessage( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } - ensureSegmentsIsMutable(); - segments_.add(index, value); - onChanged(); - } else { - segmentsBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public Builder addSegments( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - builderForValue) { - if (segmentsBuilder_ == null) { - ensureSegmentsIsMutable(); - segments_.add(builderForValue.build()); - onChanged(); - } else { - segmentsBuilder_.addMessage(builderForValue.build()); } - return this; + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder.class); + } + + public interface SegmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + com.google.protobuf.MessageOrBuilder { + /** * * *
-       * Segments this audio response is composed of.
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * bytes audio = 1; + * + * @return The audio. */ - public Builder addSegments( - int index, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - builderForValue) { - if (segmentsBuilder_ == null) { - ensureSegmentsIsMutable(); - segments_.add(index, builderForValue.build()); - onChanged(); - } else { - segmentsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } + com.google.protobuf.ByteString getAudio(); + /** * * *
-       * Segments this audio response is composed of.
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * string uri = 2; + * + * @return The uri. */ - public Builder addAllSegments( - java.lang.Iterable< - ? extends - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> - values) { - if (segmentsBuilder_ == null) { - ensureSegmentsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, segments_); - onChanged(); - } else { - segmentsBuilder_.addAllMessages(values); - } - return this; - } + java.lang.String getUri(); /** * * *
-       * Segments this audio response is composed of.
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * string uri = 2; + * + * @return The bytes for uri. */ - public Builder clearSegments() { - if (segmentsBuilder_ == null) { - segments_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - segmentsBuilder_.clear(); - } - return this; - } + com.google.protobuf.ByteString getUriBytes(); + /** * * *
-       * Segments this audio response is composed of.
+       * Output only. Whether the playback of this segment can be interrupted by the end
+       * user's speech and the client should then start the next Dialogflow
+       * request.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * + * + * @return The allowPlaybackInterruption. */ - public Builder removeSegments(int index) { - if (segmentsBuilder_ == null) { - ensureSegmentsIsMutable(); - segments_.remove(index); - onChanged(); - } else { - segmentsBuilder_.remove(index); + boolean getAllowPlaybackInterruption(); + + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.ContentCase + getContentCase(); + } + /** + * + * + *
+     * Represents one segment of audio.
+     * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} + */ + public static final class Segment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + SegmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Segment.newBuilder() to construct. + private Segment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Segment() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Segment(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Segment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - return this; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + contentCase_ = 1; + content_ = input.readBytes(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + contentCase_ = 2; + content_ = s; + break; + } + case 24: + { + allowPlaybackInterruption_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + .class); + } + + private int contentCase_ = 0; + private java.lang.Object content_; + + public enum ContentCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUDIO(1), + URI(2), + CONTENT_NOT_SET(0); + private final int value; + + private ContentCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentCase valueOf(int value) { + return forNumber(value); + } + + public static ContentCase forNumber(int value) { + switch (value) { + case 1: + return AUDIO; + case 2: + return URI; + case 0: + return CONTENT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); } + + public static final int AUDIO_FIELD_NUMBER = 1; /** * * *
-       * Segments this audio response is composed of.
+       * Raw audio synthesized from the Dialogflow agent's response using
+       * the output config specified in the request.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * bytes audio = 1; + * + * @return The audio. */ - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - getSegmentsBuilder(int index) { - return getSegmentsFieldBuilder().getBuilder(index); + @java.lang.Override + public com.google.protobuf.ByteString getAudio() { + if (contentCase_ == 1) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; } + + public static final int URI_FIELD_NUMBER = 2; /** * * *
-       * Segments this audio response is composed of.
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * string uri = 2; + * + * @return The uri. */ - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder - getSegmentsOrBuilder(int index) { - if (segmentsBuilder_ == null) { - return segments_.get(index); + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { - return segmentsBuilder_.getMessageOrBuilder(index); + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 2) { + content_ = s; + } + return s; } } /** * * *
-       * Segments this audio response is composed of.
+       * Client-specific URI that points to an audio clip accessible to the
+       * client. Dialogflow does not impose any validation on it.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * string uri = 2; + * + * @return The bytes for uri. */ - public java.util.List< - ? extends - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - .SegmentOrBuilder> - getSegmentsOrBuilderList() { - if (segmentsBuilder_ != null) { - return segmentsBuilder_.getMessageOrBuilderList(); + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 2) { + content_ = b; + } + return b; } else { - return java.util.Collections.unmodifiableList(segments_); + return (com.google.protobuf.ByteString) ref; } } + + public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 3; + private boolean allowPlaybackInterruption_; /** * * *
-       * Segments this audio response is composed of.
+       * Output only. Whether the playback of this segment can be interrupted by the end
+       * user's speech and the client should then start the next Dialogflow
+       * request.
        * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * - */ - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - addSegmentsBuilder() { - return getSegmentsFieldBuilder() - .addBuilder( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - .getDefaultInstance()); - } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
* - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * + * @return The allowPlaybackInterruption. */ - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder - addSegmentsBuilder(int index) { - return getSegmentsFieldBuilder() - .addBuilder( - index, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment - .getDefaultInstance()); + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; } - /** - * - * - *
-       * Segments this audio response is composed of.
-       * 
- * - * - * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; - * - */ - public java.util.List< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder> - getSegmentsBuilderList() { - return getSegmentsFieldBuilder().getBuilderList(); + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> - getSegmentsFieldBuilder() { - if (segmentsBuilder_ == null) { - segmentsBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - .SegmentOrBuilder>( - segments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - segments_ = null; + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (contentCase_ == 1) { + output.writeBytes(1, (com.google.protobuf.ByteString) content_); } - return segmentsBuilder_; + if (contentCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + } + if (allowPlaybackInterruption_ != false) { + output.writeBool(3, allowPlaybackInterruption_); + } + unknownFields.writeTo(output); } @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contentCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 1, (com.google.protobuf.ByteString) content_); + } + if (contentCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + } + if (allowPlaybackInterruption_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize(3, allowPlaybackInterruption_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; } @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) obj; + + if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) return false; + if (!getContentCase().equals(other.getContentCase())) return false; + switch (contentCase_) { + case 1: + if (!getAudio().equals(other.getAudio())) return false; + break; + case 2: + if (!getUri().equals(other.getUri())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; } - // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) - } + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; + hash = + (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); + switch (contentCase_) { + case 1: + hash = (37 * hash) + AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getAudio().hashCode(); + break; + case 2: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) - private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - DEFAULT_INSTANCE; + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - static { - DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(); - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - getDefaultInstance() { - return DEFAULT_INSTANCE; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public MixedAudio parsePartialFrom( - com.google.protobuf.CodedInputStream input, + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom( + com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new MixedAudio(input, extensionRegistry); - } - }; + return PARSER.parseFrom(data, extensionRegistry); + } - public static com.google.protobuf.Parser parser() { - return PARSER; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } - public interface EndInteractionOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) - com.google.protobuf.MessageOrBuilder {} - /** - * - * - *
-   * Indicates that interaction with the Dialogflow agent has ended.
-   * This message is generated by Dialogflow only and not supposed to be
-   * defined by the user.
-   * 
- * - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} - */ - public static final class EndInteraction extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) - EndInteractionOrBuilder { - private static final long serialVersionUID = 0L; - // Use EndInteraction.newBuilder() to construct. - private EndInteraction(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } - private EndInteraction() {} + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new EndInteraction(); - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } - private EndInteraction( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; - } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder.class); - } + public static Builder newBuilder( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } - private byte memoizedIsInitialized = -1; + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Represents one segment of audio.
+       * 
+ * + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + } - memoizedIsInitialized = 1; - return true; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + .class); + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); - } + // Construct using + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } - size = 0; - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction)) { - return super.equals(obj); - } - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction other = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) obj; + @java.lang.Override + public Builder clear() { + super.clear(); + allowPlaybackInterruption_ = false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } + contentCase_ = 0; + content_ = null; + return this; + } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance(); + } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - parseDelimitedFrom( - java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( - PARSER, input, extensionRegistry); - } + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(this); + if (contentCase_ == 1) { + result.content_ = content_; + } + if (contentCase_ == 2) { + result.content_ = content_; + } + result.allowPlaybackInterruption_ = allowPlaybackInterruption_; + result.contentCase_ = contentCase_; + onBuilt(); + return result; + } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } + @java.lang.Override + public Builder clone() { + return super.clone(); + } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException( - PARSER, input, extensionRegistry); - } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } - @java.lang.Override - public Builder newBuilderForType() { - return newBuilder(); - } + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } - public static Builder newBuilder( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Indicates that interaction with the Dialogflow agent has ended.
-     * This message is generated by Dialogflow only and not supposed to be
-     * defined by the user.
-     * 
- * - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteractionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; - } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) { + return mergeFrom( + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) other); + } else { + super.mergeFrom(other); + return this; + } + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.Builder - .class); - } + public Builder mergeFrom( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment other) { + if (other + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()) return this; + if (other.getAllowPlaybackInterruption() != false) { + setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); + } + switch (other.getContentCase()) { + case AUDIO: + { + setAudio(other.getAudio()); + break; + } + case URI: + { + contentCase_ = 2; + content_ = other.content_; + onChanged(); + break; + } + case CONTENT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } - // Construct using - // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } + private int contentCase_ = 0; + private java.lang.Object content_; - @java.lang.Override - public Builder clear() { - super.clear(); - return this; - } + public ContentCase getContentCase() { + return ContentCase.forNumber(contentCase_); + } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; - } + public Builder clearContent() { + contentCase_ = 0; + content_ = null; + onChanged(); + return this; + } - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - getDefaultInstanceForType() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - .getDefaultInstance(); - } - - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction build() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @return The audio. + */ + public com.google.protobuf.ByteString getAudio() { + if (contentCase_ == 1) { + return (com.google.protobuf.ByteString) content_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @param value The audio to set. + * @return This builder for chaining. + */ + public Builder setAudio(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 1; + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Raw audio synthesized from the Dialogflow agent's response using
+         * the output config specified in the request.
+         * 
+ * + * bytes audio = 1; + * + * @return This builder for chaining. + */ + public Builder clearAudio() { + if (contentCase_ == 1) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; } - return result; - } - - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction buildPartial() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction result = - new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(this); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (contentCase_ == 2) { + content_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (contentCase_ == 2) { + ref = content_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (contentCase_ == 2) { + content_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + contentCase_ = 2; + content_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (contentCase_ == 2) { + contentCase_ = 0; + content_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+         * Client-specific URI that points to an audio clip accessible to the
+         * client. Dialogflow does not impose any validation on it.
+         * 
+ * + * string uri = 2; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + contentCase_ = 2; + content_ = value; + onChanged(); + return this; + } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) { - return mergeFrom( - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) other); - } else { - super.mergeFrom(other); + private boolean allowPlaybackInterruption_; + /** + * + * + *
+         * Output only. Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The allowPlaybackInterruption. + */ + @java.lang.Override + public boolean getAllowPlaybackInterruption() { + return allowPlaybackInterruption_; + } + /** + * + * + *
+         * Output only. Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The allowPlaybackInterruption to set. + * @return This builder for chaining. + */ + public Builder setAllowPlaybackInterruption(boolean value) { + + allowPlaybackInterruption_ = value; + onChanged(); return this; } - } - - public Builder mergeFrom( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction other) { - if (other - == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - .getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } + /** + * + * + *
+         * Output only. Whether the playback of this segment can be interrupted by the end
+         * user's speech and the client should then start the next Dialogflow
+         * request.
+         * 
+ * + * bool allow_playback_interruption = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearAllowPlaybackInterruption() { - @java.lang.Override - public final boolean isInitialized() { - return true; - } + allowPlaybackInterruption_ = false; + onChanged(); + return this; + } - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); } - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) } - // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) - } - - // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction) - private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction(); - } - - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public EndInteraction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new EndInteraction(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.EndInteraction - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - } - - public interface PlayAudioOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) - com.google.protobuf.MessageOrBuilder { - - /** - * - * - *
-     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-     * value. It is specific to the client that reads it.
-     * 
- * - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The audioUri. - */ - java.lang.String getAudioUri(); - /** - * - * - *
-     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-     * value. It is specific to the client that reads it.
-     * 
- * - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for audioUri. - */ - com.google.protobuf.ByteString getAudioUriBytes(); - - /** - * - * - *
-     * Output only. Whether the playback of this message can be interrupted by the end
-     * user's speech and the client can then starts the next Dialogflow
-     * request.
-     * 
- * - * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * - * - * @return The allowPlaybackInterruption. - */ - boolean getAllowPlaybackInterruption(); - } - /** - * - * - *
-   * Specifies an audio clip to be played by the client as part of the response.
-   * 
- * - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} - */ - public static final class PlayAudio extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) - PlayAudioOrBuilder { - private static final long serialVersionUID = 0L; - // Use PlayAudio.newBuilder() to construct. - private PlayAudio(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - - private PlayAudio() { - audioUri_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new PlayAudio(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + DEFAULT_INSTANCE; - private PlayAudio( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + static { + DEFAULT_INSTANCE = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment(); } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: - { - java.lang.String s = input.readStringRequireUtf8(); - audioUri_ = s; - break; - } - case 16: - { - allowPlaybackInterruption_ = input.readBool(); - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + getDefaultInstance() { + return DEFAULT_INSTANCE; } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; - } + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Segment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Segment(input, extensionRegistry); + } + }; - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder.class); + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } } - public static final int AUDIO_URI_FIELD_NUMBER = 1; - private volatile java.lang.Object audioUri_; + public static final int SEGMENTS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + segments_; /** * * *
-     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-     * value. It is specific to the client that reads it.
+     * Segments this audio response is composed of.
      * 
* - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The audioUri. + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ @java.lang.Override - public java.lang.String getAudioUri() { - java.lang.Object ref = audioUri_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioUri_ = s; - return s; - } + public java.util.List + getSegmentsList() { + return segments_; } /** * * *
-     * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-     * value. It is specific to the client that reads it.
+     * Segments this audio response is composed of.
      * 
* - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsOrBuilderList() { + return segments_; + } + /** * - * @return The bytes for audioUri. + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ @java.lang.Override - public com.google.protobuf.ByteString getAudioUriBytes() { - java.lang.Object ref = audioUri_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audioUri_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public int getSegmentsCount() { + return segments_.size(); } - - public static final int ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER = 2; - private boolean allowPlaybackInterruption_; /** * * *
-     * Output only. Whether the playback of this message can be interrupted by the end
-     * user's speech and the client can then starts the next Dialogflow
-     * request.
+     * Segments this audio response is composed of.
      * 
* - * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; * + */ + @java.lang.Override + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( + int index) { + return segments_.get(index); + } + /** * - * @return The allowPlaybackInterruption. + * + *
+     * Segments this audio response is composed of.
+     * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ @java.lang.Override - public boolean getAllowPlaybackInterruption() { - return allowPlaybackInterruption_; + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index) { + return segments_.get(index); } private byte memoizedIsInitialized = -1; @@ -6790,11 +6510,8 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getAudioUriBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, audioUri_); - } - if (allowPlaybackInterruption_ != false) { - output.writeBool(2, allowPlaybackInterruption_); + for (int i = 0; i < segments_.size(); i++) { + output.writeMessage(1, segments_.get(i)); } unknownFields.writeTo(output); } @@ -6805,12 +6522,8 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; - if (!getAudioUriBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, audioUri_); - } - if (allowPlaybackInterruption_ != false) { - size += - com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowPlaybackInterruption_); + for (int i = 0; i < segments_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, segments_.get(i)); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -6822,14 +6535,13 @@ public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } - if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio)) { + if (!(obj instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio)) { return super.equals(obj); } - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio other = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) obj; + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio other = + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) obj; - if (!getAudioUri().equals(other.getAudioUri())) return false; - if (getAllowPlaybackInterruption() != other.getAllowPlaybackInterruption()) return false; + if (!getSegmentsList().equals(other.getSegmentsList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -6841,68 +6553,68 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + AUDIO_URI_FIELD_NUMBER; - hash = (53 * hash) + getAudioUri().hashCode(); - hash = (37 * hash) + ALLOW_PLAYBACK_INTERRUPTION_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowPlaybackInterruption()); + if (getSegmentsCount() > 0) { + hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; + hash = (53 * hash) + getSegmentsList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6910,12 +6622,12 @@ public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio p PARSER, input, extensionRegistry); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parseFrom( + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -6933,7 +6645,7 @@ public static Builder newBuilder() { } public static Builder newBuilder( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio prototype) { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @@ -6952,33 +6664,39 @@ protected Builder newBuilderForType( * * *
-     * Specifies an audio clip to be played by the client as part of the response.
+     * Represents an audio message that is composed of both segments
+     * synthesized from the Dialogflow agent prompts and ones hosted externally
+     * at the specified URIs.
+     * The external URIs are specified via
+     * [play_audio][google.cloud.dialogflow.cx.v3beta1.ResponseMessage.play_audio].
+     * This message is generated by Dialogflow only and not supposed to be
+     * defined by the user.
      * 
* - * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio} + * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudioOrBuilder { + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudioOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable .ensureFieldAccessorsInitialized( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.class, - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.Builder.class); + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.class, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Builder.class); } // Construct using - // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio.newBuilder() + // com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.newBuilder() private Builder() { maybeForceBuilderInitialization(); } @@ -6989,35 +6707,39 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getSegmentsFieldBuilder(); + } } @java.lang.Override public Builder clear() { super.clear(); - audioUri_ = ""; - - allowPlaybackInterruption_ = false; - + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + segmentsBuilder_.clear(); + } return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageProto - .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; + .internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; } @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio getDefaultInstanceForType() { - return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + return com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio .getDefaultInstance(); } @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio build() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio result = buildPartial(); + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio build() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } @@ -7025,11 +6747,19 @@ public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio build() } @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio buildPartial() { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio result = - new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(this); - result.audioUri_ = audioUri_; - result.allowPlaybackInterruption_ = allowPlaybackInterruption_; + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio buildPartial() { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio result = + new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(this); + int from_bitField0_ = bitField0_; + if (segmentsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + segments_ = java.util.Collections.unmodifiableList(segments_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.segments_ = segments_; + } else { + result.segments_ = segmentsBuilder_.build(); + } onBuilt(); return result; } @@ -7071,9 +6801,9 @@ public Builder addRepeatedField( @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) { + if (other instanceof com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) { return mergeFrom( - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) other); + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) other); } else { super.mergeFrom(other); return this; @@ -7081,16 +6811,36 @@ public Builder mergeFrom(com.google.protobuf.Message other) { } public Builder mergeFrom( - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio other) { + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio other) { if (other - == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + == com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio .getDefaultInstance()) return this; - if (!other.getAudioUri().isEmpty()) { - audioUri_ = other.audioUri_; - onChanged(); - } - if (other.getAllowPlaybackInterruption() != false) { - setAllowPlaybackInterruption(other.getAllowPlaybackInterruption()); + if (segmentsBuilder_ == null) { + if (!other.segments_.isEmpty()) { + if (segments_.isEmpty()) { + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSegmentsIsMutable(); + segments_.addAll(other.segments_); + } + onChanged(); + } + } else { + if (!other.segments_.isEmpty()) { + if (segmentsBuilder_.isEmpty()) { + segmentsBuilder_.dispose(); + segmentsBuilder_ = null; + segments_ = other.segments_; + bitField0_ = (bitField0_ & ~0x00000001); + segmentsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getSegmentsFieldBuilder() + : null; + } else { + segmentsBuilder_.addAllMessages(other.segments_); + } + } } this.mergeUnknownFields(other.unknownFields); onChanged(); @@ -7107,12 +6857,12 @@ public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio parsedMessage = null; + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = - (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + (com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { @@ -7122,177 +6872,427 @@ public Builder mergeFrom( } return this; } - - private java.lang.Object audioUri_ = ""; + + private int bitField0_; + + private java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + segments_ = java.util.Collections.emptyList(); + + private void ensureSegmentsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + segments_ = + new java.util.ArrayList< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment>( + segments_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + segmentsBuilder_; + + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + getSegmentsList() { + if (segmentsBuilder_ == null) { + return java.util.Collections.unmodifiableList(segments_); + } else { + return segmentsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public int getSegmentsCount() { + if (segmentsBuilder_ == null) { + return segments_.size(); + } else { + return segmentsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment getSegments( + int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder setSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.set(index, value); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder setSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.set(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(value); + onChanged(); + } else { + segmentsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment value) { + if (segmentsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSegmentsIsMutable(); + segments_.add(index, value); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * + */ + public Builder addSegments( + int index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + builderForValue) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.add(index, builderForValue.build()); + onChanged(); + } else { + segmentsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } /** * * *
-       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-       * value. It is specific to the client that reads it.
+       * Segments this audio response is composed of.
        * 
* - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The audioUri. + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ - public java.lang.String getAudioUri() { - java.lang.Object ref = audioUri_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - audioUri_ = s; - return s; + public Builder addAllSegments( + java.lang.Iterable< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment> + values) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, segments_); + onChanged(); } else { - return (java.lang.String) ref; + segmentsBuilder_.addAllMessages(values); } + return this; } /** * * *
-       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-       * value. It is specific to the client that reads it.
+       * Segments this audio response is composed of.
        * 
* - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return The bytes for audioUri. + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ - public com.google.protobuf.ByteString getAudioUriBytes() { - java.lang.Object ref = audioUri_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - audioUri_ = b; - return b; + public Builder clearSegments() { + if (segmentsBuilder_ == null) { + segments_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + segmentsBuilder_.clear(); } + return this; } /** * * *
-       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-       * value. It is specific to the client that reads it.
+       * Segments this audio response is composed of.
        * 
* - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The audioUri to set. - * @return This builder for chaining. + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ - public Builder setAudioUri(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder removeSegments(int index) { + if (segmentsBuilder_ == null) { + ensureSegmentsIsMutable(); + segments_.remove(index); + onChanged(); + } else { + segmentsBuilder_.remove(index); } - - audioUri_ = value; - onChanged(); return this; } /** * * *
-       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-       * value. It is specific to the client that reads it.
+       * Segments this audio response is composed of.
        * 
* - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @return This builder for chaining. + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ - public Builder clearAudioUri() { - - audioUri_ = getDefaultInstance().getAudioUri(); - onChanged(); - return this; + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + getSegmentsBuilder(int index) { + return getSegmentsFieldBuilder().getBuilder(index); } /** * * *
-       * Required. URI of the audio clip. Dialogflow does not impose any validation on this
-       * value. It is specific to the client that reads it.
+       * Segments this audio response is composed of.
        * 
* - * string audio_uri = 1 [(.google.api.field_behavior) = REQUIRED]; - * - * @param value The bytes for audioUri to set. - * @return This builder for chaining. + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ - public Builder setAudioUriBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder + getSegmentsOrBuilder(int index) { + if (segmentsBuilder_ == null) { + return segments_.get(index); + } else { + return segmentsBuilder_.getMessageOrBuilder(index); } - checkByteStringIsUtf8(value); - - audioUri_ = value; - onChanged(); - return this; } - - private boolean allowPlaybackInterruption_; /** * * *
-       * Output only. Whether the playback of this message can be interrupted by the end
-       * user's speech and the client can then starts the next Dialogflow
-       * request.
+       * Segments this audio response is composed of.
        * 
* - * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; * - * - * @return The allowPlaybackInterruption. */ - @java.lang.Override - public boolean getAllowPlaybackInterruption() { - return allowPlaybackInterruption_; + public java.util.List< + ? extends + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .SegmentOrBuilder> + getSegmentsOrBuilderList() { + if (segmentsBuilder_ != null) { + return segmentsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(segments_); + } } /** * * *
-       * Output only. Whether the playback of this message can be interrupted by the end
-       * user's speech and the client can then starts the next Dialogflow
-       * request.
+       * Segments this audio response is composed of.
        * 
* - * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; * - * - * @param value The allowPlaybackInterruption to set. - * @return This builder for chaining. */ - public Builder setAllowPlaybackInterruption(boolean value) { - - allowPlaybackInterruption_ = value; - onChanged(); - return this; + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + addSegmentsBuilder() { + return getSegmentsFieldBuilder() + .addBuilder( + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()); } /** * * *
-       * Output only. Whether the playback of this message can be interrupted by the end
-       * user's speech and the client can then starts the next Dialogflow
-       * request.
+       * Segments this audio response is composed of.
        * 
* - * bool allow_playback_interruption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; * + */ + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder + addSegmentsBuilder(int index) { + return getSegmentsFieldBuilder() + .addBuilder( + index, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment + .getDefaultInstance()); + } + /** * - * @return This builder for chaining. + * + *
+       * Segments this audio response is composed of.
+       * 
+ * + * + * repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment segments = 1; + * */ - public Builder clearAllowPlaybackInterruption() { + public java.util.List< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder> + getSegmentsBuilderList() { + return getSegmentsFieldBuilder().getBuilderList(); + } - allowPlaybackInterruption_ = false; - onChanged(); - return this; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.SegmentOrBuilder> + getSegmentsFieldBuilder() { + if (segmentsBuilder_ == null) { + segmentsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio.Segment.Builder, + com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio + .SegmentOrBuilder>( + segments_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + segments_ = null; + } + return segmentsBuilder_; } @java.lang.Override @@ -7307,44 +7307,44 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) + // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) } - // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio) - private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio) + private static final com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio(); + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio(); } - public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + public static com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public PlayAudio parsePartialFrom( + public MixedAudio parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new PlayAudio(input, extensionRegistry); + return new MixedAudio(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.PlayAudio + public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.MixedAudio getDefaultInstanceForType() { return DEFAULT_INSTANCE; } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageProto.java index c7d6ed8c8..81a007d29 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageProto.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/ResponseMessageProto.java @@ -48,21 +48,21 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_OutputAudioText_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable; + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor; + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable; + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -102,14 +102,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\027.google.protobuf.Struct\032e\n\017OutputAudioT" + "ext\022\016\n\004text\030\001 \001(\tH\000\022\016\n\004ssml\030\002 \001(\tH\000\022(\n\033a" + "llow_playback_interruption\030\003 \001(\010B\003\340A\003B\010\n" - + "\006source\032\306\001\n\nMixedAudio\022X\n\010segments\030\001 \003(\013" - + "2F.google.cloud.dialogflow.cx.v3beta1.Re" - + "sponseMessage.MixedAudio.Segment\032^\n\007Segm" - + "ent\022\017\n\005audio\030\001 \001(\014H\000\022\r\n\003uri\030\002 \001(\tH\000\022(\n\033a" - + "llow_playback_interruption\030\003 \001(\010B\003\340A\003B\t\n" - + "\007content\032\020\n\016EndInteraction\032M\n\tPlayAudio\022" - + "\026\n\taudio_uri\030\001 \001(\tB\003\340A\002\022(\n\033allow_playbac" - + "k_interruption\030\002 \001(\010B\003\340A\003B\t\n\007messageB\263\001\n" + + "\006source\032M\n\tPlayAudio\022\026\n\taudio_uri\030\001 \001(\tB" + + "\003\340A\002\022(\n\033allow_playback_interruption\030\002 \001(" + + "\010B\003\340A\003\032\020\n\016EndInteraction\032\306\001\n\nMixedAudio\022" + + "X\n\010segments\030\001 \003(\0132F.google.cloud.dialogf" + + "low.cx.v3beta1.ResponseMessage.MixedAudi" + + "o.Segment\032^\n\007Segment\022\017\n\005audio\030\001 \001(\014H\000\022\r\n" + + "\003uri\030\002 \001(\tH\000\022(\n\033allow_playback_interrupt" + + "ion\030\003 \001(\010B\003\340A\003B\t\n\007contentB\t\n\007messageB\263\001\n" + "&com.google.cloud.dialogflow.cx.v3beta1B" + "\024ResponseMessageProtoP\001ZDgoogle.golang.o" + "rg/genproto/googleapis/cloud/dialogflow/" @@ -180,25 +180,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Text", "Ssml", "AllowPlaybackInterruption", "Source", }); - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor = internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor .getNestedTypes() .get(4); - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor, - new java.lang.String[] { - "Segments", - }); - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor = - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor - .getNestedTypes() - .get(0); - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor, + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor, new java.lang.String[] { - "Audio", "Uri", "AllowPlaybackInterruption", "Content", + "AudioUri", "AllowPlaybackInterruption", }); internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor = internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor @@ -208,15 +198,25 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_EndInteraction_descriptor, new java.lang.String[] {}); - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor = internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_descriptor .getNestedTypes() .get(6); - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_fieldAccessorTable = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_PlayAudio_descriptor, + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor, new java.lang.String[] { - "AudioUri", "AllowPlaybackInterruption", + "Segments", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_ResponseMessage_MixedAudio_Segment_descriptor, + new java.lang.String[] { + "Audio", "Uri", "AllowPlaybackInterruption", "Content", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java index f76943b5f..9439aee95 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/SessionProto.java @@ -51,6 +51,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_WebhookHeadersEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_WebhookHeadersEntry_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -165,7 +169,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "eechWordInfo\0224\n\021speech_end_offset\030\010 \001(\0132" + "\031.google.protobuf.Duration\"X\n\013MessageTyp" + "e\022\034\n\030MESSAGE_TYPE_UNSPECIFIED\020\000\022\016\n\nTRANS" - + "CRIPT\020\001\022\033\n\027END_OF_SINGLE_UTTERANCE\020\002\"\241\002\n" + + "CRIPT\020\001\022\033\n\027END_OF_SINGLE_UTTERANCE\020\002\"\272\003\n" + "\017QueryParameters\022\021\n\ttime_zone\030\001 \001(\t\022)\n\014g" + "eo_location\030\002 \001(\0132\023.google.type.LatLng\022S" + "\n\024session_entity_types\030\003 \003(\01325.google.cl" @@ -173,119 +177,123 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ype\022(\n\007payload\030\004 \001(\0132\027.google.protobuf.S" + "truct\022+\n\nparameters\030\005 \001(\0132\027.google.proto" + "buf.Struct\022$\n\034analyze_query_text_sentime" - + "nt\030\010 \001(\010\"\364\002\n\nQueryInput\022=\n\004text\030\002 \001(\0132-." - + "google.cloud.dialogflow.cx.v3beta1.TextI" - + "nputH\000\022A\n\006intent\030\003 \001(\0132/.google.cloud.di" - + "alogflow.cx.v3beta1.IntentInputH\000\022?\n\005aud" - + "io\030\005 \001(\0132..google.cloud.dialogflow.cx.v3" - + "beta1.AudioInputH\000\022?\n\005event\030\006 \001(\0132..goog" - + "le.cloud.dialogflow.cx.v3beta1.EventInpu" - + "tH\000\022=\n\004dtmf\030\007 \001(\0132-.google.cloud.dialogf" - + "low.cx.v3beta1.DtmfInputH\000\022\032\n\rlanguage_c" - + "ode\030\004 \001(\tB\003\340A\002B\007\n\005input\"\331\005\n\013QueryResult\022" - + "\016\n\004text\030\001 \001(\tH\000\022\030\n\016trigger_intent\030\013 \001(\tH" - + "\000\022\024\n\ntranscript\030\014 \001(\tH\000\022\027\n\rtrigger_event" - + "\030\016 \001(\tH\000\022\025\n\rlanguage_code\030\002 \001(\t\022+\n\nparam" - + "eters\030\003 \001(\0132\027.google.protobuf.Struct\022N\n\021" - + "response_messages\030\004 \003(\01323.google.cloud.d" - + "ialogflow.cx.v3beta1.ResponseMessage\022,\n\020" - + "webhook_statuses\030\r \003(\0132\022.google.rpc.Stat" - + "us\0221\n\020webhook_payloads\030\006 \003(\0132\027.google.pr" - + "otobuf.Struct\022>\n\014current_page\030\007 \001(\0132(.go" - + "ogle.cloud.dialogflow.cx.v3beta1.Page\022>\n" - + "\006intent\030\010 \001(\0132*.google.cloud.dialogflow." - + "cx.v3beta1.IntentB\002\030\001\022\'\n\033intent_detectio" - + "n_confidence\030\t \001(\002B\002\030\001\0228\n\005match\030\017 \001(\0132)." - + "google.cloud.dialogflow.cx.v3beta1.Match" - + "\0220\n\017diagnostic_info\030\n \001(\0132\027.google.proto" - + "buf.Struct\022^\n\031sentiment_analysis_result\030" - + "\021 \001(\0132;.google.cloud.dialogflow.cx.v3bet" - + "a1.SentimentAnalysisResultB\007\n\005query\"\036\n\tT" - + "extInput\022\021\n\004text\030\001 \001(\tB\003\340A\002\"G\n\013IntentInp" - + "ut\0228\n\006intent\030\001 \001(\tB(\340A\002\372A\"\n dialogflow.g" - + "oogleapis.com/Intent\"f\n\nAudioInput\022I\n\006co" - + "nfig\030\001 \001(\01324.google.cloud.dialogflow.cx." - + "v3beta1.InputAudioConfigB\003\340A\002\022\r\n\005audio\030\002" - + " \001(\014\"\033\n\nEventInput\022\r\n\005event\030\001 \001(\t\"1\n\tDtm" - + "fInput\022\016\n\006digits\030\001 \001(\t\022\024\n\014finish_digit\030\002" - + " \001(\t\"\373\002\n\005Match\022:\n\006intent\030\001 \001(\0132*.google." - + "cloud.dialogflow.cx.v3beta1.Intent\022\r\n\005ev" - + "ent\030\006 \001(\t\022+\n\nparameters\030\002 \001(\0132\027.google.p" - + "rotobuf.Struct\022\026\n\016resolved_input\030\003 \001(\t\022G" - + "\n\nmatch_type\030\004 \001(\01623.google.cloud.dialog" - + "flow.cx.v3beta1.Match.MatchType\022\022\n\nconfi" - + "dence\030\005 \001(\002\"\204\001\n\tMatchType\022\032\n\026MATCH_TYPE_" - + "UNSPECIFIED\020\000\022\n\n\006INTENT\020\001\022\021\n\rDIRECT_INTE" - + "NT\020\002\022\025\n\021PARAMETER_FILLING\020\003\022\014\n\010NO_MATCH\020" - + "\004\022\014\n\010NO_INPUT\020\005\022\t\n\005EVENT\020\006\"\345\001\n\022MatchInte" - + "ntRequest\022:\n\007session\030\001 \001(\tB)\340A\002\372A#\n!dial" - + "ogflow.googleapis.com/Session\022I\n\014query_p" - + "arams\030\002 \001(\01323.google.cloud.dialogflow.cx" - + ".v3beta1.QueryParameters\022H\n\013query_input\030" - + "\003 \001(\0132..google.cloud.dialogflow.cx.v3bet" - + "a1.QueryInputB\003\340A\002\"\363\001\n\023MatchIntentRespon" - + "se\022\016\n\004text\030\001 \001(\tH\000\022\030\n\016trigger_intent\030\002 \001" - + "(\tH\000\022\024\n\ntranscript\030\003 \001(\tH\000\022\027\n\rtrigger_ev" - + "ent\030\006 \001(\tH\000\022:\n\007matches\030\004 \003(\0132).google.cl" - + "oud.dialogflow.cx.v3beta1.Match\022>\n\014curre" - + "nt_page\030\005 \001(\0132(.google.cloud.dialogflow." - + "cx.v3beta1.PageB\007\n\005query\"\372\001\n\024FulfillInte" - + "ntRequest\022T\n\024match_intent_request\030\001 \001(\0132" - + "6.google.cloud.dialogflow.cx.v3beta1.Mat" - + "chIntentRequest\0228\n\005match\030\002 \001(\0132).google." - + "cloud.dialogflow.cx.v3beta1.Match\022R\n\023out" - + "put_audio_config\030\003 \001(\01325.google.cloud.di" - + "alogflow.cx.v3beta1.OutputAudioConfig\"\335\001" - + "\n\025FulfillIntentResponse\022\023\n\013response_id\030\001" - + " \001(\t\022E\n\014query_result\030\002 \001(\0132/.google.clou" - + "d.dialogflow.cx.v3beta1.QueryResult\022\024\n\014o" - + "utput_audio\030\003 \001(\014\022R\n\023output_audio_config" - + "\030\004 \001(\01325.google.cloud.dialogflow.cx.v3be" - + "ta1.OutputAudioConfig\";\n\027SentimentAnalys" - + "isResult\022\r\n\005score\030\001 \001(\002\022\021\n\tmagnitude\030\002 \001" - + "(\0022\212\n\n\010Sessions\022\272\002\n\014DetectIntent\0227.googl" - + "e.cloud.dialogflow.cx.v3beta1.DetectInte" - + "ntRequest\0328.google.cloud.dialogflow.cx.v" - + "3beta1.DetectIntentResponse\"\266\001\202\323\344\223\002\257\001\"J/" - + "v3beta1/{session=projects/*/locations/*/" - + "agents/*/sessions/*}:detectIntent:\001*Z^\"Y" - + "/v3beta1/{session=projects/*/locations/*" - + "/agents/*/environments/*/sessions/*}:det" - + "ectIntent:\001*\022\242\001\n\025StreamingDetectIntent\022@" - + ".google.cloud.dialogflow.cx.v3beta1.Stre" - + "amingDetectIntentRequest\032A.google.cloud." - + "dialogflow.cx.v3beta1.StreamingDetectInt" - + "entResponse\"\000(\0010\001\022\265\002\n\013MatchIntent\0226.goog" - + "le.cloud.dialogflow.cx.v3beta1.MatchInte" - + "ntRequest\0327.google.cloud.dialogflow.cx.v" - + "3beta1.MatchIntentResponse\"\264\001\202\323\344\223\002\255\001\"I/v" - + "3beta1/{session=projects/*/locations/*/a" - + "gents/*/sessions/*}:matchIntent:\001*Z]\"X/v" - + "3beta1/{session=projects/*/locations/*/a" - + "gents/*/environments/*/sessions/*}:match" - + "Intent:\001*\022\351\002\n\rFulfillIntent\0228.google.clo" - + "ud.dialogflow.cx.v3beta1.FulfillIntentRe" - + "quest\0329.google.cloud.dialogflow.cx.v3bet" - + "a1.FulfillIntentResponse\"\342\001\202\323\344\223\002\333\001\"`/v3b" - + "eta1/{match_intent_request.session=proje" - + "cts/*/locations/*/agents/*/sessions/*}:f" - + "ulfillIntent:\001*Zt\"o/v3beta1/{match_inten" - + "t_request.session=projects/*/locations/*" - + "/agents/*/environments/*/sessions/*}:ful" - + "fillIntent:\001*\032x\312A\031dialogflow.googleapis." - + "com\322AYhttps://www.googleapis.com/auth/cl" - + "oud-platform,https://www.googleapis.com/" - + "auth/dialogflowB\203\003\n&com.google.cloud.dia" - + "logflow.cx.v3beta1B\014SessionProtoP\001ZDgoog" - + "le.golang.org/genproto/googleapis/cloud/" - + "dialogflow/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Googl" - + "e.Cloud.Dialogflow.Cx.V3Beta1\352A\324\001\n!dialo" - + "gflow.googleapis.com/Session\022Iprojects/{" - + "project}/locations/{location}/agents/{ag" - + "ent}/sessions/{session}\022dprojects/{proje" - + "ct}/locations/{location}/agents/{agent}/" - + "environments/{environment}/sessions/{ses" - + "sion}b\006proto3" + + "nt\030\010 \001(\010\022`\n\017webhook_headers\030\n \003(\0132G.goog" + + "le.cloud.dialogflow.cx.v3beta1.QueryPara" + + "meters.WebhookHeadersEntry\0325\n\023WebhookHea" + + "dersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028" + + "\001\"\364\002\n\nQueryInput\022=\n\004text\030\002 \001(\0132-.google." + + "cloud.dialogflow.cx.v3beta1.TextInputH\000\022" + + "A\n\006intent\030\003 \001(\0132/.google.cloud.dialogflo" + + "w.cx.v3beta1.IntentInputH\000\022?\n\005audio\030\005 \001(" + + "\0132..google.cloud.dialogflow.cx.v3beta1.A" + + "udioInputH\000\022?\n\005event\030\006 \001(\0132..google.clou" + + "d.dialogflow.cx.v3beta1.EventInputH\000\022=\n\004" + + "dtmf\030\007 \001(\0132-.google.cloud.dialogflow.cx." + + "v3beta1.DtmfInputH\000\022\032\n\rlanguage_code\030\004 \001" + + "(\tB\003\340A\002B\007\n\005input\"\331\005\n\013QueryResult\022\016\n\004text" + + "\030\001 \001(\tH\000\022\030\n\016trigger_intent\030\013 \001(\tH\000\022\024\n\ntr" + + "anscript\030\014 \001(\tH\000\022\027\n\rtrigger_event\030\016 \001(\tH" + + "\000\022\025\n\rlanguage_code\030\002 \001(\t\022+\n\nparameters\030\003" + + " \001(\0132\027.google.protobuf.Struct\022N\n\021respons" + + "e_messages\030\004 \003(\01323.google.cloud.dialogfl" + + "ow.cx.v3beta1.ResponseMessage\022,\n\020webhook" + + "_statuses\030\r \003(\0132\022.google.rpc.Status\0221\n\020w" + + "ebhook_payloads\030\006 \003(\0132\027.google.protobuf." + + "Struct\022>\n\014current_page\030\007 \001(\0132(.google.cl" + + "oud.dialogflow.cx.v3beta1.Page\022>\n\006intent" + + "\030\010 \001(\0132*.google.cloud.dialogflow.cx.v3be" + + "ta1.IntentB\002\030\001\022\'\n\033intent_detection_confi" + + "dence\030\t \001(\002B\002\030\001\0228\n\005match\030\017 \001(\0132).google." + + "cloud.dialogflow.cx.v3beta1.Match\0220\n\017dia" + + "gnostic_info\030\n \001(\0132\027.google.protobuf.Str" + + "uct\022^\n\031sentiment_analysis_result\030\021 \001(\0132;" + + ".google.cloud.dialogflow.cx.v3beta1.Sent" + + "imentAnalysisResultB\007\n\005query\"\036\n\tTextInpu" + + "t\022\021\n\004text\030\001 \001(\tB\003\340A\002\"G\n\013IntentInput\0228\n\006i" + + "ntent\030\001 \001(\tB(\340A\002\372A\"\n dialogflow.googleap" + + "is.com/Intent\"f\n\nAudioInput\022I\n\006config\030\001 " + + "\001(\01324.google.cloud.dialogflow.cx.v3beta1" + + ".InputAudioConfigB\003\340A\002\022\r\n\005audio\030\002 \001(\014\"\033\n" + + "\nEventInput\022\r\n\005event\030\001 \001(\t\"1\n\tDtmfInput\022" + + "\016\n\006digits\030\001 \001(\t\022\024\n\014finish_digit\030\002 \001(\t\"\373\002" + + "\n\005Match\022:\n\006intent\030\001 \001(\0132*.google.cloud.d" + + "ialogflow.cx.v3beta1.Intent\022\r\n\005event\030\006 \001" + + "(\t\022+\n\nparameters\030\002 \001(\0132\027.google.protobuf" + + ".Struct\022\026\n\016resolved_input\030\003 \001(\t\022G\n\nmatch" + + "_type\030\004 \001(\01623.google.cloud.dialogflow.cx" + + ".v3beta1.Match.MatchType\022\022\n\nconfidence\030\005" + + " \001(\002\"\204\001\n\tMatchType\022\032\n\026MATCH_TYPE_UNSPECI" + + "FIED\020\000\022\n\n\006INTENT\020\001\022\021\n\rDIRECT_INTENT\020\002\022\025\n" + + "\021PARAMETER_FILLING\020\003\022\014\n\010NO_MATCH\020\004\022\014\n\010NO" + + "_INPUT\020\005\022\t\n\005EVENT\020\006\"\345\001\n\022MatchIntentReque" + + "st\022:\n\007session\030\001 \001(\tB)\340A\002\372A#\n!dialogflow." + + "googleapis.com/Session\022I\n\014query_params\030\002" + + " \001(\01323.google.cloud.dialogflow.cx.v3beta" + + "1.QueryParameters\022H\n\013query_input\030\003 \001(\0132." + + ".google.cloud.dialogflow.cx.v3beta1.Quer" + + "yInputB\003\340A\002\"\363\001\n\023MatchIntentResponse\022\016\n\004t" + + "ext\030\001 \001(\tH\000\022\030\n\016trigger_intent\030\002 \001(\tH\000\022\024\n" + + "\ntranscript\030\003 \001(\tH\000\022\027\n\rtrigger_event\030\006 \001" + + "(\tH\000\022:\n\007matches\030\004 \003(\0132).google.cloud.dia" + + "logflow.cx.v3beta1.Match\022>\n\014current_page" + + "\030\005 \001(\0132(.google.cloud.dialogflow.cx.v3be" + + "ta1.PageB\007\n\005query\"\372\001\n\024FulfillIntentReque" + + "st\022T\n\024match_intent_request\030\001 \001(\01326.googl" + + "e.cloud.dialogflow.cx.v3beta1.MatchInten" + + "tRequest\0228\n\005match\030\002 \001(\0132).google.cloud.d" + + "ialogflow.cx.v3beta1.Match\022R\n\023output_aud" + + "io_config\030\003 \001(\01325.google.cloud.dialogflo" + + "w.cx.v3beta1.OutputAudioConfig\"\335\001\n\025Fulfi" + + "llIntentResponse\022\023\n\013response_id\030\001 \001(\t\022E\n" + + "\014query_result\030\002 \001(\0132/.google.cloud.dialo" + + "gflow.cx.v3beta1.QueryResult\022\024\n\014output_a" + + "udio\030\003 \001(\014\022R\n\023output_audio_config\030\004 \001(\0132" + + "5.google.cloud.dialogflow.cx.v3beta1.Out" + + "putAudioConfig\";\n\027SentimentAnalysisResul" + + "t\022\r\n\005score\030\001 \001(\002\022\021\n\tmagnitude\030\002 \001(\0022\212\n\n\010" + + "Sessions\022\272\002\n\014DetectIntent\0227.google.cloud" + + ".dialogflow.cx.v3beta1.DetectIntentReque" + + "st\0328.google.cloud.dialogflow.cx.v3beta1." + + "DetectIntentResponse\"\266\001\202\323\344\223\002\257\001\"J/v3beta1" + + "/{session=projects/*/locations/*/agents/" + + "*/sessions/*}:detectIntent:\001*Z^\"Y/v3beta" + + "1/{session=projects/*/locations/*/agents" + + "/*/environments/*/sessions/*}:detectInte" + + "nt:\001*\022\242\001\n\025StreamingDetectIntent\022@.google" + + ".cloud.dialogflow.cx.v3beta1.StreamingDe" + + "tectIntentRequest\032A.google.cloud.dialogf" + + "low.cx.v3beta1.StreamingDetectIntentResp" + + "onse\"\000(\0010\001\022\265\002\n\013MatchIntent\0226.google.clou" + + "d.dialogflow.cx.v3beta1.MatchIntentReque" + + "st\0327.google.cloud.dialogflow.cx.v3beta1." + + "MatchIntentResponse\"\264\001\202\323\344\223\002\255\001\"I/v3beta1/" + + "{session=projects/*/locations/*/agents/*" + + "/sessions/*}:matchIntent:\001*Z]\"X/v3beta1/" + + "{session=projects/*/locations/*/agents/*" + + "/environments/*/sessions/*}:matchIntent:" + + "\001*\022\351\002\n\rFulfillIntent\0228.google.cloud.dial" + + "ogflow.cx.v3beta1.FulfillIntentRequest\0329" + + ".google.cloud.dialogflow.cx.v3beta1.Fulf" + + "illIntentResponse\"\342\001\202\323\344\223\002\333\001\"`/v3beta1/{m" + + "atch_intent_request.session=projects/*/l" + + "ocations/*/agents/*/sessions/*}:fulfillI" + + "ntent:\001*Zt\"o/v3beta1/{match_intent_reque" + + "st.session=projects/*/locations/*/agents" + + "/*/environments/*/sessions/*}:fulfillInt" + + "ent:\001*\032x\312A\031dialogflow.googleapis.com\322AYh" + + "ttps://www.googleapis.com/auth/cloud-pla" + + "tform,https://www.googleapis.com/auth/di" + + "alogflowB\203\003\n&com.google.cloud.dialogflow" + + ".cx.v3beta1B\014SessionProtoP\001ZDgoogle.gola" + + "ng.org/genproto/googleapis/cloud/dialogf" + + "low/cx/v3beta1;cx\370\001\001\242\002\002DF\252\002\"Google.Cloud" + + ".Dialogflow.Cx.V3Beta1\352A\324\001\n!dialogflow.g" + + "oogleapis.com/Session\022Iprojects/{project" + + "}/locations/{location}/agents/{agent}/se" + + "ssions/{session}\022dprojects/{project}/loc" + + "ations/{location}/agents/{agent}/environ" + + "ments/{environment}/sessions/{session}b\006" + + "proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -364,6 +372,17 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Payload", "Parameters", "AnalyzeQueryTextSentiment", + "WebhookHeaders", + }); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_WebhookHeadersEntry_descriptor = + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_WebhookHeadersEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_cx_v3beta1_QueryParameters_WebhookHeadersEntry_descriptor, + new java.lang.String[] { + "Key", "Value", }); internal_static_google_cloud_dialogflow_cx_v3beta1_QueryInput_descriptor = getDescriptor().getMessageTypes().get(6); diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequest.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequest.java index 81cec9313..d75112211 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequest.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequest.java @@ -201,6 +201,9 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } @@ -235,6 +238,9 @@ public java.lang.String getSession() { * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } @@ -854,6 +860,9 @@ public Builder mergeFrom( * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } @@ -887,6 +896,9 @@ public java.lang.String getSession() { * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } @@ -920,6 +932,9 @@ public com.google.protobuf.ByteString getSessionBytes() { * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } @@ -952,6 +967,9 @@ public Builder setSession(java.lang.String value) { * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } @@ -980,6 +998,9 @@ public Builder clearSession() { * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequestOrBuilder.java b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequestOrBuilder.java index 2392d7a58..e9bed50d9 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequestOrBuilder.java +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/StreamingDetectIntentRequestOrBuilder.java @@ -39,6 +39,9 @@ public interface StreamingDetectIntentRequestOrBuilder * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } @@ -62,6 +65,9 @@ public interface StreamingDetectIntentRequestOrBuilder * Note: session must be set in the first request. * For more information, see the [sessions * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + * Note: Always use agent versions for production traffic. + * See [Versions and + * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). * * * string session = 1 [(.google.api.resource_reference) = { ... } diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/response_message.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/response_message.proto index 7a9f96500..ac3b61cd0 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/response_message.proto +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/response_message.proto @@ -113,6 +113,25 @@ message ResponseMessage { bool allow_playback_interruption = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; } + // Specifies an audio clip to be played by the client as part of the response. + message PlayAudio { + // Required. URI of the audio clip. Dialogflow does not impose any validation on this + // value. It is specific to the client that reads it. + string audio_uri = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Whether the playback of this message can be interrupted by the end + // user's speech and the client can then starts the next Dialogflow + // request. + bool allow_playback_interruption = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Indicates that interaction with the Dialogflow agent has ended. + // This message is generated by Dialogflow only and not supposed to be + // defined by the user. + message EndInteraction { + + } + // Represents an audio message that is composed of both segments // synthesized from the Dialogflow agent prompts and ones hosted externally // at the specified URIs. @@ -144,25 +163,6 @@ message ResponseMessage { repeated Segment segments = 1; } - // Indicates that interaction with the Dialogflow agent has ended. - // This message is generated by Dialogflow only and not supposed to be - // defined by the user. - message EndInteraction { - - } - - // Specifies an audio clip to be played by the client as part of the response. - message PlayAudio { - // Required. URI of the audio clip. Dialogflow does not impose any validation on this - // value. It is specific to the client that reads it. - string audio_uri = 1 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Whether the playback of this message can be interrupted by the end - // user's speech and the client can then starts the next Dialogflow - // request. - bool allow_playback_interruption = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - } - // Required. The rich response message. oneof message { // Returns a text response. diff --git a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto index 9b94a19db..8b4040815 100644 --- a/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto +++ b/proto-google-cloud-dialogflow-cx-v3beta1/src/main/proto/google/cloud/dialogflow/cx/v3beta1/session.proto @@ -57,6 +57,10 @@ service Sessions { // as a result. This method is not idempotent, because it may cause session // entity types to be updated, which in turn might affect results of future // queries. + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). rpc DetectIntent(DetectIntentRequest) returns (DetectIntentResponse) { option (google.api.http) = { post: "/v3beta1/{session=projects/*/locations/*/agents/*/sessions/*}:detectIntent" @@ -71,6 +75,10 @@ service Sessions { // Processes a natural language query in audio format in a streaming fashion // and returns structured, actionable data as a result. This method is only // available via the gRPC API (not REST). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). rpc StreamingDetectIntent(stream StreamingDetectIntentRequest) returns (stream StreamingDetectIntentResponse) { } @@ -116,6 +124,10 @@ message DetectIntentRequest { // // For more information, see the [sessions // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). string session = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -201,6 +213,10 @@ message StreamingDetectIntentRequest { // // For more information, see the [sessions // guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). + // + // Note: Always use agent versions for production traffic. + // See [Versions and + // environments](https://cloud.google.com/dialogflow/cx/docs/concept/version). string session = 1 [(google.api.resource_reference) = { type: "dialogflow.googleapis.com/Session" }]; @@ -374,6 +390,16 @@ message QueryParameters { // Configures whether sentiment analysis should be performed. If not // provided, sentiment analysis is not performed. bool analyze_query_text_sentiment = 8; + + // This field can be used to pass HTTP headers for a webhook + // call. These headers will be sent to webhook along with the headers that + // have been configured through Dialogflow web console. The headers defined + // within this field will overwrite the headers configured through Dialogflow + // console if there is a conflict. Header names are case-insensitive. + // Google's specified headers are not allowed. Including: "Host", + // "Content-Length", "Connection", "From", "User-Agent", "Accept-Encoding", + // "If-Modified-Since", "If-None-Match", "X-Forwarded-For", etc. + map webhook_headers = 10; } // Represents the query input. It can contain one of: diff --git a/synth.metadata b/synth.metadata index da99289b5..fcdbe2cdb 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,16 +11,16 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19", - "internalRef": "346372957" + "sha": "e4d01555afeb93d2f3b467056ea884b092567d1b", + "internalRef": "346434847" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "857f70daef9f4c38f042fb3dfb7b8423ae18fd19", - "internalRef": "346372957" + "sha": "e4d01555afeb93d2f3b467056ea884b092567d1b", + "internalRef": "346434847" } }, {