Skip to content

Commit 4fc63ab

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add setIAM and getIAM methods for managing agent sharing
fix!: Correct the resource reference type for the parent field in data_chat_service proto docs: Update comments for multiple fields in Gemini Data Analytics API PiperOrigin-RevId: 782067469
1 parent d59db18 commit 4fc63ab

12 files changed

Lines changed: 410 additions & 96 deletions

google/cloud/geminidataanalytics/v1alpha/BUILD.bazel

Lines changed: 125 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ proto_library(
4040
"//google/api:field_behavior_proto",
4141
"//google/api:field_info_proto",
4242
"//google/api:resource_proto",
43+
"//google/iam/v1:iam_policy_proto",
44+
"//google/iam/v1:policy_proto",
4345
"//google/longrunning:operations_proto",
4446
"@com_google_protobuf//:empty_proto",
4547
"@com_google_protobuf//:field_mask_proto",
@@ -57,6 +59,77 @@ proto_library_with_info(
5759
],
5860
)
5961

62+
##############################################################################
63+
# Java
64+
##############################################################################
65+
# buildifier: disable=same-origin-load
66+
load(
67+
"@com_google_googleapis_imports//:imports.bzl",
68+
"java_gapic_assembly_gradle_pkg",
69+
"java_gapic_library",
70+
"java_gapic_test",
71+
"java_grpc_library",
72+
"java_proto_library",
73+
)
74+
75+
java_proto_library(
76+
name = "geminidataanalytics_java_proto",
77+
deps = [":geminidataanalytics_proto"],
78+
)
79+
80+
java_grpc_library(
81+
name = "geminidataanalytics_java_grpc",
82+
srcs = [":geminidataanalytics_proto"],
83+
deps = [":geminidataanalytics_java_proto"],
84+
)
85+
86+
java_gapic_library(
87+
name = "geminidataanalytics_java_gapic",
88+
srcs = [":geminidataanalytics_proto_with_info"],
89+
gapic_yaml = None,
90+
grpc_service_config = "geminidataanalytics_v1alpha_grpc_service_config.json",
91+
rest_numeric_enums = True,
92+
service_yaml = "geminidataanalytics_v1alpha.yaml",
93+
test_deps = [
94+
":geminidataanalytics_java_grpc",
95+
"//google/cloud/location:location_java_grpc",
96+
"//google/iam/v1:iam_java_grpc",
97+
],
98+
transport = "grpc+rest",
99+
deps = [
100+
":geminidataanalytics_java_proto",
101+
"//google/api:api_java_proto",
102+
"//google/cloud/location:location_java_proto",
103+
"//google/iam/v1:iam_java_proto",
104+
],
105+
)
106+
107+
java_gapic_test(
108+
name = "geminidataanalytics_java_gapic_test_suite",
109+
test_classes = [
110+
"com.google.cloud.geminidataanalytics.v1alpha.ContextRetrievalServiceClientHttpJsonTest",
111+
"com.google.cloud.geminidataanalytics.v1alpha.ContextRetrievalServiceClientTest",
112+
"com.google.cloud.geminidataanalytics.v1alpha.DataAgentServiceClientHttpJsonTest",
113+
"com.google.cloud.geminidataanalytics.v1alpha.DataAgentServiceClientTest",
114+
"com.google.cloud.geminidataanalytics.v1alpha.DataChatServiceClientHttpJsonTest",
115+
"com.google.cloud.geminidataanalytics.v1alpha.DataChatServiceClientTest",
116+
],
117+
runtime_deps = [":geminidataanalytics_java_gapic_test"],
118+
)
119+
120+
# Open Source Packages
121+
java_gapic_assembly_gradle_pkg(
122+
name = "google-cloud-geminidataanalytics-v1alpha-java",
123+
include_samples = True,
124+
transport = "grpc+rest",
125+
deps = [
126+
":geminidataanalytics_java_gapic",
127+
":geminidataanalytics_java_grpc",
128+
":geminidataanalytics_java_proto",
129+
":geminidataanalytics_proto",
130+
],
131+
)
132+
60133
##############################################################################
61134
# Go
62135
##############################################################################
@@ -75,6 +148,7 @@ go_proto_library(
75148
protos = [":geminidataanalytics_proto"],
76149
deps = [
77150
"//google/api:annotations_go_proto",
151+
"//google/iam/v1:iam_go_proto",
78152
"//google/longrunning:longrunning_go_proto",
79153
],
80154
)
@@ -92,6 +166,7 @@ go_gapic_library(
92166
deps = [
93167
":geminidataanalytics_go_proto",
94168
"//google/cloud/location:location_go_proto",
169+
"//google/iam/v1:iam_go_proto",
95170
"//google/longrunning:longrunning_go_proto",
96171
"@com_google_cloud_go_longrunning//:go_default_library",
97172
"@com_google_cloud_go_longrunning//autogen:go_default_library",
@@ -130,6 +205,7 @@ py_gapic_library(
130205
service_yaml = "geminidataanalytics_v1alpha.yaml",
131206
transport = "grpc+rest",
132207
deps = [
208+
"//google/iam/v1:iam_policy_py_proto",
133209
],
134210
)
135211

@@ -220,6 +296,55 @@ nodejs_gapic_assembly_pkg(
220296
],
221297
)
222298

299+
##############################################################################
300+
# Ruby
301+
##############################################################################
302+
# buildifier: disable=same-origin-load
303+
load(
304+
"@com_google_googleapis_imports//:imports.bzl",
305+
"ruby_cloud_gapic_library",
306+
"ruby_gapic_assembly_pkg",
307+
"ruby_grpc_library",
308+
"ruby_proto_library",
309+
)
310+
311+
ruby_proto_library(
312+
name = "geminidataanalytics_ruby_proto",
313+
deps = [":geminidataanalytics_proto"],
314+
)
315+
316+
ruby_grpc_library(
317+
name = "geminidataanalytics_ruby_grpc",
318+
srcs = [":geminidataanalytics_proto"],
319+
deps = [":geminidataanalytics_ruby_proto"],
320+
)
321+
322+
ruby_cloud_gapic_library(
323+
name = "geminidataanalytics_ruby_gapic",
324+
srcs = [":geminidataanalytics_proto_with_info"],
325+
extra_protoc_parameters = [
326+
"ruby-cloud-gem-name=google-cloud-geminidataanalytics-v1alpha",
327+
],
328+
grpc_service_config = "geminidataanalytics_v1alpha_grpc_service_config.json",
329+
rest_numeric_enums = True,
330+
service_yaml = "geminidataanalytics_v1alpha.yaml",
331+
transport = "grpc+rest",
332+
deps = [
333+
":geminidataanalytics_ruby_grpc",
334+
":geminidataanalytics_ruby_proto",
335+
],
336+
)
337+
338+
# Open Source Packages
339+
ruby_gapic_assembly_pkg(
340+
name = "google-cloud-geminidataanalytics-v1alpha-ruby",
341+
deps = [
342+
":geminidataanalytics_ruby_gapic",
343+
":geminidataanalytics_ruby_grpc",
344+
":geminidataanalytics_ruby_proto",
345+
],
346+
)
347+
223348
##############################################################################
224349
# C#
225350
##############################################################################
@@ -234,7 +359,6 @@ load(
234359

235360
csharp_proto_library(
236361
name = "geminidataanalytics_csharp_proto",
237-
extra_opts = [],
238362
deps = [":geminidataanalytics_proto"],
239363
)
240364

google/cloud/geminidataanalytics/v1alpha/context.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,13 @@ package google.cloud.geminidataanalytics.v1alpha;
1919
import "google/api/field_behavior.proto";
2020
import "google/cloud/geminidataanalytics/v1alpha/datasource.proto";
2121

22+
option csharp_namespace = "Google.Cloud.GeminiDataAnalytics.V1Alpha";
2223
option go_package = "cloud.google.com/go/geminidataanalytics/apiv1alpha/geminidataanalyticspb;geminidataanalyticspb";
2324
option java_multiple_files = true;
2425
option java_outer_classname = "ContextProto";
2526
option java_package = "com.google.cloud.geminidataanalytics.v1alpha";
27+
option php_namespace = "Google\\Cloud\\GeminiDataAnalytics\\V1alpha";
28+
option ruby_package = "Google::Cloud::GeminiDataAnalytics::V1alpha";
2629

2730
// A collection of context to apply to this conversation
2831
message Context {

google/cloud/geminidataanalytics/v1alpha/context_retrieval_service.proto

Lines changed: 87 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/geminidataanalytics/v1alpha/datasource.proto";
2424

25+
option csharp_namespace = "Google.Cloud.GeminiDataAnalytics.V1Alpha";
2526
option go_package = "cloud.google.com/go/geminidataanalytics/apiv1alpha/geminidataanalyticspb;geminidataanalyticspb";
2627
option java_multiple_files = true;
2728
option java_outer_classname = "ContextRetrievalServiceProto";
2829
option java_package = "com.google.cloud.geminidataanalytics.v1alpha";
30+
option php_namespace = "Google\\Cloud\\GeminiDataAnalytics\\V1alpha";
31+
option ruby_package = "Google::Cloud::GeminiDataAnalytics::V1alpha";
2932

3033
// Service to ask a natural language question with a provided project,
3134
// returns BigQuery tables that are relevant to the question within the project
@@ -47,14 +50,25 @@ service ContextRetrievalService {
4750
};
4851
}
4952

53+
// Retrieves BigQuery table contextual data for provided table references.
54+
// Contextual data includes table schema information as well as sample
55+
// values.
56+
rpc RetrieveBigQueryTableContexts(RetrieveBigQueryTableContextsRequest)
57+
returns (RetrieveBigQueryTableContextsResponse) {
58+
option (google.api.http) = {
59+
post: "/v1alpha/{parent=projects/*/locations/*}/retrieval:retrieveBigQueryTableContexts"
60+
body: "*"
61+
};
62+
}
63+
5064
// Retrieves BigQuery table contextual data from recently accessed tables.
5165
// Contextual data includes table schema information as well as sample
5266
// values.
5367
rpc RetrieveBigQueryTableContextsFromRecentTables(
5468
RetrieveBigQueryTableContextsFromRecentTablesRequest)
5569
returns (RetrieveBigQueryTableContextsFromRecentTablesResponse) {
5670
option (google.api.http) = {
57-
post: "/v1alpha/{parent=projects/*/locations/*}:retrieveBigQueryTableContextsFromRecentTables"
71+
post: "/v1alpha/{parent=projects/*/locations/*}/retrieval:retrieveBigQueryTableContextsFromRecentTables"
5872
body: "*"
5973
};
6074
}
@@ -70,6 +84,16 @@ service ContextRetrievalService {
7084
};
7185
}
7286

87+
// Retrieves BigQuery table schema with suggested NL-SQL examples.
88+
rpc RetrieveBigQueryTableSuggestedExamples(
89+
RetrieveBigQueryTableSuggestedExamplesRequest)
90+
returns (RetrieveBigQueryTableSuggestedExamplesResponse) {
91+
option (google.api.http) = {
92+
post: "/v1alpha/{parent=projects/*/locations/*}/retrieval:retrieveBigQueryTableSuggestedExamples"
93+
body: "*"
94+
};
95+
}
96+
7397
// Retrieves BigQuery table references from recently accessed tables.
7498
rpc RetrieveBigQueryRecentRelevantTables(
7599
RetrieveBigQueryRecentRelevantTablesRequest)
@@ -83,11 +107,12 @@ service ContextRetrievalService {
83107

84108
// Request for retrieving BigQuery table contextual data via direct lookup.
85109
message RetrieveBigQueryTableContextRequest {
110+
// Required.
86111
string project = 5
87112
[deprecated = true, (google.api.field_behavior) = REQUIRED];
88113

89114
// Required. Parent value for RetrieveBigQueryTableContextRequest.
90-
// Pattern: projects/{project}/locations/{location}
115+
// Pattern: `projects/{project}/locations/{location}`
91116
// For location, use "global" for now. Regional location value will be
92117
// supported in the future.
93118
string parent = 6 [(google.api.field_behavior) = REQUIRED];
@@ -106,7 +131,7 @@ message RetrieveBigQueryTableContextResponse {
106131
message Candidate {
107132
// The fully qualified resource name of the candidate in its source system,
108133
// if applicable. E.g. for BigQuery tables, the format is:
109-
// //bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
134+
// `bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}`
110135
string linked_resource = 1;
111136

112137
// Content in string format.
@@ -120,13 +145,35 @@ message RetrieveBigQueryTableContextResponse {
120145
repeated TableCandidate table_candidates = 2;
121146
}
122147

148+
// Request for retrieving BigQuery table contextual data via direct lookup.
149+
message RetrieveBigQueryTableContextsRequest {
150+
// Required. Parent value for RetrieveBigQueryTableContextRequest.
151+
// Pattern: `projects/{project}/locations/{location}`
152+
// For location, use "global" for now. Regional location value will be
153+
// supported in the future.
154+
string parent = 1 [(google.api.field_behavior) = REQUIRED];
155+
156+
// Optional. User query in natural language.
157+
string query = 2 [(google.api.field_behavior) = OPTIONAL];
158+
159+
// Optional. A list of direct lookup parameters.
160+
repeated DirectLookup direct_lookups = 3
161+
[(google.api.field_behavior) = OPTIONAL];
162+
}
163+
164+
// Response for retrieving BigQuery table contextual data via direct lookup.
165+
message RetrieveBigQueryTableContextsResponse {
166+
// List of retrieved candidates with their bundled metadata.
167+
repeated TableCandidate table_candidates = 1;
168+
}
169+
123170
// Request for retrieving BigQuery table contextual data from recently accessed
124171
// tables. Response is sorted by semantic similarity to the query.
125172
message RetrieveBigQueryTableContextsFromRecentTablesRequest {
126173
// Required. Parent value for
127174
// RetrieveBigQueryTableContextsFromRecentTablesRequest. Pattern:
128-
// projects/{project}/locations/{location} For location, use "global" for now.
129-
// Regional location value will be supported in the future.
175+
// `projects/{project}/locations/{location}` For location, use "global" for
176+
// now. Regional location value will be supported in the future.
130177
string parent = 1 [(google.api.field_behavior) = REQUIRED];
131178

132179
// Optional. User query in natural language.
@@ -145,8 +192,8 @@ message RetrieveBigQueryTableContextsFromRecentTablesResponse {
145192
message RetrieveBigQueryTableSuggestedDescriptionsRequest {
146193
// Required. Parent value for
147194
// RetrieveBigQueryTableSuggestedDescriptionsRequest. Pattern:
148-
// projects/{project}/locations/{location} For location, use "global" for now.
149-
// Regional location value will be supported in the future.
195+
// `projects/{project}/locations/{location}` For location, use "global" for
196+
// now. Regional location value will be supported in the future.
150197
string parent = 1 [(google.api.field_behavior) = REQUIRED];
151198

152199
// Optional. A list of direct lookup parameters.
@@ -161,11 +208,42 @@ message RetrieveBigQueryTableSuggestedDescriptionsResponse {
161208
repeated TableCandidate table_candidates = 1;
162209
}
163210

211+
// Request for retrieving BigQuery table schema with suggested NL-SQL examples.
212+
message RetrieveBigQueryTableSuggestedExamplesRequest {
213+
// Required. Parent value for RetrieveBigQueryTableSuggestedExamplesRequest.
214+
// Pattern: `projects/{project}/locations/{location}`
215+
// For location, use "global" for now. Regional location value will be
216+
// supported in the future.
217+
string parent = 1 [(google.api.field_behavior) = REQUIRED];
218+
219+
// Optional. A list of direct lookup parameters.
220+
repeated DirectLookup direct_lookup = 2
221+
[(google.api.field_behavior) = OPTIONAL];
222+
}
223+
224+
// Request for retrieving BigQuery table schema with suggested NL-SQL examples.
225+
message RetrieveBigQueryTableSuggestedExamplesResponse {
226+
// A suggested BigQuery NL-SQL example for the given table.
227+
message ExampleSuggestion {
228+
// The natural language query.
229+
string nl_query = 1;
230+
231+
// The SQL answer to the query.
232+
string sql = 2;
233+
234+
// The linked table resources for the suggested example.
235+
repeated string linked_bigquery_tables = 3;
236+
}
237+
238+
// List of suggested examples.
239+
repeated ExampleSuggestion example_suggestions = 2;
240+
}
241+
164242
// Request for retrieving BigQuery table references from recently accessed
165243
// tables. Response is sorted by semantic similarity to the query.
166244
message RetrieveBigQueryRecentRelevantTablesRequest {
167245
// Required. Parent value for RetrieveBigQueryRecentTablesRequest.
168-
// Pattern: projects/{project}/locations/{location}
246+
// Pattern: `projects/{project}/locations/{location}`
169247
// For location, use "global" for now. Regional location value will be
170248
// supported in the future.
171249
string parent = 1 [(google.api.field_behavior) = REQUIRED];
@@ -207,7 +285,7 @@ message TableCandidate {
207285

208286
// The fully qualified resource name of the candidate in its source system,
209287
// if applicable. E.g. for BigQuery tables, the format is:
210-
// //bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}.
288+
// `bigquery.googleapis.com/projects/{project_id}/datasets/{dataset_id}/tables/{table_id}`.
211289
string linked_resource = 1;
212290

213291
// In-context-learning string. For example, could be in DDL format.

0 commit comments

Comments
 (0)