google-cloud-discovery_engine-v1beta 0.a → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +149 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +429 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/credentials.rb +47 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +78 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +386 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +114 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest.rb +52 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/completion_service.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +1159 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/document_service/credentials.rb +47 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +768 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +135 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +960 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +919 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +518 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest.rb +55 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service.rb +58 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +486 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/credentials.rb +47 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +135 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +443 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +116 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest.rb +52 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service.rb +55 -0
  28. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +42 -0
  29. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +840 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/schema_service/credentials.rb +47 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +768 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/schema_service/paths.rb +127 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +680 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +919 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +382 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest.rb +53 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/schema_service.rb +56 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +511 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/search_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +131 -0
  41. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +463 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +116 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest.rb +52 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/search_service.rb +55 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +638 -0
  46. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/credentials.rb +47 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +768 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +131 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +542 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +919 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +250 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest.rb +53 -0
  53. data/lib/google/cloud/discovery_engine/v1beta/user_event_service.rb +56 -0
  54. data/lib/google/cloud/discovery_engine/v1beta/version.rb +7 -2
  55. data/lib/google/cloud/discovery_engine/v1beta.rb +50 -0
  56. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +46 -0
  57. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +49 -0
  58. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +45 -0
  59. data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +48 -0
  60. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +58 -0
  61. data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +81 -0
  62. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +66 -0
  63. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +49 -0
  64. data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_pb.rb +55 -0
  65. data/lib/google/cloud/discoveryengine/v1beta/recommendation_service_services_pb.rb +45 -0
  66. data/lib/google/cloud/discoveryengine/v1beta/schema_pb.rb +47 -0
  67. data/lib/google/cloud/discoveryengine/v1beta/schema_service_pb.rb +61 -0
  68. data/lib/google/cloud/discoveryengine/v1beta/schema_service_services_pb.rb +53 -0
  69. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +71 -0
  70. data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +45 -0
  71. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +58 -0
  72. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +53 -0
  73. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +59 -0
  74. data/lib/google-cloud-discovery_engine-v1beta.rb +21 -0
  75. data/proto_docs/README.md +4 -0
  76. data/proto_docs/google/api/client.rb +381 -0
  77. data/proto_docs/google/api/field_behavior.rb +71 -0
  78. data/proto_docs/google/api/httpbody.rb +80 -0
  79. data/proto_docs/google/api/launch_stage.rb +71 -0
  80. data/proto_docs/google/api/resource.rb +222 -0
  81. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +107 -0
  82. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +98 -0
  83. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +107 -0
  84. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +181 -0
  85. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +340 -0
  86. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +84 -0
  87. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +210 -0
  88. data/proto_docs/google/cloud/discoveryengine/v1beta/schema.rb +45 -0
  89. data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +180 -0
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +603 -0
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +473 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +64 -0
  93. data/proto_docs/google/longrunning/operations.rb +164 -0
  94. data/proto_docs/google/protobuf/any.rb +144 -0
  95. data/proto_docs/google/protobuf/duration.rb +98 -0
  96. data/proto_docs/google/protobuf/empty.rb +34 -0
  97. data/proto_docs/google/protobuf/struct.rb +96 -0
  98. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  99. data/proto_docs/google/rpc/status.rb +48 -0
  100. data/proto_docs/google/type/date.rb +53 -0
  101. metadata +254 -12
@@ -0,0 +1,680 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/errors"
20
+ require "google/cloud/discoveryengine/v1beta/schema_service_pb"
21
+ require "google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1beta
27
+ module SchemaService
28
+ module Rest
29
+ ##
30
+ # REST client for the SchemaService service.
31
+ #
32
+ # Service for managing {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}s.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :schema_service_stub
39
+
40
+ ##
41
+ # Configure the SchemaService Client class.
42
+ #
43
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all SchemaService clients
49
+ # ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.timeout = 30.0
70
+ default_config.retry_policy = {
71
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
72
+ }
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the SchemaService Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # Create a new SchemaService REST client object.
102
+ #
103
+ # @example
104
+ #
105
+ # # Create a client using the default configuration
106
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new
107
+ #
108
+ # # Create a client using a custom configuration
109
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new do |config|
110
+ # config.timeout = 10.0
111
+ # end
112
+ #
113
+ # @yield [config] Configure the SchemaService client.
114
+ # @yieldparam config [Client::Configuration]
115
+ #
116
+ def initialize
117
+ # Create the configuration object
118
+ @config = Configuration.new Client.configure
119
+
120
+ # Yield the configuration if needed
121
+ yield @config if block_given?
122
+
123
+ # Create credentials
124
+ credentials = @config.credentials
125
+ # Use self-signed JWT if the endpoint is unchanged from default,
126
+ # but only if the default endpoint does not have a region prefix.
127
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
128
+ !@config.endpoint.split(".").first.include?("-")
129
+ credentials ||= Credentials.default scope: @config.scope,
130
+ enable_self_signed_jwt: enable_self_signed_jwt
131
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
132
+ credentials = Credentials.new credentials, scope: @config.scope
133
+ end
134
+
135
+ @quota_project_id = @config.quota_project
136
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
137
+
138
+ @operations_client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Operations.new do |config|
139
+ config.credentials = credentials
140
+ config.quota_project = @quota_project_id
141
+ config.endpoint = @config.endpoint
142
+ end
143
+
144
+ @schema_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
145
+ end
146
+
147
+ ##
148
+ # Get the associated client for long-running operations.
149
+ #
150
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Operations]
151
+ #
152
+ attr_reader :operations_client
153
+
154
+ # Service calls
155
+
156
+ ##
157
+ # Gets a {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}.
158
+ #
159
+ # @overload get_schema(request, options = nil)
160
+ # Pass arguments to `get_schema` via a request object, either of type
161
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GetSchemaRequest} or an equivalent Hash.
162
+ #
163
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::GetSchemaRequest, ::Hash]
164
+ # A request object representing the call parameters. Required. To specify no
165
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
166
+ # @param options [::Gapic::CallOptions, ::Hash]
167
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
168
+ #
169
+ # @overload get_schema(name: nil)
170
+ # Pass arguments to `get_schema` via keyword arguments. Note that at
171
+ # least one keyword argument is required. To specify no parameters, or to keep all
172
+ # the default parameter values, pass an empty Hash as a request object (see above).
173
+ #
174
+ # @param name [::String]
175
+ # Required. The full resource name of the schema, in the format of
176
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
177
+ # @yield [result, operation] Access the result along with the TransportOperation object
178
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Schema]
179
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
180
+ #
181
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Schema]
182
+ #
183
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
184
+ def get_schema request, options = nil
185
+ raise ::ArgumentError, "request must be provided" if request.nil?
186
+
187
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GetSchemaRequest
188
+
189
+ # Converts hash and nil to an options object
190
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
191
+
192
+ # Customize the options with defaults
193
+ call_metadata = @config.rpcs.get_schema.metadata.to_h
194
+
195
+ # Set x-goog-api-client and x-goog-user-project headers
196
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
197
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
198
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
199
+ transports_version_send: [:rest]
200
+
201
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
202
+
203
+ options.apply_defaults timeout: @config.rpcs.get_schema.timeout,
204
+ metadata: call_metadata,
205
+ retry_policy: @config.rpcs.get_schema.retry_policy
206
+
207
+ options.apply_defaults timeout: @config.timeout,
208
+ metadata: @config.metadata,
209
+ retry_policy: @config.retry_policy
210
+
211
+ @schema_service_stub.get_schema request, options do |result, operation|
212
+ yield result, operation if block_given?
213
+ return result
214
+ end
215
+ rescue ::Gapic::Rest::Error => e
216
+ raise ::Google::Cloud::Error.from_error(e)
217
+ end
218
+
219
+ ##
220
+ # Gets a list of {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}s.
221
+ #
222
+ # @overload list_schemas(request, options = nil)
223
+ # Pass arguments to `list_schemas` via a request object, either of type
224
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListSchemasRequest} or an equivalent Hash.
225
+ #
226
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListSchemasRequest, ::Hash]
227
+ # A request object representing the call parameters. Required. To specify no
228
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
229
+ # @param options [::Gapic::CallOptions, ::Hash]
230
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
231
+ #
232
+ # @overload list_schemas(parent: nil, page_size: nil, page_token: nil)
233
+ # Pass arguments to `list_schemas` via keyword arguments. Note that at
234
+ # least one keyword argument is required. To specify no parameters, or to keep all
235
+ # the default parameter values, pass an empty Hash as a request object (see above).
236
+ #
237
+ # @param parent [::String]
238
+ # Required. The parent data store resource name, in the format of
239
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
240
+ # @param page_size [::Integer]
241
+ # The maximum number of {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}s
242
+ # to return. The service may return fewer than this value.
243
+ #
244
+ # If unspecified, at most 100
245
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}s will be returned.
246
+ #
247
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
248
+ # @param page_token [::String]
249
+ # A page token, received from a previous
250
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client#list_schemas SchemaService.ListSchemas}
251
+ # call. Provide this to retrieve the subsequent page.
252
+ #
253
+ # When paginating, all other parameters provided to
254
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client#list_schemas SchemaService.ListSchemas}
255
+ # must match the call that provided the page token.
256
+ # @yield [result, operation] Access the result along with the TransportOperation object
257
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Schema>]
258
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
259
+ #
260
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Schema>]
261
+ #
262
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
263
+ def list_schemas request, options = nil
264
+ raise ::ArgumentError, "request must be provided" if request.nil?
265
+
266
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListSchemasRequest
267
+
268
+ # Converts hash and nil to an options object
269
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
270
+
271
+ # Customize the options with defaults
272
+ call_metadata = @config.rpcs.list_schemas.metadata.to_h
273
+
274
+ # Set x-goog-api-client and x-goog-user-project headers
275
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
276
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
277
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
278
+ transports_version_send: [:rest]
279
+
280
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
+
282
+ options.apply_defaults timeout: @config.rpcs.list_schemas.timeout,
283
+ metadata: call_metadata,
284
+ retry_policy: @config.rpcs.list_schemas.retry_policy
285
+
286
+ options.apply_defaults timeout: @config.timeout,
287
+ metadata: @config.metadata,
288
+ retry_policy: @config.retry_policy
289
+
290
+ @schema_service_stub.list_schemas request, options do |result, operation|
291
+ result = ::Gapic::Rest::PagedEnumerable.new @schema_service_stub, :list_schemas, "schemas", request, result, options
292
+ yield result, operation if block_given?
293
+ return result
294
+ end
295
+ rescue ::Gapic::Rest::Error => e
296
+ raise ::Google::Cloud::Error.from_error(e)
297
+ end
298
+
299
+ ##
300
+ # Creates a {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}.
301
+ #
302
+ # @overload create_schema(request, options = nil)
303
+ # Pass arguments to `create_schema` via a request object, either of type
304
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CreateSchemaRequest} or an equivalent Hash.
305
+ #
306
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::CreateSchemaRequest, ::Hash]
307
+ # A request object representing the call parameters. Required. To specify no
308
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
309
+ # @param options [::Gapic::CallOptions, ::Hash]
310
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
311
+ #
312
+ # @overload create_schema(parent: nil, schema: nil, schema_id: nil)
313
+ # Pass arguments to `create_schema` via keyword arguments. Note that at
314
+ # least one keyword argument is required. To specify no parameters, or to keep all
315
+ # the default parameter values, pass an empty Hash as a request object (see above).
316
+ #
317
+ # @param parent [::String]
318
+ # Required. The parent data store resource name, in the format of
319
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.
320
+ # @param schema [::Google::Cloud::DiscoveryEngine::V1beta::Schema, ::Hash]
321
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema} to
322
+ # create.
323
+ # @param schema_id [::String]
324
+ # Required. The ID to use for the
325
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}, which will become the
326
+ # final component of the
327
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Schema#name Schema.name}.
328
+ #
329
+ # This field should conform to
330
+ # [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length
331
+ # limit of 63 characters.
332
+ # @yield [result, operation] Access the result along with the TransportOperation object
333
+ # @yieldparam result [::Gapic::Operation]
334
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
335
+ #
336
+ # @return [::Gapic::Operation]
337
+ #
338
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
339
+ def create_schema request, options = nil
340
+ raise ::ArgumentError, "request must be provided" if request.nil?
341
+
342
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::CreateSchemaRequest
343
+
344
+ # Converts hash and nil to an options object
345
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
346
+
347
+ # Customize the options with defaults
348
+ call_metadata = @config.rpcs.create_schema.metadata.to_h
349
+
350
+ # Set x-goog-api-client and x-goog-user-project headers
351
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
352
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
353
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
354
+ transports_version_send: [:rest]
355
+
356
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
357
+
358
+ options.apply_defaults timeout: @config.rpcs.create_schema.timeout,
359
+ metadata: call_metadata,
360
+ retry_policy: @config.rpcs.create_schema.retry_policy
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
364
+ retry_policy: @config.retry_policy
365
+
366
+ @schema_service_stub.create_schema request, options do |result, operation|
367
+ result = ::Gapic::Operation.new result, @operations_client, options: options
368
+ yield result, operation if block_given?
369
+ return result
370
+ end
371
+ rescue ::Gapic::Rest::Error => e
372
+ raise ::Google::Cloud::Error.from_error(e)
373
+ end
374
+
375
+ ##
376
+ # Updates a {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}.
377
+ #
378
+ # @overload update_schema(request, options = nil)
379
+ # Pass arguments to `update_schema` via a request object, either of type
380
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UpdateSchemaRequest} or an equivalent Hash.
381
+ #
382
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::UpdateSchemaRequest, ::Hash]
383
+ # A request object representing the call parameters. Required. To specify no
384
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
385
+ # @param options [::Gapic::CallOptions, ::Hash]
386
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
387
+ #
388
+ # @overload update_schema(schema: nil, allow_missing: nil)
389
+ # Pass arguments to `update_schema` via keyword arguments. Note that at
390
+ # least one keyword argument is required. To specify no parameters, or to keep all
391
+ # the default parameter values, pass an empty Hash as a request object (see above).
392
+ #
393
+ # @param schema [::Google::Cloud::DiscoveryEngine::V1beta::Schema, ::Hash]
394
+ # Required. The {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema} to
395
+ # update.
396
+ # @param allow_missing [::Boolean]
397
+ # If set to true, and the
398
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema} is not found, a new
399
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema} will be created. In
400
+ # this situation, `update_mask` is ignored.
401
+ # @yield [result, operation] Access the result along with the TransportOperation object
402
+ # @yieldparam result [::Gapic::Operation]
403
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
404
+ #
405
+ # @return [::Gapic::Operation]
406
+ #
407
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
408
+ def update_schema request, options = nil
409
+ raise ::ArgumentError, "request must be provided" if request.nil?
410
+
411
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::UpdateSchemaRequest
412
+
413
+ # Converts hash and nil to an options object
414
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
415
+
416
+ # Customize the options with defaults
417
+ call_metadata = @config.rpcs.update_schema.metadata.to_h
418
+
419
+ # Set x-goog-api-client and x-goog-user-project headers
420
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
421
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
422
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
423
+ transports_version_send: [:rest]
424
+
425
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
426
+
427
+ options.apply_defaults timeout: @config.rpcs.update_schema.timeout,
428
+ metadata: call_metadata,
429
+ retry_policy: @config.rpcs.update_schema.retry_policy
430
+
431
+ options.apply_defaults timeout: @config.timeout,
432
+ metadata: @config.metadata,
433
+ retry_policy: @config.retry_policy
434
+
435
+ @schema_service_stub.update_schema request, options do |result, operation|
436
+ result = ::Gapic::Operation.new result, @operations_client, options: options
437
+ yield result, operation if block_given?
438
+ return result
439
+ end
440
+ rescue ::Gapic::Rest::Error => e
441
+ raise ::Google::Cloud::Error.from_error(e)
442
+ end
443
+
444
+ ##
445
+ # Deletes a {::Google::Cloud::DiscoveryEngine::V1beta::Schema Schema}.
446
+ #
447
+ # @overload delete_schema(request, options = nil)
448
+ # Pass arguments to `delete_schema` via a request object, either of type
449
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DeleteSchemaRequest} or an equivalent Hash.
450
+ #
451
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::DeleteSchemaRequest, ::Hash]
452
+ # A request object representing the call parameters. Required. To specify no
453
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
454
+ # @param options [::Gapic::CallOptions, ::Hash]
455
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
456
+ #
457
+ # @overload delete_schema(name: nil)
458
+ # Pass arguments to `delete_schema` via keyword arguments. Note that at
459
+ # least one keyword argument is required. To specify no parameters, or to keep all
460
+ # the default parameter values, pass an empty Hash as a request object (see above).
461
+ #
462
+ # @param name [::String]
463
+ # Required. The full resource name of the schema, in the format of
464
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.
465
+ # @yield [result, operation] Access the result along with the TransportOperation object
466
+ # @yieldparam result [::Gapic::Operation]
467
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
468
+ #
469
+ # @return [::Gapic::Operation]
470
+ #
471
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
472
+ def delete_schema request, options = nil
473
+ raise ::ArgumentError, "request must be provided" if request.nil?
474
+
475
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::DeleteSchemaRequest
476
+
477
+ # Converts hash and nil to an options object
478
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
479
+
480
+ # Customize the options with defaults
481
+ call_metadata = @config.rpcs.delete_schema.metadata.to_h
482
+
483
+ # Set x-goog-api-client and x-goog-user-project headers
484
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
485
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
486
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
487
+ transports_version_send: [:rest]
488
+
489
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
490
+
491
+ options.apply_defaults timeout: @config.rpcs.delete_schema.timeout,
492
+ metadata: call_metadata,
493
+ retry_policy: @config.rpcs.delete_schema.retry_policy
494
+
495
+ options.apply_defaults timeout: @config.timeout,
496
+ metadata: @config.metadata,
497
+ retry_policy: @config.retry_policy
498
+
499
+ @schema_service_stub.delete_schema request, options do |result, operation|
500
+ result = ::Gapic::Operation.new result, @operations_client, options: options
501
+ yield result, operation if block_given?
502
+ return result
503
+ end
504
+ rescue ::Gapic::Rest::Error => e
505
+ raise ::Google::Cloud::Error.from_error(e)
506
+ end
507
+
508
+ ##
509
+ # Configuration class for the SchemaService REST API.
510
+ #
511
+ # This class represents the configuration for SchemaService REST,
512
+ # providing control over timeouts, retry behavior, logging, transport
513
+ # parameters, and other low-level controls. Certain parameters can also be
514
+ # applied individually to specific RPCs. See
515
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client::Configuration::Rpcs}
516
+ # for a list of RPCs that can be configured independently.
517
+ #
518
+ # Configuration can be applied globally to all clients, or to a single client
519
+ # on construction.
520
+ #
521
+ # @example
522
+ #
523
+ # # Modify the global config, setting the timeout for
524
+ # # get_schema to 20 seconds,
525
+ # # and all remaining timeouts to 10 seconds.
526
+ # ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.configure do |config|
527
+ # config.timeout = 10.0
528
+ # config.rpcs.get_schema.timeout = 20.0
529
+ # end
530
+ #
531
+ # # Apply the above configuration only to a new client.
532
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SchemaService::Rest::Client.new do |config|
533
+ # config.timeout = 10.0
534
+ # config.rpcs.get_schema.timeout = 20.0
535
+ # end
536
+ #
537
+ # @!attribute [rw] endpoint
538
+ # The hostname or hostname:port of the service endpoint.
539
+ # Defaults to `"discoveryengine.googleapis.com"`.
540
+ # @return [::String]
541
+ # @!attribute [rw] credentials
542
+ # Credentials to send with calls. You may provide any of the following types:
543
+ # * (`String`) The path to a service account key file in JSON format
544
+ # * (`Hash`) A service account key as a Hash
545
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
546
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
547
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
548
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
549
+ # * (`nil`) indicating no credentials
550
+ # @return [::Object]
551
+ # @!attribute [rw] scope
552
+ # The OAuth scopes
553
+ # @return [::Array<::String>]
554
+ # @!attribute [rw] lib_name
555
+ # The library name as recorded in instrumentation and logging
556
+ # @return [::String]
557
+ # @!attribute [rw] lib_version
558
+ # The library version as recorded in instrumentation and logging
559
+ # @return [::String]
560
+ # @!attribute [rw] timeout
561
+ # The call timeout in seconds.
562
+ # @return [::Numeric]
563
+ # @!attribute [rw] metadata
564
+ # Additional headers to be sent with the call.
565
+ # @return [::Hash{::Symbol=>::String}]
566
+ # @!attribute [rw] retry_policy
567
+ # The retry policy. The value is a hash with the following keys:
568
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
569
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
570
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
571
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
572
+ # trigger a retry.
573
+ # @return [::Hash]
574
+ # @!attribute [rw] quota_project
575
+ # A separate project against which to charge quota.
576
+ # @return [::String]
577
+ #
578
+ class Configuration
579
+ extend ::Gapic::Config
580
+
581
+ config_attr :endpoint, "discoveryengine.googleapis.com", ::String
582
+ config_attr :credentials, nil do |value|
583
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
584
+ allowed.any? { |klass| klass === value }
585
+ end
586
+ config_attr :scope, nil, ::String, ::Array, nil
587
+ config_attr :lib_name, nil, ::String, nil
588
+ config_attr :lib_version, nil, ::String, nil
589
+ config_attr :timeout, nil, ::Numeric, nil
590
+ config_attr :metadata, nil, ::Hash, nil
591
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
592
+ config_attr :quota_project, nil, ::String, nil
593
+
594
+ # @private
595
+ def initialize parent_config = nil
596
+ @parent_config = parent_config unless parent_config.nil?
597
+
598
+ yield self if block_given?
599
+ end
600
+
601
+ ##
602
+ # Configurations for individual RPCs
603
+ # @return [Rpcs]
604
+ #
605
+ def rpcs
606
+ @rpcs ||= begin
607
+ parent_rpcs = nil
608
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
609
+ Rpcs.new parent_rpcs
610
+ end
611
+ end
612
+
613
+ ##
614
+ # Configuration RPC class for the SchemaService API.
615
+ #
616
+ # Includes fields providing the configuration for each RPC in this service.
617
+ # Each configuration object is of type `Gapic::Config::Method` and includes
618
+ # the following configuration fields:
619
+ #
620
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
621
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
622
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
623
+ # include the following keys:
624
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
625
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
626
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
627
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
628
+ # trigger a retry.
629
+ #
630
+ class Rpcs
631
+ ##
632
+ # RPC-specific configuration for `get_schema`
633
+ # @return [::Gapic::Config::Method]
634
+ #
635
+ attr_reader :get_schema
636
+ ##
637
+ # RPC-specific configuration for `list_schemas`
638
+ # @return [::Gapic::Config::Method]
639
+ #
640
+ attr_reader :list_schemas
641
+ ##
642
+ # RPC-specific configuration for `create_schema`
643
+ # @return [::Gapic::Config::Method]
644
+ #
645
+ attr_reader :create_schema
646
+ ##
647
+ # RPC-specific configuration for `update_schema`
648
+ # @return [::Gapic::Config::Method]
649
+ #
650
+ attr_reader :update_schema
651
+ ##
652
+ # RPC-specific configuration for `delete_schema`
653
+ # @return [::Gapic::Config::Method]
654
+ #
655
+ attr_reader :delete_schema
656
+
657
+ # @private
658
+ def initialize parent_rpcs = nil
659
+ get_schema_config = parent_rpcs.get_schema if parent_rpcs.respond_to? :get_schema
660
+ @get_schema = ::Gapic::Config::Method.new get_schema_config
661
+ list_schemas_config = parent_rpcs.list_schemas if parent_rpcs.respond_to? :list_schemas
662
+ @list_schemas = ::Gapic::Config::Method.new list_schemas_config
663
+ create_schema_config = parent_rpcs.create_schema if parent_rpcs.respond_to? :create_schema
664
+ @create_schema = ::Gapic::Config::Method.new create_schema_config
665
+ update_schema_config = parent_rpcs.update_schema if parent_rpcs.respond_to? :update_schema
666
+ @update_schema = ::Gapic::Config::Method.new update_schema_config
667
+ delete_schema_config = parent_rpcs.delete_schema if parent_rpcs.respond_to? :delete_schema
668
+ @delete_schema = ::Gapic::Config::Method.new delete_schema_config
669
+
670
+ yield self if block_given?
671
+ end
672
+ end
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end
678
+ end
679
+ end
680
+ end