From 2c812e13713fcf40bd71f90cbfb38b29f055cd4b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 19 Apr 2022 14:22:12 +0000 Subject: [PATCH] fix!: correct broken ConversationModelEvaluation resource pattern (#914) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 442646533 Source-Link: https://github.com/googleapis/googleapis/commit/b62c5624bd0e6d84af879f8cea7b5862efb2a131 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f5c157c68115847d78eb8412734cb82e7d5515b4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjVjMTU3YzY4MTE1ODQ3ZDc4ZWI4NDEyNzM0Y2I4MmU3ZDU1MTViNCJ9 --- .../v2/ConversationModelsClientTest.java | 15 +- .../cloud/dialogflow/v2/AudioConfigProto.java | 7 +- .../v2/ConversationModelEvaluationName.java | 388 ++++++++++++++++++ .../dialogflow/v2/ConversationModelProto.java | 333 +++++++-------- .../cloud/dialogflow/v2/audio_config.proto | 4 + .../dialogflow/v2/conversation_model.proto | 6 +- 6 files changed, 579 insertions(+), 174 deletions(-) create mode 100644 proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelEvaluationName.java diff --git a/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ConversationModelsClientTest.java b/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ConversationModelsClientTest.java index 7d51a2ad5..2fe443042 100644 --- a/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ConversationModelsClientTest.java +++ b/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ConversationModelsClientTest.java @@ -372,7 +372,10 @@ public void undeployConversationModelExceptionTest() throws Exception { public void getConversationModelEvaluationTest() throws Exception { ConversationModelEvaluation expectedResponse = ConversationModelEvaluation.newBuilder() - .setName("name3373707") + .setName( + ConversationModelEvaluationName.ofProjectConversationModelEvaluationName( + "[PROJECT]", "[CONVERSATION_MODEL]", "[EVALUATION]") + .toString()) .setDisplayName("displayName1714148973") .setEvaluationConfig(EvaluationConfig.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -462,7 +465,10 @@ public void listConversationModelEvaluationsExceptionTest() throws Exception { public void createConversationModelEvaluationTest() throws Exception { ConversationModelEvaluation expectedResponse = ConversationModelEvaluation.newBuilder() - .setName("name3373707") + .setName( + ConversationModelEvaluationName.ofProjectConversationModelEvaluationName( + "[PROJECT]", "[CONVERSATION_MODEL]", "[EVALUATION]") + .toString()) .setDisplayName("displayName1714148973") .setEvaluationConfig(EvaluationConfig.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) @@ -523,7 +529,10 @@ public void createConversationModelEvaluationExceptionTest() throws Exception { public void createConversationModelEvaluationTest2() throws Exception { ConversationModelEvaluation expectedResponse = ConversationModelEvaluation.newBuilder() - .setName("name3373707") + .setName( + ConversationModelEvaluationName.ofProjectConversationModelEvaluationName( + "[PROJECT]", "[CONVERSATION_MODEL]", "[EVALUATION]") + .toString()) .setDisplayName("displayName1714148973") .setEvaluationConfig(EvaluationConfig.newBuilder().build()) .setCreateTime(Timestamp.newBuilder().build()) diff --git a/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java b/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java index 680e70e81..2d40d31e6 100644 --- a/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java +++ b/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java @@ -117,11 +117,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "OUTPUT_AUDIO_ENCODING_MP3\020\002\022%\n!OUTPUT_AU" + "DIO_ENCODING_MP3_64_KBPS\020\004\022\"\n\036OUTPUT_AUD" + "IO_ENCODING_OGG_OPUS\020\003\022\037\n\033OUTPUT_AUDIO_E" - + "NCODING_MULAW\020\005B\237\001\n\036com.google.cloud.dia" + + "NCODING_MULAW\020\005B\367\001\n\036com.google.cloud.dia" + "logflow.v2B\020AudioConfigProtoP\001ZDgoogle.g" + "olang.org/genproto/googleapis/cloud/dial" + "ogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cl" - + "oud.Dialogflow.V2b\006proto3" + + "oud.Dialogflow.V2\352AU\n\033automl.googleapis." + + "com/Model\0226projects/{project}/locations/" + + "{location}/models/{model}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -199,6 +201,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resourceDefinition); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); diff --git a/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelEvaluationName.java b/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelEvaluationName.java new file mode 100644 index 000000000..fbd0309b2 --- /dev/null +++ b/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelEvaluationName.java @@ -0,0 +1,388 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.dialogflow.v2; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +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. +@Generated("by gapic-generator-java") +public class ConversationModelEvaluationName implements ResourceName { + private static final PathTemplate PROJECT_CONVERSATION_MODEL_EVALUATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}"); + private static final PathTemplate PROJECT_LOCATION_CONVERSATION_MODEL_EVALUATION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String conversationModel; + private final String evaluation; + private final String location; + + @Deprecated + protected ConversationModelEvaluationName() { + project = null; + conversationModel = null; + evaluation = null; + location = null; + } + + private ConversationModelEvaluationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + conversationModel = Preconditions.checkNotNull(builder.getConversationModel()); + evaluation = Preconditions.checkNotNull(builder.getEvaluation()); + location = null; + pathTemplate = PROJECT_CONVERSATION_MODEL_EVALUATION; + } + + private ConversationModelEvaluationName( + ProjectLocationConversationModelEvaluationBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + conversationModel = Preconditions.checkNotNull(builder.getConversationModel()); + evaluation = Preconditions.checkNotNull(builder.getEvaluation()); + pathTemplate = PROJECT_LOCATION_CONVERSATION_MODEL_EVALUATION; + } + + public String getProject() { + return project; + } + + public String getConversationModel() { + return conversationModel; + } + + public String getEvaluation() { + return evaluation; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectConversationModelEvaluationBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationConversationModelEvaluationBuilder + newProjectLocationConversationModelEvaluationBuilder() { + return new ProjectLocationConversationModelEvaluationBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static ConversationModelEvaluationName of( + String project, String conversationModel, String evaluation) { + return newBuilder() + .setProject(project) + .setConversationModel(conversationModel) + .setEvaluation(evaluation) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ConversationModelEvaluationName ofProjectConversationModelEvaluationName( + String project, String conversationModel, String evaluation) { + return newBuilder() + .setProject(project) + .setConversationModel(conversationModel) + .setEvaluation(evaluation) + .build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static ConversationModelEvaluationName ofProjectLocationConversationModelEvaluationName( + String project, String location, String conversationModel, String evaluation) { + return newProjectLocationConversationModelEvaluationBuilder() + .setProject(project) + .setLocation(location) + .setConversationModel(conversationModel) + .setEvaluation(evaluation) + .build(); + } + + public static String format(String project, String conversationModel, String evaluation) { + return newBuilder() + .setProject(project) + .setConversationModel(conversationModel) + .setEvaluation(evaluation) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectConversationModelEvaluationName( + String project, String conversationModel, String evaluation) { + return newBuilder() + .setProject(project) + .setConversationModel(conversationModel) + .setEvaluation(evaluation) + .build() + .toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationConversationModelEvaluationName( + String project, String location, String conversationModel, String evaluation) { + return newProjectLocationConversationModelEvaluationBuilder() + .setProject(project) + .setLocation(location) + .setConversationModel(conversationModel) + .setEvaluation(evaluation) + .build() + .toString(); + } + + public static ConversationModelEvaluationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_CONVERSATION_MODEL_EVALUATION.matches(formattedString)) { + Map matchMap = PROJECT_CONVERSATION_MODEL_EVALUATION.match(formattedString); + return ofProjectConversationModelEvaluationName( + matchMap.get("project"), matchMap.get("conversation_model"), matchMap.get("evaluation")); + } else if (PROJECT_LOCATION_CONVERSATION_MODEL_EVALUATION.matches(formattedString)) { + Map matchMap = + PROJECT_LOCATION_CONVERSATION_MODEL_EVALUATION.match(formattedString); + return ofProjectLocationConversationModelEvaluationName( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("conversation_model"), + matchMap.get("evaluation")); + } + throw new ValidationException( + "ConversationModelEvaluationName.parse: formattedString not in valid format"); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (ConversationModelEvaluationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_CONVERSATION_MODEL_EVALUATION.matches(formattedString) + || PROJECT_LOCATION_CONVERSATION_MODEL_EVALUATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (conversationModel != null) { + fieldMapBuilder.put("conversation_model", conversationModel); + } + if (evaluation != null) { + fieldMapBuilder.put("evaluation", evaluation); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + ConversationModelEvaluationName that = ((ConversationModelEvaluationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.conversationModel, that.conversationModel) + && Objects.equals(this.evaluation, that.evaluation) + && Objects.equals(this.location, that.location); + } + 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(conversationModel); + h *= 1000003; + h ^= Objects.hashCode(evaluation); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** + * Builder for + * projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}. + */ + public static class Builder { + private String project; + private String conversationModel; + private String evaluation; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getConversationModel() { + return conversationModel; + } + + public String getEvaluation() { + return evaluation; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setConversationModel(String conversationModel) { + this.conversationModel = conversationModel; + return this; + } + + public Builder setEvaluation(String evaluation) { + this.evaluation = evaluation; + return this; + } + + private Builder(ConversationModelEvaluationName conversationModelEvaluationName) { + Preconditions.checkArgument( + Objects.equals( + conversationModelEvaluationName.pathTemplate, PROJECT_CONVERSATION_MODEL_EVALUATION), + "toBuilder is only supported when ConversationModelEvaluationName has the pattern of projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}"); + this.project = conversationModelEvaluationName.project; + this.conversationModel = conversationModelEvaluationName.conversationModel; + this.evaluation = conversationModelEvaluationName.evaluation; + } + + public ConversationModelEvaluationName build() { + return new ConversationModelEvaluationName(this); + } + } + + /** + * Builder for + * projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}. + */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationConversationModelEvaluationBuilder { + private String project; + private String location; + private String conversationModel; + private String evaluation; + + protected ProjectLocationConversationModelEvaluationBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getConversationModel() { + return conversationModel; + } + + public String getEvaluation() { + return evaluation; + } + + public ProjectLocationConversationModelEvaluationBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationConversationModelEvaluationBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationConversationModelEvaluationBuilder setConversationModel( + String conversationModel) { + this.conversationModel = conversationModel; + return this; + } + + public ProjectLocationConversationModelEvaluationBuilder setEvaluation(String evaluation) { + this.evaluation = evaluation; + return this; + } + + public ConversationModelEvaluationName build() { + return new ConversationModelEvaluationName(this); + } + } +} diff --git a/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelProto.java b/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelProto.java index 7ec27d92f..90f858b94 100644 --- a/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelProto.java +++ b/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ConversationModelProto.java @@ -170,180 +170,181 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ation}/conversationModels/{conversation_" + "model}\022:projects/{project}/conversationM" + "odels/{conversation_model}B\020\n\016model_meta" - + "data\"\241\004\n\033ConversationModelEvaluation\022\014\n\004" + + "data\"\245\004\n\033ConversationModelEvaluation\022\014\n\004" + "name\030\001 \001(\t\022\031\n\014display_name\030\002 \001(\tB\003\340A\001\022L\n" + "\021evaluation_config\030\006 \001(\0132,.google.cloud." + "dialogflow.v2.EvaluationConfigB\003\340A\001\0224\n\013c" + "reate_time\030\003 \001(\0132\032.google.protobuf.Times" + "tampB\003\340A\003\022Q\n\023smart_reply_metrics\030\005 \001(\0132-" + ".google.cloud.dialogflow.v2.SmartReplyMe" - + "tricsB\003\340A\003H\000:\366\001\352A\362\001\n5dialogflow.googleap" - + "is.com/ConversationModelEvaluation\022Qproj" + + "tricsB\003\340A\003H\000:\372\001\352A\366\001\n5dialogflow.googleap" + + "is.com/ConversationModelEvaluation\022Sproj" + "ects/{project}/conversationModels/{conve" - + "rsation_model}/evaluations/evaluation\022fp" - + "rojects/{project}/locations/{location}/c" - + "onversationModels/{conversation_model}/e" - + "valuations/evaluationB\t\n\007metrics\"\234\004\n\020Eva" - + "luationConfig\022?\n\010datasets\030\003 \003(\0132(.google" - + ".cloud.dialogflow.v2.InputDatasetB\003\340A\002\022[" - + "\n\022smart_reply_config\030\002 \001(\0132=.google.clou" - + "d.dialogflow.v2.EvaluationConfig.SmartRe" - + "plyConfigH\000\022_\n\024smart_compose_config\030\004 \001(" - + "\0132?.google.cloud.dialogflow.v2.Evaluatio" - + "nConfig.SmartComposeConfigH\000\032v\n\020SmartRep" - + "lyConfig\022C\n\022allowlist_document\030\001 \001(\tB\'\372A" - + "$\n\"dialogflow.googleapis.com/Document\022\035\n" - + "\020max_result_count\030\002 \001(\005B\003\340A\002\032x\n\022SmartCom" - + "poseConfig\022C\n\022allowlist_document\030\001 \001(\tB\'" - + "\372A$\n\"dialogflow.googleapis.com/Document\022" - + "\035\n\020max_result_count\030\002 \001(\005B\003\340A\002B\027\n\025model_" - + "specific_config\"V\n\014InputDataset\022F\n\007datas" - + "et\030\001 \001(\tB5\340A\002\372A/\n-dialogflow.googleapis." - + "com/ConversationDataset\"{\n\036ArticleSugges" - + "tionModelMetadata\022Y\n\023training_model_type" - + "\030\003 \001(\01627.google.cloud.dialogflow.v2.Conv" - + "ersationModel.ModelTypeB\003\340A\001\"t\n\027SmartRep" - + "lyModelMetadata\022Y\n\023training_model_type\030\006" - + " \001(\01627.google.cloud.dialogflow.v2.Conver" - + "sationModel.ModelTypeB\003\340A\001\"\307\001\n\021SmartRepl" - + "yMetrics\022\032\n\022allowlist_coverage\030\001 \001(\002\022P\n\r" - + "top_n_metrics\030\002 \003(\01329.google.cloud.dialo" - + "gflow.v2.SmartReplyMetrics.TopNMetrics\022\032" - + "\n\022conversation_count\030\003 \001(\003\032(\n\013TopNMetric" - + "s\022\t\n\001n\030\001 \001(\005\022\016\n\006recall\030\002 \001(\002\"\200\001\n\036CreateC" - + "onversationModelRequest\022\016\n\006parent\030\001 \001(\t\022" - + "N\n\022conversation_model\030\002 \001(\0132-.google.clo" - + "ud.dialogflow.v2.ConversationModelB\003\340A\002\"" - + "0\n\033GetConversationModelRequest\022\021\n\004name\030\001" - + " \001(\tB\003\340A\002\"e\n\035ListConversationModelsReque" - + "st\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\026\n\tpage_size\030\002 \001" - + "(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"\205\001\n\036Lis" - + "tConversationModelsResponse\022J\n\023conversat" - + "ion_models\030\001 \003(\0132-.google.cloud.dialogfl" - + "ow.v2.ConversationModel\022\027\n\017next_page_tok" - + "en\030\002 \001(\t\"3\n\036DeleteConversationModelReque" - + "st\022\021\n\004name\030\001 \001(\tB\003\340A\002\"3\n\036DeployConversat" - + "ionModelRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"5\n Un" - + "deployConversationModelRequest\022\021\n\004name\030\001" - + " \001(\tB\003\340A\002\":\n%GetConversationModelEvaluat" - + "ionRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"o\n\'ListCon" - + "versationModelEvaluationsRequest\022\023\n\006pare" - + "nt\030\001 \001(\tB\003\340A\002\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n" - + "\npage_token\030\003 \001(\tB\003\340A\001\"\244\001\n(ListConversat" - + "ionModelEvaluationsResponse\022_\n\036conversat" - + "ion_model_evaluations\030\001 \003(\01327.google.clo" - + "ud.dialogflow.v2.ConversationModelEvalua" - + "tion\022\027\n\017next_page_token\030\002 \001(\t\"\324\001\n(Create" - + "ConversationModelEvaluationRequest\022C\n\006pa" - + "rent\030\001 \001(\tB3\340A\002\372A-\n+dialogflow.googleapi" - + "s.com/ConversationModel\022c\n\035conversation_" - + "model_evaluation\030\002 \001(\01327.google.cloud.di" - + "alogflow.v2.ConversationModelEvaluationB" - + "\003\340A\002\"\307\002\n(CreateConversationModelOperatio" - + "nMetadata\022\032\n\022conversation_model\030\001 \001(\t\022Y\n" - + "\005state\030\002 \001(\0162J.google.cloud.dialogflow.v" - + "2.CreateConversationModelOperationMetada" - + "ta.State\022/\n\013create_time\030\003 \001(\0132\032.google.p" - + "rotobuf.Timestamp\"s\n\005State\022\025\n\021STATE_UNSP" - + "ECIFIED\020\000\022\013\n\007PENDING\020\001\022\r\n\tSUCCEEDED\020\002\022\n\n" - + "\006FAILED\020\003\022\r\n\tCANCELLED\020\004\022\016\n\nCANCELLING\020\005" - + "\022\014\n\010TRAINING\020\006\"w\n(DeployConversationMode" - + "lOperationMetadata\022\032\n\022conversation_model" - + "\030\001 \001(\t\022/\n\013create_time\030\003 \001(\0132\032.google.pro" - + "tobuf.Timestamp\"y\n*UndeployConversationM" - + "odelOperationMetadata\022\032\n\022conversation_mo" - + "del\030\001 \001(\t\022/\n\013create_time\030\003 \001(\0132\032.google." - + "protobuf.Timestamp\"w\n(DeleteConversation" - + "ModelOperationMetadata\022\032\n\022conversation_m" - + "odel\030\001 \001(\t\022/\n\013create_time\030\003 \001(\0132\032.google" - + ".protobuf.Timestamp\"\366\002\n2CreateConversati" - + "onModelEvaluationOperationMetadata\022%\n\035co" - + "nversation_model_evaluation\030\001 \001(\t\022\032\n\022con" - + "versation_model\030\004 \001(\t\022c\n\005state\030\002 \001(\0162T.g" - + "oogle.cloud.dialogflow.v2.CreateConversa" - + "tionModelEvaluationOperationMetadata.Sta" - + "te\022/\n\013create_time\030\003 \001(\0132\032.google.protobu" - + "f.Timestamp\"g\n\005State\022\025\n\021STATE_UNSPECIFIE" - + "D\020\000\022\020\n\014INITIALIZING\020\001\022\013\n\007RUNNING\020\002\022\r\n\tCA" - + "NCELLED\020\003\022\r\n\tSUCCEEDED\020\004\022\n\n\006FAILED\020\0052\376\026\n" - + "\022ConversationModels\022\350\002\n\027CreateConversati" - + "onModel\022:.google.cloud.dialogflow.v2.Cre" - + "ateConversationModelRequest\032\035.google.lon" - + "grunning.Operation\"\361\001\202\323\344\223\002\216\001\"*/v2/{paren" - + "t=projects/*}/conversationModels:\022conver" - + "sation_modelZL\"6/v2/{parent=projects/*/l" - + "ocations/*}/conversationModels:\022conversa" - + "tion_model\332A\031parent,conversation_model\312A" - + "=\n\021ConversationModel\022(CreateConversation" - + "ModelOperationMetadata\022\363\001\n\024GetConversati" - + "onModel\0227.google.cloud.dialogflow.v2.Get" - + "ConversationModelRequest\032-.google.cloud." - + "dialogflow.v2.ConversationModel\"s\202\323\344\223\002f\022" - + "*/v2/{name=projects/*/conversationModels" - + "/*}Z8\0226/v2/{name=projects/*/locations/*/" - + "conversationModels/*}\332A\004name\022\206\002\n\026ListCon" - + "versationModels\0229.google.cloud.dialogflo" - + "w.v2.ListConversationModelsRequest\032:.goo" - + "gle.cloud.dialogflow.v2.ListConversation" - + "ModelsResponse\"u\202\323\344\223\002f\022*/v2/{parent=proj" - + "ects/*}/conversationModelsZ8\0226/v2/{paren" + + "rsation_model}/evaluations/{evaluation}\022" + + "hprojects/{project}/locations/{location}" + + "/conversationModels/{conversation_model}" + + "/evaluations/{evaluation}B\t\n\007metrics\"\234\004\n" + + "\020EvaluationConfig\022?\n\010datasets\030\003 \003(\0132(.go" + + "ogle.cloud.dialogflow.v2.InputDatasetB\003\340" + + "A\002\022[\n\022smart_reply_config\030\002 \001(\0132=.google." + + "cloud.dialogflow.v2.EvaluationConfig.Sma" + + "rtReplyConfigH\000\022_\n\024smart_compose_config\030" + + "\004 \001(\0132?.google.cloud.dialogflow.v2.Evalu" + + "ationConfig.SmartComposeConfigH\000\032v\n\020Smar" + + "tReplyConfig\022C\n\022allowlist_document\030\001 \001(\t" + + "B\'\372A$\n\"dialogflow.googleapis.com/Documen" + + "t\022\035\n\020max_result_count\030\002 \001(\005B\003\340A\002\032x\n\022Smar" + + "tComposeConfig\022C\n\022allowlist_document\030\001 \001" + + "(\tB\'\372A$\n\"dialogflow.googleapis.com/Docum" + + "ent\022\035\n\020max_result_count\030\002 \001(\005B\003\340A\002B\027\n\025mo" + + "del_specific_config\"V\n\014InputDataset\022F\n\007d" + + "ataset\030\001 \001(\tB5\340A\002\372A/\n-dialogflow.googlea" + + "pis.com/ConversationDataset\"{\n\036ArticleSu" + + "ggestionModelMetadata\022Y\n\023training_model_" + + "type\030\003 \001(\01627.google.cloud.dialogflow.v2." + + "ConversationModel.ModelTypeB\003\340A\001\"t\n\027Smar" + + "tReplyModelMetadata\022Y\n\023training_model_ty" + + "pe\030\006 \001(\01627.google.cloud.dialogflow.v2.Co" + + "nversationModel.ModelTypeB\003\340A\001\"\307\001\n\021Smart" + + "ReplyMetrics\022\032\n\022allowlist_coverage\030\001 \001(\002" + + "\022P\n\rtop_n_metrics\030\002 \003(\01329.google.cloud.d" + + "ialogflow.v2.SmartReplyMetrics.TopNMetri" + + "cs\022\032\n\022conversation_count\030\003 \001(\003\032(\n\013TopNMe" + + "trics\022\t\n\001n\030\001 \001(\005\022\016\n\006recall\030\002 \001(\002\"\200\001\n\036Cre" + + "ateConversationModelRequest\022\016\n\006parent\030\001 " + + "\001(\t\022N\n\022conversation_model\030\002 \001(\0132-.google" + + ".cloud.dialogflow.v2.ConversationModelB\003" + + "\340A\002\"0\n\033GetConversationModelRequest\022\021\n\004na" + + "me\030\001 \001(\tB\003\340A\002\"e\n\035ListConversationModelsR" + + "equest\022\023\n\006parent\030\001 \001(\tB\003\340A\002\022\026\n\tpage_size" + + "\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"\205\001\n" + + "\036ListConversationModelsResponse\022J\n\023conve" + + "rsation_models\030\001 \003(\0132-.google.cloud.dial" + + "ogflow.v2.ConversationModel\022\027\n\017next_page" + + "_token\030\002 \001(\t\"3\n\036DeleteConversationModelR" + + "equest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"3\n\036DeployConve" + + "rsationModelRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"5" + + "\n UndeployConversationModelRequest\022\021\n\004na" + + "me\030\001 \001(\tB\003\340A\002\":\n%GetConversationModelEva" + + "luationRequest\022\021\n\004name\030\001 \001(\tB\003\340A\002\"o\n\'Lis" + + "tConversationModelEvaluationsRequest\022\023\n\006" + + "parent\030\001 \001(\tB\003\340A\002\022\026\n\tpage_size\030\002 \001(\005B\003\340A" + + "\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"\244\001\n(ListConve" + + "rsationModelEvaluationsResponse\022_\n\036conve" + + "rsation_model_evaluations\030\001 \003(\01327.google" + + ".cloud.dialogflow.v2.ConversationModelEv" + + "aluation\022\027\n\017next_page_token\030\002 \001(\t\"\336\001\n(Cr" + + "eateConversationModelEvaluationRequest\022M" + + "\n\006parent\030\001 \001(\tB=\340A\002\372A7\0225dialogflow.googl" + + "eapis.com/ConversationModelEvaluation\022c\n" + + "\035conversation_model_evaluation\030\002 \001(\01327.g" + + "oogle.cloud.dialogflow.v2.ConversationMo" + + "delEvaluationB\003\340A\002\"\307\002\n(CreateConversatio" + + "nModelOperationMetadata\022\032\n\022conversation_" + + "model\030\001 \001(\t\022Y\n\005state\030\002 \001(\0162J.google.clou" + + "d.dialogflow.v2.CreateConversationModelO" + + "perationMetadata.State\022/\n\013create_time\030\003 " + + "\001(\0132\032.google.protobuf.Timestamp\"s\n\005State" + + "\022\025\n\021STATE_UNSPECIFIED\020\000\022\013\n\007PENDING\020\001\022\r\n\t" + + "SUCCEEDED\020\002\022\n\n\006FAILED\020\003\022\r\n\tCANCELLED\020\004\022\016" + + "\n\nCANCELLING\020\005\022\014\n\010TRAINING\020\006\"w\n(DeployCo" + + "nversationModelOperationMetadata\022\032\n\022conv" + + "ersation_model\030\001 \001(\t\022/\n\013create_time\030\003 \001(" + + "\0132\032.google.protobuf.Timestamp\"y\n*Undeplo" + + "yConversationModelOperationMetadata\022\032\n\022c" + + "onversation_model\030\001 \001(\t\022/\n\013create_time\030\003" + + " \001(\0132\032.google.protobuf.Timestamp\"w\n(Dele" + + "teConversationModelOperationMetadata\022\032\n\022" + + "conversation_model\030\001 \001(\t\022/\n\013create_time\030" + + "\003 \001(\0132\032.google.protobuf.Timestamp\"\366\002\n2Cr" + + "eateConversationModelEvaluationOperation" + + "Metadata\022%\n\035conversation_model_evaluatio" + + "n\030\001 \001(\t\022\032\n\022conversation_model\030\004 \001(\t\022c\n\005s" + + "tate\030\002 \001(\0162T.google.cloud.dialogflow.v2." + + "CreateConversationModelEvaluationOperati" + + "onMetadata.State\022/\n\013create_time\030\003 \001(\0132\032." + + "google.protobuf.Timestamp\"g\n\005State\022\025\n\021ST" + + "ATE_UNSPECIFIED\020\000\022\020\n\014INITIALIZING\020\001\022\013\n\007R" + + "UNNING\020\002\022\r\n\tCANCELLED\020\003\022\r\n\tSUCCEEDED\020\004\022\n" + + "\n\006FAILED\020\0052\376\026\n\022ConversationModels\022\350\002\n\027Cr" + + "eateConversationModel\022:.google.cloud.dia" + + "logflow.v2.CreateConversationModelReques" + + "t\032\035.google.longrunning.Operation\"\361\001\202\323\344\223\002" + + "\216\001\"*/v2/{parent=projects/*}/conversation" + + "Models:\022conversation_modelZL\"6/v2/{paren" + "t=projects/*/locations/*}/conversationMo" - + "dels\332A\006parent\022\256\002\n\027DeleteConversationMode" - + "l\022:.google.cloud.dialogflow.v2.DeleteCon" - + "versationModelRequest\032\035.google.longrunni" - + "ng.Operation\"\267\001\202\323\344\223\002f**/v2/{name=project" - + "s/*/conversationModels/*}Z8*6/v2/{name=p" - + "rojects/*/locations/*/conversationModels" - + "/*}\332A\004name\312AA\n\025google.protobuf.Empty\022(De" - + "leteConversationModelOperationMetadata\022\273" - + "\002\n\027DeployConversationModel\022:.google.clou" - + "d.dialogflow.v2.DeployConversationModelR" - + "equest\032\035.google.longrunning.Operation\"\304\001" - + "\202\323\344\223\002z\"1/v2/{name=projects/*/conversatio" - + "nModels/*}:deploy:\001*ZB\"=/v2/{name=projec" - + "ts/*/locations/*/conversationModels/*}:d" - + "eploy:\001*\312AA\n\025google.protobuf.Empty\022(Depl" - + "oyConversationModelOperationMetadata\022\305\002\n" - + "\031UndeployConversationModel\022<.google.clou" - + "d.dialogflow.v2.UndeployConversationMode" - + "lRequest\032\035.google.longrunning.Operation\"" - + "\312\001\202\323\344\223\002~\"3/v2/{name=projects/*/conversat" - + "ionModels/*}:undeploy:\001*ZD\"?/v2/{name=pr" - + "ojects/*/locations/*/conversationModels/" - + "*}:undeploy:\001*\312AC\n\025google.protobuf.Empty" - + "\022*UndeployConversationModelOperationMeta" - + "data\022\257\002\n\036GetConversationModelEvaluation\022" - + "A.google.cloud.dialogflow.v2.GetConversa" - + "tionModelEvaluationRequest\0327.google.clou" - + "d.dialogflow.v2.ConversationModelEvaluat" - + "ion\"\220\001\202\323\344\223\002\202\001\0228/v2/{name=projects/*/conv" - + "ersationModels/*/evaluations/*}ZF\022D/v2/{" - + "name=projects/*/locations/*/conversation" - + "Models/*/evaluations/*}\332A\004name\022\302\002\n ListC" - + "onversationModelEvaluations\022C.google.clo" - + "ud.dialogflow.v2.ListConversationModelEv" - + "aluationsRequest\032D.google.cloud.dialogfl" - + "ow.v2.ListConversationModelEvaluationsRe" - + "sponse\"\222\001\202\323\344\223\002\202\001\0228/v2/{parent=projects/*" - + "/conversationModels/*}/evaluationsZF\022D/v" - + "2/{parent=projects/*/locations/*/convers" - + "ationModels/*}/evaluations\332A\006parent\022\325\002\n!" - + "CreateConversationModelEvaluation\022D.goog" - + "le.cloud.dialogflow.v2.CreateConversatio" - + "nModelEvaluationRequest\032\035.google.longrun" - + "ning.Operation\"\312\001\202\323\344\223\002I\"D/v2/{parent=pro" - + "jects/*/locations/*/conversationModels/*" - + "}/evaluations:\001*\332A$parent,conversation_m" - + "odel_evaluation\312AQ\n\033ConversationModelEva" - + "luation\0222CreateConversationModelEvaluati" - + "onOperationMetadata\032x\312A\031dialogflow.googl" - + "eapis.com\322AYhttps://www.googleapis.com/a" - + "uth/cloud-platform,https://www.googleapi" - + "s.com/auth/dialogflowB\245\001\n\036com.google.clo" - + "ud.dialogflow.v2B\026ConversationModelProto" - + "P\001ZDgoogle.golang.org/genproto/googleapi" - + "s/cloud/dialogflow/v2;dialogflow\370\001\001\242\002\002DF" - + "\252\002\032Google.Cloud.Dialogflow.V2b\006proto3" + + "dels:\022conversation_model\332A\031parent,conver" + + "sation_model\312A=\n\021ConversationModel\022(Crea" + + "teConversationModelOperationMetadata\022\363\001\n" + + "\024GetConversationModel\0227.google.cloud.dia" + + "logflow.v2.GetConversationModelRequest\032-" + + ".google.cloud.dialogflow.v2.Conversation" + + "Model\"s\202\323\344\223\002f\022*/v2/{name=projects/*/conv" + + "ersationModels/*}Z8\0226/v2/{name=projects/" + + "*/locations/*/conversationModels/*}\332A\004na" + + "me\022\206\002\n\026ListConversationModels\0229.google.c" + + "loud.dialogflow.v2.ListConversationModel" + + "sRequest\032:.google.cloud.dialogflow.v2.Li" + + "stConversationModelsResponse\"u\202\323\344\223\002f\022*/v" + + "2/{parent=projects/*}/conversationModels" + + "Z8\0226/v2/{parent=projects/*/locations/*}/" + + "conversationModels\332A\006parent\022\256\002\n\027DeleteCo" + + "nversationModel\022:.google.cloud.dialogflo" + + "w.v2.DeleteConversationModelRequest\032\035.go" + + "ogle.longrunning.Operation\"\267\001\202\323\344\223\002f**/v2" + + "/{name=projects/*/conversationModels/*}Z" + + "8*6/v2/{name=projects/*/locations/*/conv" + + "ersationModels/*}\332A\004name\312AA\n\025google.prot" + + "obuf.Empty\022(DeleteConversationModelOpera" + + "tionMetadata\022\273\002\n\027DeployConversationModel" + + "\022:.google.cloud.dialogflow.v2.DeployConv" + + "ersationModelRequest\032\035.google.longrunnin" + + "g.Operation\"\304\001\202\323\344\223\002z\"1/v2/{name=projects" + + "/*/conversationModels/*}:deploy:\001*ZB\"=/v" + + "2/{name=projects/*/locations/*/conversat" + + "ionModels/*}:deploy:\001*\312AA\n\025google.protob" + + "uf.Empty\022(DeployConversationModelOperati" + + "onMetadata\022\305\002\n\031UndeployConversationModel" + + "\022<.google.cloud.dialogflow.v2.UndeployCo" + + "nversationModelRequest\032\035.google.longrunn" + + "ing.Operation\"\312\001\202\323\344\223\002~\"3/v2/{name=projec" + + "ts/*/conversationModels/*}:undeploy:\001*ZD" + + "\"?/v2/{name=projects/*/locations/*/conve" + + "rsationModels/*}:undeploy:\001*\312AC\n\025google." + + "protobuf.Empty\022*UndeployConversationMode" + + "lOperationMetadata\022\257\002\n\036GetConversationMo" + + "delEvaluation\022A.google.cloud.dialogflow." + + "v2.GetConversationModelEvaluationRequest" + + "\0327.google.cloud.dialogflow.v2.Conversati" + + "onModelEvaluation\"\220\001\202\323\344\223\002\202\001\0228/v2/{name=p" + + "rojects/*/conversationModels/*/evaluatio" + + "ns/*}ZF\022D/v2/{name=projects/*/locations/" + + "*/conversationModels/*/evaluations/*}\332A\004" + + "name\022\302\002\n ListConversationModelEvaluation" + + "s\022C.google.cloud.dialogflow.v2.ListConve" + + "rsationModelEvaluationsRequest\032D.google." + + "cloud.dialogflow.v2.ListConversationMode" + + "lEvaluationsResponse\"\222\001\202\323\344\223\002\202\001\0228/v2/{par" + + "ent=projects/*/conversationModels/*}/eva" + + "luationsZF\022D/v2/{parent=projects/*/locat" + + "ions/*/conversationModels/*}/evaluations" + + "\332A\006parent\022\325\002\n!CreateConversationModelEva" + + "luation\022D.google.cloud.dialogflow.v2.Cre" + + "ateConversationModelEvaluationRequest\032\035." + + "google.longrunning.Operation\"\312\001\202\323\344\223\002I\"D/" + + "v2/{parent=projects/*/locations/*/conver" + + "sationModels/*}/evaluations:\001*\332A$parent," + + "conversation_model_evaluation\312AQ\n\033Conver" + + "sationModelEvaluation\0222CreateConversatio" + + "nModelEvaluationOperationMetadata\032x\312A\031di" + + "alogflow.googleapis.com\322AYhttps://www.go" + + "ogleapis.com/auth/cloud-platform,https:/" + + "/www.googleapis.com/auth/dialogflowB\245\001\n\036" + + "com.google.cloud.dialogflow.v2B\026Conversa" + + "tionModelProtoP\001ZDgoogle.golang.org/genp" + + "roto/googleapis/cloud/dialogflow/v2;dial" + + "ogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow" + + ".V2b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( diff --git a/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto b/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto index 1af09f6d0..8554a2349 100644 --- a/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto +++ b/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto @@ -27,6 +27,10 @@ option java_multiple_files = true; option java_outer_classname = "AudioConfigProto"; option java_package = "com.google.cloud.dialogflow.v2"; option objc_class_prefix = "DF"; +option (google.api.resource_definition) = { + type: "automl.googleapis.com/Model" + pattern: "projects/{project}/locations/{location}/models/{model}" +}; // Audio encoding of the audio content sent in the conversational query request. // Refer to the diff --git a/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_model.proto b/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_model.proto index 5c304cec6..065290df5 100644 --- a/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_model.proto +++ b/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/conversation_model.proto @@ -289,8 +289,8 @@ message ConversationModel { message ConversationModelEvaluation { option (google.api.resource) = { type: "dialogflow.googleapis.com/ConversationModelEvaluation" - pattern: "projects/{project}/conversationModels/{conversation_model}/evaluations/evaluation" - pattern: "projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/evaluation" + pattern: "projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}" + pattern: "projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}" }; // The resource name of the evaluation. Format: @@ -528,7 +528,7 @@ message CreateConversationModelEvaluationRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "dialogflow.googleapis.com/ConversationModel" + child_type: "dialogflow.googleapis.com/ConversationModelEvaluation" } ];