Skip to content

Commit 7a8875d

Browse files
Google APIscopybara-github
authored andcommitted
feat!: additional client library annotations
feat: reload information in the Document resource BREAKING CHANGE: additional long-running operation annotations BREAKING CHANGE: some existing request fields are now explicitly required BREAKING CHANGE: the order of the Session resource patterns has changed PiperOrigin-RevId: 312345206
1 parent 247c651 commit 7a8875d

10 files changed

Lines changed: 510 additions & 128 deletions

File tree

google/cloud/dialogflow/v2beta1/agent.proto

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ syntax = "proto3";
1717
package google.cloud.dialogflow.v2beta1;
1818

1919
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
2021
import "google/api/field_behavior.proto";
2122
import "google/api/resource.proto";
2223
import "google/cloud/dialogflow/v2beta1/environment.proto";
2324
import "google/cloud/dialogflow/v2beta1/validation_result.proto";
2425
import "google/longrunning/operations.proto";
2526
import "google/protobuf/empty.proto";
2627
import "google/protobuf/field_mask.proto";
27-
import "google/api/client.proto";
2828

2929
option cc_enable_arenas = true;
3030
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
@@ -76,6 +76,7 @@ service Agents {
7676
get: "/v2beta1/{parent=projects/*/locations/*}/agent"
7777
}
7878
};
79+
option (google.api.method_signature) = "parent";
7980
}
8081

8182
// Creates/updates the specified agent.
@@ -88,6 +89,7 @@ service Agents {
8889
body: "agent"
8990
}
9091
};
92+
option (google.api.method_signature) = "agent";
9193
}
9294

9395
// Deletes the specified agent.
@@ -98,10 +100,10 @@ service Agents {
98100
delete: "/v2beta1/{parent=projects/*/locations/*}/agent"
99101
}
100102
};
103+
option (google.api.method_signature) = "parent";
101104
}
102105

103106
// Returns the list of agents.
104-
//
105107
// Since there is at most one conversational agent per project, this method is
106108
// useful primarily for listing all agents across projects the caller has
107109
// access to. One can achieve that with a wildcard project collection id "-".
@@ -111,6 +113,7 @@ service Agents {
111113
option (google.api.http) = {
112114
get: "/v2beta1/{parent=projects/*}/agent:search"
113115
};
116+
option (google.api.method_signature) = "parent";
114117
}
115118

116119
// Trains the specified agent.
@@ -126,6 +129,11 @@ service Agents {
126129
body: "*"
127130
}
128131
};
132+
option (google.api.method_signature) = "parent";
133+
option (google.longrunning.operation_info) = {
134+
response_type: "google.protobuf.Empty"
135+
metadata_type: "google.protobuf.Struct"
136+
};
129137
}
130138

131139
// Exports the specified agent to a ZIP file.
@@ -141,6 +149,11 @@ service Agents {
141149
body: "*"
142150
}
143151
};
152+
option (google.api.method_signature) = "parent";
153+
option (google.longrunning.operation_info) = {
154+
response_type: "google.cloud.dialogflow.v2beta1.ExportAgentResponse"
155+
metadata_type: "google.protobuf.Struct"
156+
};
144157
}
145158

146159
// Imports the specified agent from a ZIP file.
@@ -160,6 +173,10 @@ service Agents {
160173
body: "*"
161174
}
162175
};
176+
option (google.longrunning.operation_info) = {
177+
response_type: "google.protobuf.Empty"
178+
metadata_type: "google.protobuf.Struct"
179+
};
163180
}
164181

165182
// Restores the specified agent from a ZIP file.
@@ -178,6 +195,10 @@ service Agents {
178195
body: "*"
179196
}
180197
};
198+
option (google.longrunning.operation_info) = {
199+
response_type: "google.protobuf.Empty"
200+
metadata_type: "google.protobuf.Struct"
201+
};
181202
}
182203

183204
// Gets agent validation result. Agent validation is performed during
@@ -304,7 +325,12 @@ message Agent {
304325
message GetAgentRequest {
305326
// Required. The project that the agent to fetch is associated with.
306327
// Format: `projects/<Project ID>`.
307-
string parent = 1;
328+
string parent = 1 [
329+
(google.api.field_behavior) = REQUIRED,
330+
(google.api.resource_reference) = {
331+
child_type: "dialogflow.googleapis.com/Agent"
332+
}
333+
];
308334
}
309335

310336
// The request message for [Agents.SetAgent][google.cloud.dialogflow.v2beta1.Agents.SetAgent].
@@ -320,7 +346,12 @@ message SetAgentRequest {
320346
message DeleteAgentRequest {
321347
// Required. The project that the agent to delete is associated with.
322348
// Format: `projects/<Project ID>`.
323-
string parent = 1;
349+
string parent = 1 [
350+
(google.api.field_behavior) = REQUIRED,
351+
(google.api.resource_reference) = {
352+
child_type: "dialogflow.googleapis.com/Agent"
353+
}
354+
];
324355
}
325356

326357
// Contains basic configuration for a sub-agent.
@@ -339,7 +370,12 @@ message SubAgent {
339370
message SearchAgentsRequest {
340371
// Required. The project to list agents from.
341372
// Format: `projects/<Project ID or '-'>`.
342-
string parent = 1;
373+
string parent = 1 [
374+
(google.api.field_behavior) = REQUIRED,
375+
(google.api.resource_reference) = {
376+
child_type: "dialogflow.googleapis.com/Agent"
377+
}
378+
];
343379

344380
// Optional. The maximum number of items to return in a single page. By
345381
// default 100 and at most 1000.
@@ -364,7 +400,12 @@ message SearchAgentsResponse {
364400
message TrainAgentRequest {
365401
// Required. The project that the agent to train is associated with.
366402
// Format: `projects/<Project ID>`.
367-
string parent = 1;
403+
string parent = 1 [
404+
(google.api.field_behavior) = REQUIRED,
405+
(google.api.resource_reference) = {
406+
child_type: "dialogflow.googleapis.com/Agent"
407+
}
408+
];
368409
}
369410

370411
// The request message for [Agents.ExportAgent][google.cloud.dialogflow.v2beta1.Agents.ExportAgent].
@@ -398,7 +439,12 @@ message ExportAgentResponse {
398439
message ImportAgentRequest {
399440
// Required. The project that the agent to import is associated with.
400441
// Format: `projects/<Project ID>`.
401-
string parent = 1;
442+
string parent = 1 [
443+
(google.api.field_behavior) = REQUIRED,
444+
(google.api.resource_reference) = {
445+
child_type: "dialogflow.googleapis.com/Agent"
446+
}
447+
];
402448

403449
// Required. The agent to import.
404450
oneof agent {
@@ -415,7 +461,12 @@ message ImportAgentRequest {
415461
message RestoreAgentRequest {
416462
// Required. The project that the agent to restore is associated with.
417463
// Format: `projects/<Project ID>`.
418-
string parent = 1;
464+
string parent = 1 [
465+
(google.api.field_behavior) = REQUIRED,
466+
(google.api.resource_reference) = {
467+
child_type: "dialogflow.googleapis.com/Agent"
468+
}
469+
];
419470

420471
// Required. The agent to restore.
421472
oneof agent {
@@ -432,7 +483,12 @@ message RestoreAgentRequest {
432483
message GetValidationResultRequest {
433484
// Required. The project that the agent is associated with.
434485
// Format: `projects/<Project ID>`.
435-
string parent = 1 [(google.api.field_behavior) = REQUIRED];
486+
string parent = 1 [
487+
(google.api.field_behavior) = REQUIRED,
488+
(google.api.resource_reference) = {
489+
child_type: "dialogflow.googleapis.com/Agent"
490+
}
491+
];
436492

437493
// Optional. The language for which you want a validation result. If not
438494
// specified, the agent's default language is used. [Many

google/cloud/dialogflow/v2beta1/audio_config.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ message SpeechContext {
9797
repeated string phrases = 1;
9898

9999
// Optional. Boost for this context compared to other contexts:
100+
//
100101
// * If the boost is positive, Dialogflow will increase the probability that
101102
// the phrases in this context are recognized over similar sounding phrases.
102103
// * If the boost is unspecified or non-positive, Dialogflow will not apply

google/cloud/dialogflow/v2beta1/context.proto

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ syntax = "proto3";
1717
package google.cloud.dialogflow.v2beta1;
1818

1919
import "google/api/annotations.proto";
20+
import "google/api/client.proto";
21+
import "google/api/field_behavior.proto";
22+
import "google/api/resource.proto";
2023
import "google/protobuf/empty.proto";
2124
import "google/protobuf/field_mask.proto";
2225
import "google/protobuf/struct.proto";
23-
import "google/api/client.proto";
2426

2527
option cc_enable_arenas = true;
2628
option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1";
@@ -68,6 +70,7 @@ service Contexts {
6870
get: "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts"
6971
}
7072
};
73+
option (google.api.method_signature) = "parent";
7174
}
7275

7376
// Retrieves the specified context.
@@ -84,6 +87,7 @@ service Contexts {
8487
get: "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}"
8588
}
8689
};
90+
option (google.api.method_signature) = "name";
8791
}
8892

8993
// Creates a context.
@@ -106,6 +110,7 @@ service Contexts {
106110
body: "context"
107111
}
108112
};
113+
option (google.api.method_signature) = "parent,context";
109114
}
110115

111116
// Updates the specified context.
@@ -126,6 +131,7 @@ service Contexts {
126131
body: "context"
127132
}
128133
};
134+
option (google.api.method_signature) = "context,update_mask";
129135
}
130136

131137
// Deletes the specified context.
@@ -142,6 +148,7 @@ service Contexts {
142148
delete: "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}"
143149
}
144150
};
151+
option (google.api.method_signature) = "name";
145152
}
146153

147154
// Deletes all active contexts in the specified session.
@@ -158,11 +165,19 @@ service Contexts {
158165
delete: "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts"
159166
}
160167
};
168+
option (google.api.method_signature) = "parent";
161169
}
162170
}
163171

164172
// Represents a context.
165173
message Context {
174+
option (google.api.resource) = {
175+
type: "dialogflow.googleapis.com/Context"
176+
pattern: "projects/{project}/agent/sessions/{session}/contexts/{context}"
177+
pattern: "projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}"
178+
pattern: "projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}"
179+
};
180+
166181
// Required. The unique identifier of the context. Format:
167182
// `projects/<Project ID>/agent/sessions/<Session ID>/contexts/<Context ID>`,
168183
// or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
@@ -214,7 +229,12 @@ message ListContextsRequest {
214229
// ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
215230
// default 'draft' environment. If `User ID` is not specified, we assume
216231
// default '-' user.
217-
string parent = 1;
232+
string parent = 1 [
233+
(google.api.field_behavior) = REQUIRED,
234+
(google.api.resource_reference) = {
235+
child_type: "dialogflow.googleapis.com/Context"
236+
}
237+
];
218238

219239
// Optional. The maximum number of items to return in a single page. By
220240
// default 100 and at most 1000.
@@ -243,7 +263,12 @@ message GetContextRequest {
243263
// ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is
244264
// not specified, we assume default 'draft' environment. If `User ID` is not
245265
// specified, we assume default '-' user.
246-
string name = 1;
266+
string name = 1 [
267+
(google.api.field_behavior) = REQUIRED,
268+
(google.api.resource_reference) = {
269+
type: "dialogflow.googleapis.com/Context"
270+
}
271+
];
247272
}
248273

249274
// The request message for [Contexts.CreateContext][google.cloud.dialogflow.v2beta1.Contexts.CreateContext].
@@ -254,19 +279,24 @@ message CreateContextRequest {
254279
// ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
255280
// default 'draft' environment. If `User ID` is not specified, we assume
256281
// default '-' user.
257-
string parent = 1;
282+
string parent = 1 [
283+
(google.api.field_behavior) = REQUIRED,
284+
(google.api.resource_reference) = {
285+
child_type: "dialogflow.googleapis.com/Context"
286+
}
287+
];
258288

259289
// Required. The context to create.
260-
Context context = 2;
290+
Context context = 2 [(google.api.field_behavior) = REQUIRED];
261291
}
262292

263293
// The request message for [Contexts.UpdateContext][google.cloud.dialogflow.v2beta1.Contexts.UpdateContext].
264294
message UpdateContextRequest {
265295
// Required. The context to update.
266-
Context context = 1;
296+
Context context = 1 [(google.api.field_behavior) = REQUIRED];
267297

268298
// Optional. The mask to control which fields get updated.
269-
google.protobuf.FieldMask update_mask = 2;
299+
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
270300
}
271301

272302
// The request message for [Contexts.DeleteContext][google.cloud.dialogflow.v2beta1.Contexts.DeleteContext].
@@ -277,7 +307,12 @@ message DeleteContextRequest {
277307
// ID>/sessions/<Session ID>/contexts/<Context ID>`. If `Environment ID` is
278308
// not specified, we assume default 'draft' environment. If `User ID` is not
279309
// specified, we assume default '-' user.
280-
string name = 1;
310+
string name = 1 [
311+
(google.api.field_behavior) = REQUIRED,
312+
(google.api.resource_reference) = {
313+
type: "dialogflow.googleapis.com/Context"
314+
}
315+
];
281316
}
282317

283318
// The request message for [Contexts.DeleteAllContexts][google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContexts].
@@ -287,5 +322,10 @@ message DeleteAllContextsRequest {
287322
// ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session
288323
// ID>`. If `Environment ID` is not specified we assume default 'draft'
289324
// environment. If `User ID` is not specified, we assume default '-' user.
290-
string parent = 1;
325+
string parent = 1 [
326+
(google.api.field_behavior) = REQUIRED,
327+
(google.api.resource_reference) = {
328+
child_type: "dialogflow.googleapis.com/Context"
329+
}
330+
];
291331
}

0 commit comments

Comments
 (0)