google-cloud-discovery_engine-v1beta 0.10.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) 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 +764 -6
  14. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +199 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +715 -6
  16. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +520 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +15 -7
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +13 -5
  19. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +15 -7
  20. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +21 -6
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +71 -37
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +13 -5
  23. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +21 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +71 -37
  25. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +21 -6
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +312 -5
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +13 -5
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +291 -5
  29. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +21 -6
  30. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +180 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +471 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/credentials.rb +47 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +52 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +438 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +129 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest.rb +52 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service.rb +55 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +485 -0
  39. data/lib/google/cloud/discovery_engine/v1beta/project_service/credentials.rb +47 -0
  40. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +809 -0
  41. data/lib/google/cloud/discovery_engine/v1beta/project_service/paths.rb +47 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +452 -0
  43. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +1092 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +129 -0
  45. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest.rb +54 -0
  46. data/lib/google/cloud/discovery_engine/v1beta/project_service.rb +57 -0
  47. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +481 -0
  48. data/lib/google/cloud/discovery_engine/v1beta/rank_service/credentials.rb +47 -0
  49. data/lib/google/cloud/discovery_engine/v1beta/rank_service/paths.rb +52 -0
  50. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +448 -0
  51. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +129 -0
  52. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest.rb +52 -0
  53. data/lib/google/cloud/discovery_engine/v1beta/rank_service.rb +55 -0
  54. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +24 -19
  55. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +66 -0
  56. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +24 -19
  57. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +4 -0
  58. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +18 -10
  59. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +13 -5
  60. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +18 -10
  61. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +21 -6
  62. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +26 -14
  63. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +26 -14
  64. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +104 -2
  65. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +13 -5
  66. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +97 -2
  67. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +21 -6
  68. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +59 -0
  69. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +9 -3
  70. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +9 -3
  71. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +27 -12
  72. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +13 -5
  73. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +27 -12
  74. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +21 -6
  75. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +23 -6
  76. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +13 -5
  77. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +21 -0
  78. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +23 -6
  79. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +21 -6
  80. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +8 -0
  81. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  82. data/lib/google/cloud/discovery_engine/v1beta.rb +4 -0
  83. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +69 -0
  84. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +2 -1
  85. data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +55 -0
  86. data/lib/google/cloud/discoveryengine/v1beta/control_service_pb.rb +57 -0
  87. data/lib/google/cloud/discoveryengine/v1beta/control_service_services_pb.rb +69 -0
  88. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +32 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +25 -0
  90. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +48 -0
  91. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +1 -1
  92. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +3 -1
  93. data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +1 -1
  94. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
  95. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +6 -1
  96. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +12 -0
  97. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +52 -0
  98. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +45 -0
  99. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +46 -0
  100. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +13 -1
  101. data/lib/google/cloud/discoveryengine/v1beta/project_pb.rb +49 -0
  102. data/lib/google/cloud/discoveryengine/v1beta/project_service_pb.rb +50 -0
  103. data/lib/google/cloud/discoveryengine/v1beta/project_service_services_pb.rb +51 -0
  104. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +49 -0
  105. data/lib/google/cloud/discoveryengine/v1beta/rank_service_services_pb.rb +45 -0
  106. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +7 -1
  107. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +5 -1
  108. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_services_pb.rb +2 -0
  109. data/lib/google/cloud/discoveryengine/v1beta/session_pb.rb +50 -0
  110. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +1 -1
  111. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  112. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +1 -1
  113. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +1 -1
  114. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +362 -0
  115. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +25 -1
  116. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +209 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +126 -0
  118. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +2 -2
  119. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +491 -0
  120. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +75 -0
  121. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +2 -2
  122. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +4 -5
  123. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +9 -6
  124. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +5 -5
  125. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +51 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +144 -0
  127. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +79 -0
  128. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +312 -26
  129. data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +106 -0
  130. data/proto_docs/google/cloud/discoveryengine/v1beta/project_service.rb +57 -0
  131. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +127 -0
  132. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +20 -19
  133. data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +5 -5
  134. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +181 -43
  135. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +47 -1
  136. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +88 -0
  137. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +3 -0
  138. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +25 -4
  139. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +13 -1
  140. metadata +56 -2
@@ -0,0 +1,814 @@
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/errors"
20
+ require "google/cloud/discoveryengine/v1beta/control_service_pb"
21
+ require "google/cloud/discovery_engine/v1beta/control_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module DiscoveryEngine
27
+ module V1beta
28
+ module ControlService
29
+ module Rest
30
+ ##
31
+ # REST client for the ControlService service.
32
+ #
33
+ # Service for performing CRUD operations on Controls.
34
+ # Controls allow for custom logic to be implemented in the serving path.
35
+ # Controls need to be attached to a Serving Config to be considered during a
36
+ # request.
37
+ #
38
+ class Client
39
+ # @private
40
+ API_VERSION = ""
41
+
42
+ # @private
43
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
44
+
45
+ include Paths
46
+
47
+ # @private
48
+ attr_reader :control_service_stub
49
+
50
+ ##
51
+ # Configure the ControlService Client class.
52
+ #
53
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client::Configuration}
54
+ # for a description of the configuration fields.
55
+ #
56
+ # @example
57
+ #
58
+ # # Modify the configuration for all ControlService clients
59
+ # ::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.configure do |config|
60
+ # config.timeout = 10.0
61
+ # end
62
+ #
63
+ # @yield [config] Configure the Client client.
64
+ # @yieldparam config [Client::Configuration]
65
+ #
66
+ # @return [Client::Configuration]
67
+ #
68
+ def self.configure
69
+ @configure ||= begin
70
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
71
+ parent_config = while namespace.any?
72
+ parent_name = namespace.join "::"
73
+ parent_const = const_get parent_name
74
+ break parent_const.configure if parent_const.respond_to? :configure
75
+ namespace.pop
76
+ end
77
+ default_config = Client::Configuration.new parent_config
78
+
79
+ default_config.timeout = 30.0
80
+ default_config.retry_policy = {
81
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
82
+ }
83
+
84
+ default_config
85
+ end
86
+ yield @configure if block_given?
87
+ @configure
88
+ end
89
+
90
+ ##
91
+ # Configure the ControlService Client instance.
92
+ #
93
+ # The configuration is set to the derived mode, meaning that values can be changed,
94
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
95
+ # should be made on {Client.configure}.
96
+ #
97
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client::Configuration}
98
+ # for a description of the configuration fields.
99
+ #
100
+ # @yield [config] Configure the Client client.
101
+ # @yieldparam config [Client::Configuration]
102
+ #
103
+ # @return [Client::Configuration]
104
+ #
105
+ def configure
106
+ yield @config if block_given?
107
+ @config
108
+ end
109
+
110
+ ##
111
+ # The effective universe domain
112
+ #
113
+ # @return [String]
114
+ #
115
+ def universe_domain
116
+ @control_service_stub.universe_domain
117
+ end
118
+
119
+ ##
120
+ # Create a new ControlService REST client object.
121
+ #
122
+ # @example
123
+ #
124
+ # # Create a client using the default configuration
125
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new
126
+ #
127
+ # # Create a client using a custom configuration
128
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new do |config|
129
+ # config.timeout = 10.0
130
+ # end
131
+ #
132
+ # @yield [config] Configure the ControlService client.
133
+ # @yieldparam config [Client::Configuration]
134
+ #
135
+ def initialize
136
+ # Create the configuration object
137
+ @config = Configuration.new Client.configure
138
+
139
+ # Yield the configuration if needed
140
+ yield @config if block_given?
141
+
142
+ # Create credentials
143
+ credentials = @config.credentials
144
+ # Use self-signed JWT if the endpoint is unchanged from default,
145
+ # but only if the default endpoint does not have a region prefix.
146
+ enable_self_signed_jwt = @config.endpoint.nil? ||
147
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
148
+ !@config.endpoint.split(".").first.include?("-"))
149
+ credentials ||= Credentials.default scope: @config.scope,
150
+ enable_self_signed_jwt: enable_self_signed_jwt
151
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
152
+ credentials = Credentials.new credentials, scope: @config.scope
153
+ end
154
+
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @control_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::ServiceStub.new(
159
+ endpoint: @config.endpoint,
160
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
161
+ universe_domain: @config.universe_domain,
162
+ credentials: credentials
163
+ )
164
+
165
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
166
+ config.credentials = credentials
167
+ config.quota_project = @quota_project_id
168
+ config.endpoint = @control_service_stub.endpoint
169
+ config.universe_domain = @control_service_stub.universe_domain
170
+ end
171
+ end
172
+
173
+ ##
174
+ # Get the associated client for mix-in of the Locations.
175
+ #
176
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
177
+ #
178
+ attr_reader :location_client
179
+
180
+ # Service calls
181
+
182
+ ##
183
+ # Creates a Control.
184
+ #
185
+ # By default 1000 controls are allowed for a data store.
186
+ # A request can be submitted to adjust this limit.
187
+ # If the {::Google::Cloud::DiscoveryEngine::V1beta::Control Control} to create
188
+ # already exists, an ALREADY_EXISTS error is returned.
189
+ #
190
+ # @overload create_control(request, options = nil)
191
+ # Pass arguments to `create_control` via a request object, either of type
192
+ # {::Google::Cloud::DiscoveryEngine::V1beta::CreateControlRequest} or an equivalent Hash.
193
+ #
194
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::CreateControlRequest, ::Hash]
195
+ # A request object representing the call parameters. Required. To specify no
196
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
197
+ # @param options [::Gapic::CallOptions, ::Hash]
198
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
199
+ #
200
+ # @overload create_control(parent: nil, control: nil, control_id: nil)
201
+ # Pass arguments to `create_control` via keyword arguments. Note that at
202
+ # least one keyword argument is required. To specify no parameters, or to keep all
203
+ # the default parameter values, pass an empty Hash as a request object (see above).
204
+ #
205
+ # @param parent [::String]
206
+ # Required. Full resource name of parent data store. Format:
207
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}`
208
+ # or
209
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`.
210
+ # @param control [::Google::Cloud::DiscoveryEngine::V1beta::Control, ::Hash]
211
+ # Required. The Control to create.
212
+ # @param control_id [::String]
213
+ # Required. The ID to use for the Control, which will become the final
214
+ # component of the Control's resource name.
215
+ #
216
+ # This value must be within 1-63 characters.
217
+ # Valid characters are /[a-z][0-9]-_/.
218
+ # @yield [result, operation] Access the result along with the TransportOperation object
219
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Control]
220
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
221
+ #
222
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Control]
223
+ #
224
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
225
+ #
226
+ # @example Basic example
227
+ # require "google/cloud/discovery_engine/v1beta"
228
+ #
229
+ # # Create a client object. The client can be reused for multiple calls.
230
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new
231
+ #
232
+ # # Create a request. To set request fields, pass in keyword arguments.
233
+ # request = Google::Cloud::DiscoveryEngine::V1beta::CreateControlRequest.new
234
+ #
235
+ # # Call the create_control method.
236
+ # result = client.create_control request
237
+ #
238
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Control.
239
+ # p result
240
+ #
241
+ def create_control request, options = nil
242
+ raise ::ArgumentError, "request must be provided" if request.nil?
243
+
244
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::CreateControlRequest
245
+
246
+ # Converts hash and nil to an options object
247
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
248
+
249
+ # Customize the options with defaults
250
+ call_metadata = @config.rpcs.create_control.metadata.to_h
251
+
252
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
253
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
254
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
255
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
256
+ transports_version_send: [:rest]
257
+
258
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
259
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
260
+
261
+ options.apply_defaults timeout: @config.rpcs.create_control.timeout,
262
+ metadata: call_metadata,
263
+ retry_policy: @config.rpcs.create_control.retry_policy
264
+
265
+ options.apply_defaults timeout: @config.timeout,
266
+ metadata: @config.metadata,
267
+ retry_policy: @config.retry_policy
268
+
269
+ @control_service_stub.create_control request, options do |result, operation|
270
+ yield result, operation if block_given?
271
+ return result
272
+ end
273
+ rescue ::Gapic::Rest::Error => e
274
+ raise ::Google::Cloud::Error.from_error(e)
275
+ end
276
+
277
+ ##
278
+ # Deletes a Control.
279
+ #
280
+ # If the {::Google::Cloud::DiscoveryEngine::V1beta::Control Control} to delete
281
+ # does not exist, a NOT_FOUND error is returned.
282
+ #
283
+ # @overload delete_control(request, options = nil)
284
+ # Pass arguments to `delete_control` via a request object, either of type
285
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DeleteControlRequest} or an equivalent Hash.
286
+ #
287
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::DeleteControlRequest, ::Hash]
288
+ # A request object representing the call parameters. Required. To specify no
289
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
290
+ # @param options [::Gapic::CallOptions, ::Hash]
291
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
292
+ #
293
+ # @overload delete_control(name: nil)
294
+ # Pass arguments to `delete_control` via keyword arguments. Note that at
295
+ # least one keyword argument is required. To specify no parameters, or to keep all
296
+ # the default parameter values, pass an empty Hash as a request object (see above).
297
+ #
298
+ # @param name [::String]
299
+ # Required. The resource name of the Control to delete. Format:
300
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}`
301
+ # @yield [result, operation] Access the result along with the TransportOperation object
302
+ # @yieldparam result [::Google::Protobuf::Empty]
303
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
304
+ #
305
+ # @return [::Google::Protobuf::Empty]
306
+ #
307
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
308
+ #
309
+ # @example Basic example
310
+ # require "google/cloud/discovery_engine/v1beta"
311
+ #
312
+ # # Create a client object. The client can be reused for multiple calls.
313
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new
314
+ #
315
+ # # Create a request. To set request fields, pass in keyword arguments.
316
+ # request = Google::Cloud::DiscoveryEngine::V1beta::DeleteControlRequest.new
317
+ #
318
+ # # Call the delete_control method.
319
+ # result = client.delete_control request
320
+ #
321
+ # # The returned object is of type Google::Protobuf::Empty.
322
+ # p result
323
+ #
324
+ def delete_control request, options = nil
325
+ raise ::ArgumentError, "request must be provided" if request.nil?
326
+
327
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::DeleteControlRequest
328
+
329
+ # Converts hash and nil to an options object
330
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
331
+
332
+ # Customize the options with defaults
333
+ call_metadata = @config.rpcs.delete_control.metadata.to_h
334
+
335
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
336
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
337
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
338
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
339
+ transports_version_send: [:rest]
340
+
341
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
342
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
343
+
344
+ options.apply_defaults timeout: @config.rpcs.delete_control.timeout,
345
+ metadata: call_metadata,
346
+ retry_policy: @config.rpcs.delete_control.retry_policy
347
+
348
+ options.apply_defaults timeout: @config.timeout,
349
+ metadata: @config.metadata,
350
+ retry_policy: @config.retry_policy
351
+
352
+ @control_service_stub.delete_control request, options do |result, operation|
353
+ yield result, operation if block_given?
354
+ return result
355
+ end
356
+ rescue ::Gapic::Rest::Error => e
357
+ raise ::Google::Cloud::Error.from_error(e)
358
+ end
359
+
360
+ ##
361
+ # Updates a Control.
362
+ #
363
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Control Control} action type cannot
364
+ # be changed. If the {::Google::Cloud::DiscoveryEngine::V1beta::Control Control}
365
+ # to update does not exist, a NOT_FOUND error is returned.
366
+ #
367
+ # @overload update_control(request, options = nil)
368
+ # Pass arguments to `update_control` via a request object, either of type
369
+ # {::Google::Cloud::DiscoveryEngine::V1beta::UpdateControlRequest} or an equivalent Hash.
370
+ #
371
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::UpdateControlRequest, ::Hash]
372
+ # A request object representing the call parameters. Required. To specify no
373
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
374
+ # @param options [::Gapic::CallOptions, ::Hash]
375
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
376
+ #
377
+ # @overload update_control(control: nil, update_mask: nil)
378
+ # Pass arguments to `update_control` via keyword arguments. Note that at
379
+ # least one keyword argument is required. To specify no parameters, or to keep all
380
+ # the default parameter values, pass an empty Hash as a request object (see above).
381
+ #
382
+ # @param control [::Google::Cloud::DiscoveryEngine::V1beta::Control, ::Hash]
383
+ # Required. The Control to update.
384
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
385
+ # Optional. Indicates which fields in the provided
386
+ # {::Google::Cloud::DiscoveryEngine::V1beta::Control Control} to update. The
387
+ # following are NOT supported:
388
+ #
389
+ # * {::Google::Cloud::DiscoveryEngine::V1beta::Control#name Control.name}
390
+ # * {::Google::Cloud::DiscoveryEngine::V1beta::Control#solution_type Control.solution_type}
391
+ #
392
+ # If not set or empty, all supported fields are updated.
393
+ # @yield [result, operation] Access the result along with the TransportOperation object
394
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Control]
395
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
396
+ #
397
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Control]
398
+ #
399
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
400
+ #
401
+ # @example Basic example
402
+ # require "google/cloud/discovery_engine/v1beta"
403
+ #
404
+ # # Create a client object. The client can be reused for multiple calls.
405
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new
406
+ #
407
+ # # Create a request. To set request fields, pass in keyword arguments.
408
+ # request = Google::Cloud::DiscoveryEngine::V1beta::UpdateControlRequest.new
409
+ #
410
+ # # Call the update_control method.
411
+ # result = client.update_control request
412
+ #
413
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Control.
414
+ # p result
415
+ #
416
+ def update_control request, options = nil
417
+ raise ::ArgumentError, "request must be provided" if request.nil?
418
+
419
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::UpdateControlRequest
420
+
421
+ # Converts hash and nil to an options object
422
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
423
+
424
+ # Customize the options with defaults
425
+ call_metadata = @config.rpcs.update_control.metadata.to_h
426
+
427
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
428
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
429
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
430
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
431
+ transports_version_send: [:rest]
432
+
433
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
434
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
435
+
436
+ options.apply_defaults timeout: @config.rpcs.update_control.timeout,
437
+ metadata: call_metadata,
438
+ retry_policy: @config.rpcs.update_control.retry_policy
439
+
440
+ options.apply_defaults timeout: @config.timeout,
441
+ metadata: @config.metadata,
442
+ retry_policy: @config.retry_policy
443
+
444
+ @control_service_stub.update_control request, options do |result, operation|
445
+ yield result, operation if block_given?
446
+ return result
447
+ end
448
+ rescue ::Gapic::Rest::Error => e
449
+ raise ::Google::Cloud::Error.from_error(e)
450
+ end
451
+
452
+ ##
453
+ # Gets a Control.
454
+ #
455
+ # @overload get_control(request, options = nil)
456
+ # Pass arguments to `get_control` via a request object, either of type
457
+ # {::Google::Cloud::DiscoveryEngine::V1beta::GetControlRequest} or an equivalent Hash.
458
+ #
459
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::GetControlRequest, ::Hash]
460
+ # A request object representing the call parameters. Required. To specify no
461
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
462
+ # @param options [::Gapic::CallOptions, ::Hash]
463
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
464
+ #
465
+ # @overload get_control(name: nil)
466
+ # Pass arguments to `get_control` via keyword arguments. Note that at
467
+ # least one keyword argument is required. To specify no parameters, or to keep all
468
+ # the default parameter values, pass an empty Hash as a request object (see above).
469
+ #
470
+ # @param name [::String]
471
+ # Required. The resource name of the Control to get. Format:
472
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}/controls/{control_id}`
473
+ # @yield [result, operation] Access the result along with the TransportOperation object
474
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Control]
475
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
476
+ #
477
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::Control]
478
+ #
479
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
480
+ #
481
+ # @example Basic example
482
+ # require "google/cloud/discovery_engine/v1beta"
483
+ #
484
+ # # Create a client object. The client can be reused for multiple calls.
485
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new
486
+ #
487
+ # # Create a request. To set request fields, pass in keyword arguments.
488
+ # request = Google::Cloud::DiscoveryEngine::V1beta::GetControlRequest.new
489
+ #
490
+ # # Call the get_control method.
491
+ # result = client.get_control request
492
+ #
493
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::Control.
494
+ # p result
495
+ #
496
+ def get_control request, options = nil
497
+ raise ::ArgumentError, "request must be provided" if request.nil?
498
+
499
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GetControlRequest
500
+
501
+ # Converts hash and nil to an options object
502
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
503
+
504
+ # Customize the options with defaults
505
+ call_metadata = @config.rpcs.get_control.metadata.to_h
506
+
507
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
508
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
509
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
510
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
511
+ transports_version_send: [:rest]
512
+
513
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
514
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
515
+
516
+ options.apply_defaults timeout: @config.rpcs.get_control.timeout,
517
+ metadata: call_metadata,
518
+ retry_policy: @config.rpcs.get_control.retry_policy
519
+
520
+ options.apply_defaults timeout: @config.timeout,
521
+ metadata: @config.metadata,
522
+ retry_policy: @config.retry_policy
523
+
524
+ @control_service_stub.get_control request, options do |result, operation|
525
+ yield result, operation if block_given?
526
+ return result
527
+ end
528
+ rescue ::Gapic::Rest::Error => e
529
+ raise ::Google::Cloud::Error.from_error(e)
530
+ end
531
+
532
+ ##
533
+ # Lists all Controls by their parent
534
+ # {::Google::Cloud::DiscoveryEngine::V1beta::DataStore DataStore}.
535
+ #
536
+ # @overload list_controls(request, options = nil)
537
+ # Pass arguments to `list_controls` via a request object, either of type
538
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListControlsRequest} or an equivalent Hash.
539
+ #
540
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListControlsRequest, ::Hash]
541
+ # A request object representing the call parameters. Required. To specify no
542
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
543
+ # @param options [::Gapic::CallOptions, ::Hash]
544
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
545
+ #
546
+ # @overload list_controls(parent: nil, page_size: nil, page_token: nil, filter: nil)
547
+ # Pass arguments to `list_controls` via keyword arguments. Note that at
548
+ # least one keyword argument is required. To specify no parameters, or to keep all
549
+ # the default parameter values, pass an empty Hash as a request object (see above).
550
+ #
551
+ # @param parent [::String]
552
+ # Required. The data store resource name. Format:
553
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/dataStores/{data_store_id}`
554
+ # or
555
+ # `projects/{project_number}/locations/{location_id}/collections/{collection_id}/engines/{engine_id}`.
556
+ # @param page_size [::Integer]
557
+ # Optional. Maximum number of results to return. If unspecified, defaults
558
+ # to 50. Max allowed value is 1000.
559
+ # @param page_token [::String]
560
+ # Optional. A page token, received from a previous `ListControls` call.
561
+ # Provide this to retrieve the subsequent page.
562
+ # @param filter [::String]
563
+ # Optional. A filter to apply on the list results. Supported features:
564
+ #
565
+ # * List all the products under the parent branch if
566
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListControlsRequest#filter filter} is
567
+ # unset. Currently this field is unsupported.
568
+ # @yield [result, operation] Access the result along with the TransportOperation object
569
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Control>]
570
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
571
+ #
572
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1beta::Control>]
573
+ #
574
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
575
+ #
576
+ # @example Basic example
577
+ # require "google/cloud/discovery_engine/v1beta"
578
+ #
579
+ # # Create a client object. The client can be reused for multiple calls.
580
+ # client = Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new
581
+ #
582
+ # # Create a request. To set request fields, pass in keyword arguments.
583
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ListControlsRequest.new
584
+ #
585
+ # # Call the list_controls method.
586
+ # result = client.list_controls request
587
+ #
588
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
589
+ # # over elements, and API calls will be issued to fetch pages as needed.
590
+ # result.each do |item|
591
+ # # Each element is of type ::Google::Cloud::DiscoveryEngine::V1beta::Control.
592
+ # p item
593
+ # end
594
+ #
595
+ def list_controls request, options = nil
596
+ raise ::ArgumentError, "request must be provided" if request.nil?
597
+
598
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListControlsRequest
599
+
600
+ # Converts hash and nil to an options object
601
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
602
+
603
+ # Customize the options with defaults
604
+ call_metadata = @config.rpcs.list_controls.metadata.to_h
605
+
606
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
607
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
608
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
609
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
610
+ transports_version_send: [:rest]
611
+
612
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
613
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
614
+
615
+ options.apply_defaults timeout: @config.rpcs.list_controls.timeout,
616
+ metadata: call_metadata,
617
+ retry_policy: @config.rpcs.list_controls.retry_policy
618
+
619
+ options.apply_defaults timeout: @config.timeout,
620
+ metadata: @config.metadata,
621
+ retry_policy: @config.retry_policy
622
+
623
+ @control_service_stub.list_controls request, options do |result, operation|
624
+ result = ::Gapic::Rest::PagedEnumerable.new @control_service_stub, :list_controls, "controls", request, result, options
625
+ yield result, operation if block_given?
626
+ return result
627
+ end
628
+ rescue ::Gapic::Rest::Error => e
629
+ raise ::Google::Cloud::Error.from_error(e)
630
+ end
631
+
632
+ ##
633
+ # Configuration class for the ControlService REST API.
634
+ #
635
+ # This class represents the configuration for ControlService REST,
636
+ # providing control over timeouts, retry behavior, logging, transport
637
+ # parameters, and other low-level controls. Certain parameters can also be
638
+ # applied individually to specific RPCs. See
639
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client::Configuration::Rpcs}
640
+ # for a list of RPCs that can be configured independently.
641
+ #
642
+ # Configuration can be applied globally to all clients, or to a single client
643
+ # on construction.
644
+ #
645
+ # @example
646
+ #
647
+ # # Modify the global config, setting the timeout for
648
+ # # create_control to 20 seconds,
649
+ # # and all remaining timeouts to 10 seconds.
650
+ # ::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.configure do |config|
651
+ # config.timeout = 10.0
652
+ # config.rpcs.create_control.timeout = 20.0
653
+ # end
654
+ #
655
+ # # Apply the above configuration only to a new client.
656
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::ControlService::Rest::Client.new do |config|
657
+ # config.timeout = 10.0
658
+ # config.rpcs.create_control.timeout = 20.0
659
+ # end
660
+ #
661
+ # @!attribute [rw] endpoint
662
+ # A custom service endpoint, as a hostname or hostname:port. The default is
663
+ # nil, indicating to use the default endpoint in the current universe domain.
664
+ # @return [::String,nil]
665
+ # @!attribute [rw] credentials
666
+ # Credentials to send with calls. You may provide any of the following types:
667
+ # * (`String`) The path to a service account key file in JSON format
668
+ # * (`Hash`) A service account key as a Hash
669
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
670
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
671
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
672
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
673
+ # * (`nil`) indicating no credentials
674
+ # @return [::Object]
675
+ # @!attribute [rw] scope
676
+ # The OAuth scopes
677
+ # @return [::Array<::String>]
678
+ # @!attribute [rw] lib_name
679
+ # The library name as recorded in instrumentation and logging
680
+ # @return [::String]
681
+ # @!attribute [rw] lib_version
682
+ # The library version as recorded in instrumentation and logging
683
+ # @return [::String]
684
+ # @!attribute [rw] timeout
685
+ # The call timeout in seconds.
686
+ # @return [::Numeric]
687
+ # @!attribute [rw] metadata
688
+ # Additional headers to be sent with the call.
689
+ # @return [::Hash{::Symbol=>::String}]
690
+ # @!attribute [rw] retry_policy
691
+ # The retry policy. The value is a hash with the following keys:
692
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
693
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
694
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
695
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
696
+ # trigger a retry.
697
+ # @return [::Hash]
698
+ # @!attribute [rw] quota_project
699
+ # A separate project against which to charge quota.
700
+ # @return [::String]
701
+ # @!attribute [rw] universe_domain
702
+ # The universe domain within which to make requests. This determines the
703
+ # default endpoint URL. The default value of nil uses the environment
704
+ # universe (usually the default "googleapis.com" universe).
705
+ # @return [::String,nil]
706
+ #
707
+ class Configuration
708
+ extend ::Gapic::Config
709
+
710
+ # @private
711
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
712
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
713
+
714
+ config_attr :endpoint, nil, ::String, nil
715
+ config_attr :credentials, nil do |value|
716
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
717
+ allowed.any? { |klass| klass === value }
718
+ end
719
+ config_attr :scope, nil, ::String, ::Array, nil
720
+ config_attr :lib_name, nil, ::String, nil
721
+ config_attr :lib_version, nil, ::String, nil
722
+ config_attr :timeout, nil, ::Numeric, nil
723
+ config_attr :metadata, nil, ::Hash, nil
724
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
725
+ config_attr :quota_project, nil, ::String, nil
726
+ config_attr :universe_domain, nil, ::String, nil
727
+
728
+ # @private
729
+ def initialize parent_config = nil
730
+ @parent_config = parent_config unless parent_config.nil?
731
+
732
+ yield self if block_given?
733
+ end
734
+
735
+ ##
736
+ # Configurations for individual RPCs
737
+ # @return [Rpcs]
738
+ #
739
+ def rpcs
740
+ @rpcs ||= begin
741
+ parent_rpcs = nil
742
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
743
+ Rpcs.new parent_rpcs
744
+ end
745
+ end
746
+
747
+ ##
748
+ # Configuration RPC class for the ControlService API.
749
+ #
750
+ # Includes fields providing the configuration for each RPC in this service.
751
+ # Each configuration object is of type `Gapic::Config::Method` and includes
752
+ # the following configuration fields:
753
+ #
754
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
755
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
756
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
757
+ # include the following keys:
758
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
759
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
760
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
761
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
762
+ # trigger a retry.
763
+ #
764
+ class Rpcs
765
+ ##
766
+ # RPC-specific configuration for `create_control`
767
+ # @return [::Gapic::Config::Method]
768
+ #
769
+ attr_reader :create_control
770
+ ##
771
+ # RPC-specific configuration for `delete_control`
772
+ # @return [::Gapic::Config::Method]
773
+ #
774
+ attr_reader :delete_control
775
+ ##
776
+ # RPC-specific configuration for `update_control`
777
+ # @return [::Gapic::Config::Method]
778
+ #
779
+ attr_reader :update_control
780
+ ##
781
+ # RPC-specific configuration for `get_control`
782
+ # @return [::Gapic::Config::Method]
783
+ #
784
+ attr_reader :get_control
785
+ ##
786
+ # RPC-specific configuration for `list_controls`
787
+ # @return [::Gapic::Config::Method]
788
+ #
789
+ attr_reader :list_controls
790
+
791
+ # @private
792
+ def initialize parent_rpcs = nil
793
+ create_control_config = parent_rpcs.create_control if parent_rpcs.respond_to? :create_control
794
+ @create_control = ::Gapic::Config::Method.new create_control_config
795
+ delete_control_config = parent_rpcs.delete_control if parent_rpcs.respond_to? :delete_control
796
+ @delete_control = ::Gapic::Config::Method.new delete_control_config
797
+ update_control_config = parent_rpcs.update_control if parent_rpcs.respond_to? :update_control
798
+ @update_control = ::Gapic::Config::Method.new update_control_config
799
+ get_control_config = parent_rpcs.get_control if parent_rpcs.respond_to? :get_control
800
+ @get_control = ::Gapic::Config::Method.new get_control_config
801
+ list_controls_config = parent_rpcs.list_controls if parent_rpcs.respond_to? :list_controls
802
+ @list_controls = ::Gapic::Config::Method.new list_controls_config
803
+
804
+ yield self if block_given?
805
+ end
806
+ end
807
+ end
808
+ end
809
+ end
810
+ end
811
+ end
812
+ end
813
+ end
814
+ end