google-cloud-discovery_engine-v1beta 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +9 -3
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +13 -5
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +9 -3
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +21 -6
  6. data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +875 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/control_service/credentials.rb +47 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/control_service/paths.rb +167 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +814 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/service_stub.rb +440 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/control_service.rb +58 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +31 -15
  14. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +31 -15
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +15 -7
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +13 -5
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +15 -7
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +21 -6
  19. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +24 -15
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +13 -5
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +24 -15
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +21 -6
  23. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +19 -8
  24. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +13 -5
  25. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +19 -8
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +21 -6
  27. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +25 -3
  28. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +25 -3
  29. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +485 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/project_service/credentials.rb +47 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +809 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/project_service/paths.rb +47 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +452 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +1092 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +129 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest.rb +54 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/project_service.rb +57 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +24 -2
  39. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +24 -2
  40. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +24 -19
  41. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +66 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +24 -19
  43. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +2 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +18 -10
  45. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +13 -5
  46. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +18 -10
  47. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +21 -6
  48. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +15 -8
  49. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +15 -8
  50. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +104 -2
  51. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +13 -5
  52. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +97 -2
  53. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +21 -6
  54. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +59 -0
  55. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +9 -3
  56. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +9 -3
  57. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +27 -12
  58. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +13 -5
  59. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +27 -12
  60. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +21 -6
  61. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +23 -6
  62. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +13 -5
  63. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +21 -0
  64. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +23 -6
  65. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +21 -6
  66. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +8 -0
  67. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  68. data/lib/google/cloud/discovery_engine/v1beta.rb +2 -0
  69. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +3 -1
  70. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +2 -1
  71. data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +55 -0
  72. data/lib/google/cloud/discoveryengine/v1beta/control_service_pb.rb +57 -0
  73. data/lib/google/cloud/discoveryengine/v1beta/control_service_services_pb.rb +69 -0
  74. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  75. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +48 -0
  76. data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +1 -1
  77. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
  78. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +1 -1
  79. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +1 -1
  80. data/lib/google/cloud/discoveryengine/v1beta/project_pb.rb +49 -0
  81. data/lib/google/cloud/discoveryengine/v1beta/project_service_pb.rb +50 -0
  82. data/lib/google/cloud/discoveryengine/v1beta/project_service_services_pb.rb +51 -0
  83. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +1 -1
  84. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +5 -1
  85. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_services_pb.rb +2 -0
  86. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +1 -1
  87. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  88. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +1 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +1 -1
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +9 -1
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +16 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +209 -0
  93. data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +126 -0
  94. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +2 -2
  95. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +19 -3
  96. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +75 -0
  97. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +2 -2
  98. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +1 -0
  99. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +6 -7
  100. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +3 -3
  101. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +39 -1
  102. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +3 -0
  103. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +4 -4
  104. data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +106 -0
  105. data/proto_docs/google/cloud/discoveryengine/v1beta/project_service.rb +57 -0
  106. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +28 -0
  107. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +20 -19
  108. data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +5 -5
  109. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +30 -24
  110. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +31 -0
  111. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +4 -1
  112. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +3 -0
  113. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +24 -3
  114. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +13 -1
  115. metadata +30 -2
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/discoveryengine/v1beta/project_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module DiscoveryEngine
24
+ module V1beta
25
+ module ProjectService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the ProjectService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # These require statements are intentionally placed here to initialize
35
+ # the REST modules only when it's required.
36
+ require "gapic/rest"
37
+
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
42
+ numeric_enums: true,
43
+ raise_faraday_errors: false
44
+ end
45
+
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
64
+ ##
65
+ # Baseline implementation for the provision_project REST call
66
+ #
67
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ProvisionProjectRequest]
68
+ # A request object representing the call parameters. Required.
69
+ # @param options [::Gapic::CallOptions]
70
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
71
+ #
72
+ # @yield [result, operation] Access the result along with the TransportOperation object
73
+ # @yieldparam result [::Google::Longrunning::Operation]
74
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
75
+ #
76
+ # @return [::Google::Longrunning::Operation]
77
+ # A result object deserialized from the server's reply
78
+ def provision_project request_pb, options = nil
79
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
80
+
81
+ verb, uri, query_string_params, body = ServiceStub.transcode_provision_project_request request_pb
82
+ query_string_params = if query_string_params.any?
83
+ query_string_params.to_h { |p| p.split "=", 2 }
84
+ else
85
+ {}
86
+ end
87
+
88
+ response = @client_stub.make_http_request(
89
+ verb,
90
+ uri: uri,
91
+ body: body || "",
92
+ params: query_string_params,
93
+ options: options
94
+ )
95
+ operation = ::Gapic::Rest::TransportOperation.new response
96
+ result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
97
+
98
+ yield result, operation if block_given?
99
+ result
100
+ end
101
+
102
+ ##
103
+ # @private
104
+ #
105
+ # GRPC transcoding helper method for the provision_project REST call
106
+ #
107
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ProvisionProjectRequest]
108
+ # A request object representing the call parameters. Required.
109
+ # @return [Array(String, [String, nil], Hash{String => String})]
110
+ # Uri, Body, Query string parameters
111
+ def self.transcode_provision_project_request request_pb
112
+ transcoder = Gapic::Rest::GrpcTranscoder.new
113
+ .with_bindings(
114
+ uri_method: :post,
115
+ uri_template: "/v1beta/{name}:provision",
116
+ body: "*",
117
+ matches: [
118
+ ["name", %r{^projects/[^/]+/?$}, false]
119
+ ]
120
+ )
121
+ transcoder.transcode request_pb
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/discovery_engine/v1beta/version"
24
+
25
+ require "google/cloud/discovery_engine/v1beta/project_service/credentials"
26
+ require "google/cloud/discovery_engine/v1beta/project_service/paths"
27
+ require "google/cloud/discovery_engine/v1beta/project_service/rest/operations"
28
+ require "google/cloud/discovery_engine/v1beta/project_service/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module DiscoveryEngine
33
+ module V1beta
34
+ ##
35
+ # Service for operations on the
36
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Project Project}.
37
+ #
38
+ # To load this service and instantiate a REST client:
39
+ #
40
+ # require "google/cloud/discovery_engine/v1beta/project_service/rest"
41
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ProjectService::Rest::Client.new
42
+ #
43
+ module ProjectService
44
+ # Client for the REST transport
45
+ module Rest
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
54
+ require "google/cloud/discovery_engine/v1beta/project_service/rest/helpers" if ::File.file? helper_path
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/discovery_engine/v1beta/version"
24
+
25
+ require "google/cloud/discovery_engine/v1beta/project_service/credentials"
26
+ require "google/cloud/discovery_engine/v1beta/project_service/paths"
27
+ require "google/cloud/discovery_engine/v1beta/project_service/operations"
28
+ require "google/cloud/discovery_engine/v1beta/project_service/client"
29
+ require "google/cloud/discovery_engine/v1beta/project_service/rest"
30
+
31
+ module Google
32
+ module Cloud
33
+ module DiscoveryEngine
34
+ module V1beta
35
+ ##
36
+ # Service for operations on the
37
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Project Project}.
38
+ #
39
+ # @example Load this service and instantiate a gRPC client
40
+ #
41
+ # require "google/cloud/discovery_engine/v1beta/project_service"
42
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ProjectService::Client.new
43
+ #
44
+ # @example Load this service and instantiate a REST client
45
+ #
46
+ # require "google/cloud/discovery_engine/v1beta/project_service/rest"
47
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ProjectService::Rest::Client.new
48
+ #
49
+ module ProjectService
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ helper_path = ::File.join __dir__, "project_service", "helpers.rb"
57
+ require "google/cloud/discovery_engine/v1beta/project_service/helpers" if ::File.file? helper_path
@@ -31,6 +31,9 @@ module Google
31
31
  # Service for ranking text records.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
34
37
  # @private
35
38
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
36
39
 
@@ -193,7 +196,7 @@ module Google
193
196
  # @param options [::Gapic::CallOptions, ::Hash]
194
197
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
195
198
  #
196
- # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil)
199
+ # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil, user_labels: nil)
197
200
  # Pass arguments to `rank` via keyword arguments. Note that at
198
201
  # least one keyword argument is required. To specify no parameters, or to keep all
199
202
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -218,6 +221,24 @@ module Google
218
221
  # @param ignore_record_details_in_response [::Boolean]
219
222
  # If true, the response will contain only record ID and score. By default, it
220
223
  # is false, the response will contain record details.
224
+ # @param user_labels [::Hash{::String => ::String}]
225
+ # The user labels applied to a resource must meet the following requirements:
226
+ #
227
+ # * Each resource can have multiple labels, up to a maximum of 64.
228
+ # * Each label must be a key-value pair.
229
+ # * Keys have a minimum length of 1 character and a maximum length of 63
230
+ # characters and cannot be empty. Values can be empty and have a maximum
231
+ # length of 63 characters.
232
+ # * Keys and values can contain only lowercase letters, numeric characters,
233
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
234
+ # international characters are allowed.
235
+ # * The key portion of a label must be unique. However, you can use the same
236
+ # key with multiple resources.
237
+ # * Keys must start with a lowercase letter or international character.
238
+ #
239
+ # See [Google Cloud
240
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
241
+ # for more details.
221
242
  #
222
243
  # @yield [response, operation] Access the result along with the RPC operation
223
244
  # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::RankResponse]
@@ -253,10 +274,11 @@ module Google
253
274
  # Customize the options with defaults
254
275
  metadata = @config.rpcs.rank.metadata.to_h
255
276
 
256
- # Set x-goog-api-client and x-goog-user-project headers
277
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
257
278
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
258
279
  lib_name: @config.lib_name, lib_version: @config.lib_version,
259
280
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
281
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
260
282
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
283
 
262
284
  header_params = {}
@@ -33,6 +33,9 @@ module Google
33
33
  # Service for ranking text records.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
38
41
 
@@ -186,7 +189,7 @@ module Google
186
189
  # @param options [::Gapic::CallOptions, ::Hash]
187
190
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
188
191
  #
189
- # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil)
192
+ # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil, user_labels: nil)
190
193
  # Pass arguments to `rank` via keyword arguments. Note that at
191
194
  # least one keyword argument is required. To specify no parameters, or to keep all
192
195
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -211,6 +214,24 @@ module Google
211
214
  # @param ignore_record_details_in_response [::Boolean]
212
215
  # If true, the response will contain only record ID and score. By default, it
213
216
  # is false, the response will contain record details.
217
+ # @param user_labels [::Hash{::String => ::String}]
218
+ # The user labels applied to a resource must meet the following requirements:
219
+ #
220
+ # * Each resource can have multiple labels, up to a maximum of 64.
221
+ # * Each label must be a key-value pair.
222
+ # * Keys have a minimum length of 1 character and a maximum length of 63
223
+ # characters and cannot be empty. Values can be empty and have a maximum
224
+ # length of 63 characters.
225
+ # * Keys and values can contain only lowercase letters, numeric characters,
226
+ # underscores, and dashes. All characters must use UTF-8 encoding, and
227
+ # international characters are allowed.
228
+ # * The key portion of a label must be unique. However, you can use the same
229
+ # key with multiple resources.
230
+ # * Keys must start with a lowercase letter or international character.
231
+ #
232
+ # See [Google Cloud
233
+ # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
234
+ # for more details.
214
235
  # @yield [result, operation] Access the result along with the TransportOperation object
215
236
  # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::RankResponse]
216
237
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -245,12 +266,13 @@ module Google
245
266
  # Customize the options with defaults
246
267
  call_metadata = @config.rpcs.rank.metadata.to_h
247
268
 
248
- # Set x-goog-api-client and x-goog-user-project headers
269
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
249
270
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
250
271
  lib_name: @config.lib_name, lib_version: @config.lib_version,
251
272
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
252
273
  transports_version_send: [:rest]
253
274
 
275
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
254
276
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
255
277
 
256
278
  options.apply_defaults timeout: @config.rpcs.rank.timeout,
@@ -31,6 +31,9 @@ module Google
31
31
  # Service for making recommendations.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
34
37
  # @private
35
38
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
36
39
 
@@ -205,7 +208,7 @@ module Google
205
208
  # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
206
209
  #
207
210
  # One default serving config is created along with your recommendation engine
208
- # creation. The engine ID will be used as the ID of the default serving
211
+ # creation. The engine ID is used as the ID of the default serving
209
212
  # config. For example, for Engine
210
213
  # `projects/*/locations/global/collections/*/engines/my-engine`, you can use
211
214
  # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine`
@@ -231,9 +234,9 @@ module Google
231
234
  # unset.
232
235
  # @param page_size [::Integer]
233
236
  # Maximum number of results to return. Set this property
234
- # to the number of recommendation results needed. If zero, the service will
235
- # choose a reasonable default. The maximum allowed value is 100. Values
236
- # above 100 will be coerced to 100.
237
+ # to the number of recommendation results needed. If zero, the service
238
+ # chooses a reasonable default. The maximum allowed value is 100. Values
239
+ # above 100 are set to 100.
237
240
  # @param filter [::String]
238
241
  # Filter for restricting recommendation results with a length limit of 5,000
239
242
  # characters. Currently, only filter expressions on the `filter_tags`
@@ -253,18 +256,18 @@ module Google
253
256
  # * (available: true) AND
254
257
  # (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
255
258
  #
256
- # If your filter blocks all results, the API will return generic
259
+ # If your filter blocks all results, the API returns generic
257
260
  # (unfiltered) popular Documents. If you only want results strictly matching
258
- # the filters, set `strictFiltering` to True in
261
+ # the filters, set `strictFiltering` to `true` in
259
262
  # {::Google::Cloud::DiscoveryEngine::V1beta::RecommendRequest#params RecommendRequest.params}
260
263
  # to receive empty results instead.
261
264
  #
262
- # Note that the API will never return
265
+ # Note that the API never returns
263
266
  # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s with
264
- # `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
267
+ # `storageStatus` as `EXPIRED` or `DELETED` regardless of filter choices.
265
268
  # @param validate_only [::Boolean]
266
- # Use validate only mode for this recommendation query. If set to true, a
267
- # fake model will be used that returns arbitrary Document IDs.
269
+ # Use validate only mode for this recommendation query. If set to `true`, a
270
+ # fake model is used that returns arbitrary Document IDs.
268
271
  # Note that the validate only mode should only be used for testing the API,
269
272
  # or if the model is not ready.
270
273
  # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}]
@@ -272,16 +275,17 @@ module Google
272
275
  #
273
276
  # Allowed values:
274
277
  #
275
- # * `returnDocument`: Boolean. If set to true, the associated Document
276
- # object will be returned in
278
+ # * `returnDocument`: Boolean. If set to `true`, the associated Document
279
+ # object is returned in
277
280
  # {::Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}.
278
- # * `returnScore`: Boolean. If set to true, the recommendation 'score'
279
- # corresponding to each returned Document will be set in
281
+ # * `returnScore`: Boolean. If set to true, the recommendation score
282
+ # corresponding to each returned Document is set in
280
283
  # {::Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse::RecommendationResult#metadata RecommendResponse.RecommendationResult.metadata}.
281
- # The given 'score' indicates the probability of a Document conversion
282
- # given the user's context and history.
283
- # * `strictFiltering`: Boolean. True by default. If set to false, the service
284
- # will return generic (unfiltered) popular Documents instead of empty if
284
+ # The given score indicates the probability of a Document conversion given
285
+ # the user's context and history.
286
+ # * `strictFiltering`: Boolean. True by default. If set to `false`, the
287
+ # service
288
+ # returns generic (unfiltered) popular Documents instead of empty if
285
289
  # your filter blocks all recommendation results.
286
290
  # * `diversityLevel`: String. Default empty. If set to be non-empty, then
287
291
  # it needs to be one of:
@@ -348,10 +352,11 @@ module Google
348
352
  # Customize the options with defaults
349
353
  metadata = @config.rpcs.recommend.metadata.to_h
350
354
 
351
- # Set x-goog-api-client and x-goog-user-project headers
355
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
352
356
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
353
357
  lib_name: @config.lib_name, lib_version: @config.lib_version,
354
358
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
359
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
355
360
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
356
361
 
357
362
  header_params = {}
@@ -24,6 +24,51 @@ module Google
24
24
  module RecommendationService
25
25
  # Path helper methods for the RecommendationService API.
26
26
  module Paths
27
+ ##
28
+ # Create a fully-qualified DataStore resource string.
29
+ #
30
+ # @overload data_store_path(project:, location:, data_store:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/dataStores/{data_store}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param data_store [String]
38
+ #
39
+ # @overload data_store_path(project:, location:, collection:, data_store:)
40
+ # The resource will be in the following format:
41
+ #
42
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
43
+ #
44
+ # @param project [String]
45
+ # @param location [String]
46
+ # @param collection [String]
47
+ # @param data_store [String]
48
+ #
49
+ # @return [::String]
50
+ def data_store_path **args
51
+ resources = {
52
+ "data_store:location:project" => (proc do |project:, location:, data_store:|
53
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
54
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
55
+
56
+ "projects/#{project}/locations/#{location}/dataStores/#{data_store}"
57
+ end),
58
+ "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:|
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
61
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
62
+
63
+ "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}"
64
+ end)
65
+ }
66
+
67
+ resource = resources[args.keys.sort.join(":")]
68
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
69
+ resource.call(**args)
70
+ end
71
+
27
72
  ##
28
73
  # Create a fully-qualified Document resource string.
29
74
  #
@@ -77,6 +122,27 @@ module Google
77
122
  resource.call(**args)
78
123
  end
79
124
 
125
+ ##
126
+ # Create a fully-qualified Engine resource string.
127
+ #
128
+ # The resource will be in the following format:
129
+ #
130
+ # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`
131
+ #
132
+ # @param project [String]
133
+ # @param location [String]
134
+ # @param collection [String]
135
+ # @param engine [String]
136
+ #
137
+ # @return [::String]
138
+ def engine_path project:, location:, collection:, engine:
139
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
140
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
141
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
142
+
143
+ "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}"
144
+ end
145
+
80
146
  ##
81
147
  # Create a fully-qualified ServingConfig resource string.
82
148
  #
@@ -33,6 +33,9 @@ module Google
33
33
  # Service for making recommendations.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
38
41
 
@@ -198,7 +201,7 @@ module Google
198
201
  # `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*`
199
202
  #
200
203
  # One default serving config is created along with your recommendation engine
201
- # creation. The engine ID will be used as the ID of the default serving
204
+ # creation. The engine ID is used as the ID of the default serving
202
205
  # config. For example, for Engine
203
206
  # `projects/*/locations/global/collections/*/engines/my-engine`, you can use
204
207
  # `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine`
@@ -224,9 +227,9 @@ module Google
224
227
  # unset.
225
228
  # @param page_size [::Integer]
226
229
  # Maximum number of results to return. Set this property
227
- # to the number of recommendation results needed. If zero, the service will
228
- # choose a reasonable default. The maximum allowed value is 100. Values
229
- # above 100 will be coerced to 100.
230
+ # to the number of recommendation results needed. If zero, the service
231
+ # chooses a reasonable default. The maximum allowed value is 100. Values
232
+ # above 100 are set to 100.
230
233
  # @param filter [::String]
231
234
  # Filter for restricting recommendation results with a length limit of 5,000
232
235
  # characters. Currently, only filter expressions on the `filter_tags`
@@ -246,18 +249,18 @@ module Google
246
249
  # * (available: true) AND
247
250
  # (launguage: ANY("en", "es")) OR (categories: ANY("Movie"))
248
251
  #
249
- # If your filter blocks all results, the API will return generic
252
+ # If your filter blocks all results, the API returns generic
250
253
  # (unfiltered) popular Documents. If you only want results strictly matching
251
- # the filters, set `strictFiltering` to True in
254
+ # the filters, set `strictFiltering` to `true` in
252
255
  # {::Google::Cloud::DiscoveryEngine::V1beta::RecommendRequest#params RecommendRequest.params}
253
256
  # to receive empty results instead.
254
257
  #
255
- # Note that the API will never return
258
+ # Note that the API never returns
256
259
  # {::Google::Cloud::DiscoveryEngine::V1beta::Document Document}s with
257
- # `storageStatus` of `EXPIRED` or `DELETED` regardless of filter choices.
260
+ # `storageStatus` as `EXPIRED` or `DELETED` regardless of filter choices.
258
261
  # @param validate_only [::Boolean]
259
- # Use validate only mode for this recommendation query. If set to true, a
260
- # fake model will be used that returns arbitrary Document IDs.
262
+ # Use validate only mode for this recommendation query. If set to `true`, a
263
+ # fake model is used that returns arbitrary Document IDs.
261
264
  # Note that the validate only mode should only be used for testing the API,
262
265
  # or if the model is not ready.
263
266
  # @param params [::Hash{::String => ::Google::Protobuf::Value, ::Hash}]
@@ -265,16 +268,17 @@ module Google
265
268
  #
266
269
  # Allowed values:
267
270
  #
268
- # * `returnDocument`: Boolean. If set to true, the associated Document
269
- # object will be returned in
271
+ # * `returnDocument`: Boolean. If set to `true`, the associated Document
272
+ # object is returned in
270
273
  # {::Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse::RecommendationResult#document RecommendResponse.RecommendationResult.document}.
271
- # * `returnScore`: Boolean. If set to true, the recommendation 'score'
272
- # corresponding to each returned Document will be set in
274
+ # * `returnScore`: Boolean. If set to true, the recommendation score
275
+ # corresponding to each returned Document is set in
273
276
  # {::Google::Cloud::DiscoveryEngine::V1beta::RecommendResponse::RecommendationResult#metadata RecommendResponse.RecommendationResult.metadata}.
274
- # The given 'score' indicates the probability of a Document conversion
275
- # given the user's context and history.
276
- # * `strictFiltering`: Boolean. True by default. If set to false, the service
277
- # will return generic (unfiltered) popular Documents instead of empty if
277
+ # The given score indicates the probability of a Document conversion given
278
+ # the user's context and history.
279
+ # * `strictFiltering`: Boolean. True by default. If set to `false`, the
280
+ # service
281
+ # returns generic (unfiltered) popular Documents instead of empty if
278
282
  # your filter blocks all recommendation results.
279
283
  # * `diversityLevel`: String. Default empty. If set to be non-empty, then
280
284
  # it needs to be one of:
@@ -340,12 +344,13 @@ module Google
340
344
  # Customize the options with defaults
341
345
  call_metadata = @config.rpcs.recommend.metadata.to_h
342
346
 
343
- # Set x-goog-api-client and x-goog-user-project headers
347
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
344
348
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
345
349
  lib_name: @config.lib_name, lib_version: @config.lib_version,
346
350
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
347
351
  transports_version_send: [:rest]
348
352
 
353
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
349
354
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
350
355
 
351
356
  options.apply_defaults timeout: @config.rpcs.recommend.timeout,
@@ -17,12 +17,14 @@
17
17
  # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
18
 
19
19
  require "google/cloud/discovery_engine/v1beta/completion_service/rest"
20
+ require "google/cloud/discovery_engine/v1beta/control_service/rest"
20
21
  require "google/cloud/discovery_engine/v1beta/search_service/rest"
21
22
  require "google/cloud/discovery_engine/v1beta/conversational_search_service/rest"
22
23
  require "google/cloud/discovery_engine/v1beta/data_store_service/rest"
23
24
  require "google/cloud/discovery_engine/v1beta/document_service/rest"
24
25
  require "google/cloud/discovery_engine/v1beta/engine_service/rest"
25
26
  require "google/cloud/discovery_engine/v1beta/grounded_generation_service/rest"
27
+ require "google/cloud/discovery_engine/v1beta/project_service/rest"
26
28
  require "google/cloud/discovery_engine/v1beta/rank_service/rest"
27
29
  require "google/cloud/discovery_engine/v1beta/recommendation_service/rest"
28
30
  require "google/cloud/discovery_engine/v1beta/schema_service/rest"