Skip to content

Commit 713b3e7

Browse files
Google APIscopybara-github
authored andcommitted
feat: added agent level route group
feat: added flow import strategy PiperOrigin-RevId: 555341760
1 parent 528a97f commit 713b3e7

9 files changed

Lines changed: 144 additions & 19 deletions

File tree

google/cloud/dialogflow/cx/v3/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ proto_library(
3232
"flow.proto",
3333
"fulfillment.proto",
3434
"gcs.proto",
35+
"import_strategy.proto",
3536
"intent.proto",
3637
"page.proto",
3738
"response_message.proto",
@@ -400,7 +401,6 @@ load(
400401

401402
csharp_proto_library(
402403
name = "cx_csharp_proto",
403-
extra_opts = [],
404404
deps = [":cx_proto"],
405405
)
406406

google/cloud/dialogflow/cx/v3/agent.proto

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ message SpeechToTextSettings {
180180
// Types][google.cloud.dialogflow.cx.v3.EntityType],
181181
// [Flows][google.cloud.dialogflow.cx.v3.Flow],
182182
// [Fulfillments][google.cloud.dialogflow.cx.v3.Fulfillment],
183-
// [Webhooks][google.cloud.dialogflow.cx.v3.Webhook], and so on to manage the
184-
// conversation flows..
183+
// [Webhooks][google.cloud.dialogflow.cx.v3.Webhook],
184+
// [TransitionRouteGroups][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]
185+
// and so on to manage the conversation flows.
185186
message Agent {
186187
option (google.api.resource) = {
187188
type: "dialogflow.googleapis.com/Agent"
@@ -198,7 +199,7 @@ message Agent {
198199
// The GitHub repository URI related to the agent.
199200
string repository_uri = 2;
200201

201-
// The branch of GitHub repository tracked for this agent.
202+
// The branch of the GitHub repository tracked for this agent.
202203
string tracking_branch = 3;
203204

204205
// The access token used to authenticate the access to the GitHub
@@ -473,7 +474,7 @@ message ExportAgentResponse {
473474
bytes agent_content = 2;
474475

475476
// Commit SHA of the git push. This field is populated if
476-
// `git_destination` are specified in
477+
// `git_destination` is specified in
477478
// [ExportAgentRequest][google.cloud.dialogflow.cx.v3.ExportAgentRequest].
478479
string commit_sha = 3;
479480
}

google/cloud/dialogflow/cx/v3/dialogflow_v3.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ types:
4040
- name: google.cloud.dialogflow.cx.v3.RunContinuousTestResponse
4141
- name: google.cloud.dialogflow.cx.v3.RunTestCaseMetadata
4242
- name: google.cloud.dialogflow.cx.v3.RunTestCaseResponse
43-
- name: google.cloud.dialogflow.cx.v3.TestError
4443
- name: google.cloud.dialogflow.cx.v3.WebhookRequest
4544
- name: google.cloud.dialogflow.cx.v3.WebhookResponse
4645

google/cloud/dialogflow/cx/v3/flow.proto

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
23+
import "google/cloud/dialogflow/cx/v3/import_strategy.proto";
2324
import "google/cloud/dialogflow/cx/v3/page.proto";
2425
import "google/cloud/dialogflow/cx/v3/validation_message.proto";
2526
import "google/longrunning/operations.proto";
@@ -308,7 +309,10 @@ message Flow {
308309
// defined in the page have higher priority than those defined in the flow.
309310
//
310311
// Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
311-
// ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
312+
// ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`
313+
// or `projects/<Project ID>/locations/<Location ID>/agents/<Agent
314+
// ID>/transitionRouteGroups/<TransitionRouteGroup ID>` for agent-level
315+
// groups.
312316
repeated string transition_route_groups = 15
313317
[(google.api.resource_reference) = {
314318
type: "dialogflow.googleapis.com/TransitionRouteGroup"
@@ -582,6 +586,22 @@ message ImportFlowRequest {
582586

583587
// Flow import mode. If not specified, `KEEP` is assumed.
584588
ImportOption import_option = 4;
589+
590+
// Optional. Specifies the import strategy used when resolving resource
591+
// conflicts.
592+
FlowImportStrategy flow_import_strategy = 5
593+
[(google.api.field_behavior) = OPTIONAL];
594+
}
595+
596+
// The flow import strategy used for resource conflict resolution associated
597+
// with an [ImportFlowRequest][google.cloud.dialogflow.cx.v3.ImportFlowRequest].
598+
message FlowImportStrategy {
599+
// Optional. Import strategy for resource conflict resolution, applied
600+
// globally throughout the flow. It will be applied for all display name
601+
// conflicts in the imported content. If not specified, 'CREATE_NEW' is
602+
// assumed.
603+
ImportStrategy global_import_strategy = 1
604+
[(google.api.field_behavior) = OPTIONAL];
585605
}
586606

587607
// The response message for
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.dialogflow.cx.v3;
18+
19+
option cc_enable_arenas = true;
20+
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3";
21+
option go_package = "cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb";
22+
option java_multiple_files = true;
23+
option java_outer_classname = "ImportStrategyProto";
24+
option java_package = "com.google.cloud.dialogflow.cx.v3";
25+
option objc_class_prefix = "DF";
26+
27+
// Import strategies for the conflict resolution of resources (i.e. intents,
28+
// entities, and webhooks) with identical display names during import
29+
// operations.
30+
enum ImportStrategy {
31+
// Unspecified. Treated as 'CREATE_NEW'.
32+
IMPORT_STRATEGY_UNSPECIFIED = 0;
33+
34+
// Create a new resource with a numeric suffix appended to the end of the
35+
// existing display name.
36+
IMPORT_STRATEGY_CREATE_NEW = 1;
37+
38+
// Replace existing resource with incoming resource in the content to be
39+
// imported.
40+
IMPORT_STRATEGY_REPLACE = 2;
41+
42+
// Keep existing resource and discard incoming resource in the content to be
43+
// imported.
44+
IMPORT_STRATEGY_KEEP = 3;
45+
46+
// Combine existing and incoming resources when a conflict is encountered.
47+
IMPORT_STRATEGY_MERGE = 4;
48+
49+
// Throw error if a conflict is encountered.
50+
IMPORT_STRATEGY_THROW_ERROR = 5;
51+
}

google/cloud/dialogflow/cx/v3/page.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,10 @@ message Page {
150150
// intent, then the first group in the ordered list takes precedence.
151151
//
152152
// Format:`projects/<Project ID>/locations/<Location ID>/agents/<Agent
153-
// ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`.
153+
// ID>/flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>`
154+
// or `projects/<Project ID>/locations/<Location ID>/agents/<Agent
155+
// ID>/transitionRouteGroups/<TransitionRouteGroup ID>` for agent-level
156+
// groups.
154157
repeated string transition_route_groups = 11
155158
[(google.api.resource_reference) = {
156159
type: "dialogflow.googleapis.com/TransitionRouteGroup"

google/cloud/dialogflow/cx/v3/response_message.proto

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,27 @@ message ResponseMessage {
180180
}
181181
}
182182

183+
// Represents different response types.
184+
enum ResponseType {
185+
// Not specified.
186+
RESPONSE_TYPE_UNSPECIFIED = 0;
187+
188+
// The response is from an [entry
189+
// prompt][google.cloud.dialogflow.cx.v3.Page.entry_fulfillment] in the
190+
// page.
191+
ENTRY_PROMPT = 1;
192+
193+
// The response is from [form-filling
194+
// prompt][google.cloud.dialogflow.cx.v3.Form.Parameter.fill_behavior] in
195+
// the page.
196+
PARAMETER_PROMPT = 2;
197+
198+
// The response is from a [transition
199+
// route][google.cloud.dialogflow.cx.v3.TransitionRoute] or an [event
200+
// handler][EventHandler] in the page or flow or transition route group.
201+
HANDLER_PROMPT = 3;
202+
}
203+
183204
// Required. The rich response message.
184205
oneof message {
185206
// Returns a text response.
@@ -226,6 +247,9 @@ message ResponseMessage {
226247
TelephonyTransferCall telephony_transfer_call = 18;
227248
}
228249

250+
// Response type.
251+
ResponseType response_type = 4;
252+
229253
// The channel which the response is associated with. Clients can specify the
230254
// channel via
231255
// [QueryParameters.channel][google.cloud.dialogflow.cx.v3.QueryParameters.channel],

google/cloud/dialogflow/cx/v3/session.proto

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -607,15 +607,15 @@ message QueryParameters {
607607

608608
// Represents the query input. It can contain one of:
609609
//
610-
// 1. A conversational query in the form of text.
610+
// 1. A conversational query in the form of text.
611611
//
612-
// 2. An intent query that specifies which intent to trigger.
612+
// 2. An intent query that specifies which intent to trigger.
613613
//
614-
// 3. Natural language speech audio to be processed.
614+
// 3. Natural language speech audio to be processed.
615615
//
616-
// 4. An event to be triggered.
616+
// 4. An event to be triggered.
617617
//
618-
// 5. DTMF digits to invoke an intent and fill in parameter value.
618+
// 5. DTMF digits to invoke an intent and fill in parameter value.
619619
message QueryInput {
620620
// Required. The input specification.
621621
oneof input {

google/cloud/dialogflow/cx/v3/transition_route_group.proto

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ service TransitionRouteGroups {
4646
returns (ListTransitionRouteGroupsResponse) {
4747
option (google.api.http) = {
4848
get: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups"
49+
additional_bindings {
50+
get: "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups"
51+
}
4952
};
5053
option (google.api.method_signature) = "parent";
5154
}
@@ -56,6 +59,9 @@ service TransitionRouteGroups {
5659
returns (TransitionRouteGroup) {
5760
option (google.api.http) = {
5861
get: "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}"
62+
additional_bindings {
63+
get: "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}"
64+
}
5965
};
6066
option (google.api.method_signature) = "name";
6167
}
@@ -72,6 +78,10 @@ service TransitionRouteGroups {
7278
option (google.api.http) = {
7379
post: "/v3/{parent=projects/*/locations/*/agents/*/flows/*}/transitionRouteGroups"
7480
body: "transition_route_group"
81+
additional_bindings {
82+
post: "/v3/{parent=projects/*/locations/*/agents/*}/transitionRouteGroups"
83+
body: "transition_route_group"
84+
}
7585
};
7686
option (google.api.method_signature) = "parent,transition_route_group";
7787
}
@@ -87,6 +97,10 @@ service TransitionRouteGroups {
8797
option (google.api.http) = {
8898
patch: "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}"
8999
body: "transition_route_group"
100+
additional_bindings {
101+
patch: "/v3/{transition_route_group.name=projects/*/locations/*/agents/*/transitionRouteGroups/*}"
102+
body: "transition_route_group"
103+
}
90104
};
91105
option (google.api.method_signature) = "transition_route_group,update_mask";
92106
}
@@ -101,25 +115,32 @@ service TransitionRouteGroups {
101115
returns (google.protobuf.Empty) {
102116
option (google.api.http) = {
103117
delete: "/v3/{name=projects/*/locations/*/agents/*/flows/*/transitionRouteGroups/*}"
118+
additional_bindings {
119+
delete: "/v3/{name=projects/*/locations/*/agents/*/transitionRouteGroups/*}"
120+
}
104121
};
105122
option (google.api.method_signature) = "name";
106123
}
107124
}
108125

109-
// An TransitionRouteGroup represents a group of
126+
// A TransitionRouteGroup represents a group of
110127
// [`TransitionRoutes`][google.cloud.dialogflow.cx.v3.TransitionRoute] to be
111128
// used by a [Page][google.cloud.dialogflow.cx.v3.Page].
112129
message TransitionRouteGroup {
113130
option (google.api.resource) = {
114131
type: "dialogflow.googleapis.com/TransitionRouteGroup"
115132
pattern: "projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/transitionRouteGroups/{transition_route_group}"
133+
pattern: "projects/{project}/locations/{location}/agents/{agent}/transitionRouteGroups/{transition_route_group}"
134+
plural: "transitionRouteGroups"
135+
singular: "transitionRouteGroup"
116136
};
117137

118138
// The unique identifier of the transition route group.
119139
// [TransitionRouteGroups.CreateTransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroups.CreateTransitionRouteGroup]
120140
// populates the name automatically. Format: `projects/<Project
121141
// ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow
122-
// ID>/transitionRouteGroups/<Transition Route Group ID>`.
142+
// ID>/transitionRouteGroups/<Transition Route Group ID>`
143+
// .
123144
string name = 1;
124145

125146
// Required. The human-readable name of the transition route group, unique
@@ -136,7 +157,8 @@ message TransitionRouteGroup {
136157
message ListTransitionRouteGroupsRequest {
137158
// Required. The flow to list all transition route groups for.
138159
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
139-
// ID>/flows/<Flow ID>`.
160+
// ID>/flows/<Flow ID>`
161+
// or `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.
140162
string parent = 1 [
141163
(google.api.field_behavior) = REQUIRED,
142164
(google.api.resource_reference) = {
@@ -187,7 +209,9 @@ message GetTransitionRouteGroupRequest {
187209
// Required. The name of the
188210
// [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup].
189211
// Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
190-
// ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`.
212+
// ID>/flows/<Flow ID>/transitionRouteGroups/<Transition Route Group ID>`
213+
// or `projects/<Project ID>/locations/<Location ID>/agents/<Agent
214+
// ID>/transitionRouteGroups/<Transition Route Group ID>`.
191215
string name = 1 [
192216
(google.api.field_behavior) = REQUIRED,
193217
(google.api.resource_reference) = {
@@ -216,7 +240,9 @@ message CreateTransitionRouteGroupRequest {
216240
// Required. The flow to create an
217241
// [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]
218242
// for. Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
219-
// ID>/flows/<Flow ID>`.
243+
// ID>/flows/<Flow ID>`
244+
// or `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`
245+
// for agent-level groups.
220246
string parent = 1 [
221247
(google.api.field_behavior) = REQUIRED,
222248
(google.api.resource_reference) = {
@@ -273,7 +299,8 @@ message DeleteTransitionRouteGroupRequest {
273299
// [TransitionRouteGroup][google.cloud.dialogflow.cx.v3.TransitionRouteGroup]
274300
// to delete. Format: `projects/<Project ID>/locations/<Location
275301
// ID>/agents/<Agent ID>/flows/<Flow ID>/transitionRouteGroups/<Transition
276-
// Route Group ID>`.
302+
// Route Group ID>` or `projects/<Project ID>/locations/<Location
303+
// ID>/agents/<Agent ID>/transitionRouteGroups/<Transition Route Group ID>`.
277304
string name = 1 [
278305
(google.api.field_behavior) = REQUIRED,
279306
(google.api.resource_reference) = {

0 commit comments

Comments
 (0)