google-cloud-ces-v1 0.a → 0.1.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 (137) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/ces/v1/agent_pb.rb +30 -0
  6. data/lib/google/cloud/ces/v1/agent_service/client.rb +5315 -0
  7. data/lib/google/cloud/ces/v1/agent_service/credentials.rb +48 -0
  8. data/lib/google/cloud/ces/v1/agent_service/operations.rb +841 -0
  9. data/lib/google/cloud/ces/v1/agent_service/paths.rb +424 -0
  10. data/lib/google/cloud/ces/v1/agent_service/rest/client.rb +4944 -0
  11. data/lib/google/cloud/ces/v1/agent_service/rest/operations.rb +925 -0
  12. data/lib/google/cloud/ces/v1/agent_service/rest/service_stub.rb +3028 -0
  13. data/lib/google/cloud/ces/v1/agent_service/rest.rb +55 -0
  14. data/lib/google/cloud/ces/v1/agent_service.rb +57 -0
  15. data/lib/google/cloud/ces/v1/agent_service_pb.rb +105 -0
  16. data/lib/google/cloud/ces/v1/agent_service_services_pb.rb +142 -0
  17. data/lib/google/cloud/ces/v1/agent_tool_pb.rb +24 -0
  18. data/lib/google/cloud/ces/v1/agent_transfers_pb.rb +29 -0
  19. data/lib/google/cloud/ces/v1/app_pb.rb +58 -0
  20. data/lib/google/cloud/ces/v1/app_version_pb.rb +32 -0
  21. data/lib/google/cloud/ces/v1/auth_pb.rb +34 -0
  22. data/lib/google/cloud/ces/v1/bigquery_export_pb.rb +23 -0
  23. data/lib/google/cloud/ces/v1/bindings_override.rb +75 -0
  24. data/lib/google/cloud/ces/v1/changelog_pb.rb +26 -0
  25. data/lib/google/cloud/ces/v1/client_function_pb.rb +24 -0
  26. data/lib/google/cloud/ces/v1/common_pb.rb +46 -0
  27. data/lib/google/cloud/ces/v1/connector_tool_pb.rb +27 -0
  28. data/lib/google/cloud/ces/v1/connector_toolset_pb.rb +25 -0
  29. data/lib/google/cloud/ces/v1/conversation_pb.rb +31 -0
  30. data/lib/google/cloud/ces/v1/data_store_pb.rb +27 -0
  31. data/lib/google/cloud/ces/v1/data_store_tool_pb.rb +40 -0
  32. data/lib/google/cloud/ces/v1/deployment_pb.rb +26 -0
  33. data/lib/google/cloud/ces/v1/example_pb.rb +34 -0
  34. data/lib/google/cloud/ces/v1/fakes_pb.rb +24 -0
  35. data/lib/google/cloud/ces/v1/file_search_tool_pb.rb +24 -0
  36. data/lib/google/cloud/ces/v1/google_search_tool_pb.rb +24 -0
  37. data/lib/google/cloud/ces/v1/guardrail_pb.rb +37 -0
  38. data/lib/google/cloud/ces/v1/mcp_tool_pb.rb +26 -0
  39. data/lib/google/cloud/ces/v1/mcp_toolset_pb.rb +25 -0
  40. data/lib/google/cloud/ces/v1/omnichannel_pb.rb +31 -0
  41. data/lib/google/cloud/ces/v1/omnichannel_service_pb.rb +27 -0
  42. data/lib/google/cloud/ces/v1/open_api_tool_pb.rb +25 -0
  43. data/lib/google/cloud/ces/v1/open_api_toolset_pb.rb +25 -0
  44. data/lib/google/cloud/ces/v1/python_function_pb.rb +23 -0
  45. data/lib/google/cloud/ces/v1/rest.rb +41 -0
  46. data/lib/google/cloud/ces/v1/schema_pb.rb +25 -0
  47. data/lib/google/cloud/ces/v1/search_suggestions_pb.rb +22 -0
  48. data/lib/google/cloud/ces/v1/security_settings_pb.rb +27 -0
  49. data/lib/google/cloud/ces/v1/session_service/client.rb +759 -0
  50. data/lib/google/cloud/ces/v1/session_service/credentials.rb +48 -0
  51. data/lib/google/cloud/ces/v1/session_service/paths.rb +117 -0
  52. data/lib/google/cloud/ces/v1/session_service/rest/client.rb +560 -0
  53. data/lib/google/cloud/ces/v1/session_service/rest/service_stub.rb +199 -0
  54. data/lib/google/cloud/ces/v1/session_service/rest.rb +53 -0
  55. data/lib/google/cloud/ces/v1/session_service.rb +55 -0
  56. data/lib/google/cloud/ces/v1/session_service_pb.rb +50 -0
  57. data/lib/google/cloud/ces/v1/session_service_services_pb.rb +119 -0
  58. data/lib/google/cloud/ces/v1/system_tool_pb.rb +23 -0
  59. data/lib/google/cloud/ces/v1/tool_pb.rb +38 -0
  60. data/lib/google/cloud/ces/v1/tool_service/client.rb +723 -0
  61. data/lib/google/cloud/ces/v1/tool_service/credentials.rb +48 -0
  62. data/lib/google/cloud/ces/v1/tool_service/paths.rb +94 -0
  63. data/lib/google/cloud/ces/v1/tool_service/rest/client.rb +667 -0
  64. data/lib/google/cloud/ces/v1/tool_service/rest/service_stub.rb +267 -0
  65. data/lib/google/cloud/ces/v1/tool_service/rest.rb +53 -0
  66. data/lib/google/cloud/ces/v1/tool_service.rb +55 -0
  67. data/lib/google/cloud/ces/v1/tool_service_pb.rb +35 -0
  68. data/lib/google/cloud/ces/v1/tool_service_services_pb.rb +50 -0
  69. data/lib/google/cloud/ces/v1/toolset_pb.rb +30 -0
  70. data/lib/google/cloud/ces/v1/toolset_tool_pb.rb +24 -0
  71. data/lib/google/cloud/ces/v1/version.rb +7 -2
  72. data/lib/google/cloud/ces/v1/widget_service/client.rb +501 -0
  73. data/lib/google/cloud/ces/v1/widget_service/credentials.rb +48 -0
  74. data/lib/google/cloud/ces/v1/widget_service/paths.rb +75 -0
  75. data/lib/google/cloud/ces/v1/widget_service/rest/client.rb +459 -0
  76. data/lib/google/cloud/ces/v1/widget_service/rest/service_stub.rb +143 -0
  77. data/lib/google/cloud/ces/v1/widget_service/rest.rb +53 -0
  78. data/lib/google/cloud/ces/v1/widget_service.rb +55 -0
  79. data/lib/google/cloud/ces/v1/widget_service_pb.rb +28 -0
  80. data/lib/google/cloud/ces/v1/widget_service_services_pb.rb +46 -0
  81. data/lib/google/cloud/ces/v1/widget_tool_pb.rb +29 -0
  82. data/lib/google/cloud/ces/v1.rb +48 -0
  83. data/lib/google-cloud-ces-v1.rb +21 -0
  84. data/proto_docs/README.md +4 -0
  85. data/proto_docs/google/api/client.rb +593 -0
  86. data/proto_docs/google/api/field_behavior.rb +85 -0
  87. data/proto_docs/google/api/launch_stage.rb +71 -0
  88. data/proto_docs/google/api/resource.rb +227 -0
  89. data/proto_docs/google/cloud/ces/v1/agent.rb +224 -0
  90. data/proto_docs/google/cloud/ces/v1/agent_service.rb +1250 -0
  91. data/proto_docs/google/cloud/ces/v1/agent_tool.rb +42 -0
  92. data/proto_docs/google/cloud/ces/v1/agent_transfers.rb +111 -0
  93. data/proto_docs/google/cloud/ces/v1/app.rb +685 -0
  94. data/proto_docs/google/cloud/ces/v1/app_version.rb +83 -0
  95. data/proto_docs/google/cloud/ces/v1/auth.rb +214 -0
  96. data/proto_docs/google/cloud/ces/v1/bigquery_export.rb +45 -0
  97. data/proto_docs/google/cloud/ces/v1/changelog.rb +73 -0
  98. data/proto_docs/google/cloud/ces/v1/client_function.rb +48 -0
  99. data/proto_docs/google/cloud/ces/v1/common.rb +375 -0
  100. data/proto_docs/google/cloud/ces/v1/connector_tool.rb +122 -0
  101. data/proto_docs/google/cloud/ces/v1/connector_toolset.rb +52 -0
  102. data/proto_docs/google/cloud/ces/v1/conversation.rb +152 -0
  103. data/proto_docs/google/cloud/ces/v1/data_store.rb +102 -0
  104. data/proto_docs/google/cloud/ces/v1/data_store_tool.rb +328 -0
  105. data/proto_docs/google/cloud/ces/v1/deployment.rb +62 -0
  106. data/proto_docs/google/cloud/ces/v1/example.rb +244 -0
  107. data/proto_docs/google/cloud/ces/v1/fakes.rb +55 -0
  108. data/proto_docs/google/cloud/ces/v1/file_search_tool.rb +60 -0
  109. data/proto_docs/google/cloud/ces/v1/google_search_tool.rb +76 -0
  110. data/proto_docs/google/cloud/ces/v1/guardrail.rb +324 -0
  111. data/proto_docs/google/cloud/ces/v1/mcp_tool.rb +85 -0
  112. data/proto_docs/google/cloud/ces/v1/mcp_toolset.rb +71 -0
  113. data/proto_docs/google/cloud/ces/v1/omnichannel.rb +163 -0
  114. data/proto_docs/google/cloud/ces/v1/omnichannel_service.rb +45 -0
  115. data/proto_docs/google/cloud/ces/v1/open_api_tool.rb +66 -0
  116. data/proto_docs/google/cloud/ces/v1/open_api_toolset.rb +57 -0
  117. data/proto_docs/google/cloud/ces/v1/python_function.rb +44 -0
  118. data/proto_docs/google/cloud/ces/v1/schema.rb +162 -0
  119. data/proto_docs/google/cloud/ces/v1/search_suggestions.rb +55 -0
  120. data/proto_docs/google/cloud/ces/v1/security_settings.rb +80 -0
  121. data/proto_docs/google/cloud/ces/v1/session_service.rb +464 -0
  122. data/proto_docs/google/cloud/ces/v1/system_tool.rb +38 -0
  123. data/proto_docs/google/cloud/ces/v1/tool.rb +126 -0
  124. data/proto_docs/google/cloud/ces/v1/tool_service.rb +168 -0
  125. data/proto_docs/google/cloud/ces/v1/toolset.rb +80 -0
  126. data/proto_docs/google/cloud/ces/v1/toolset_tool.rb +40 -0
  127. data/proto_docs/google/cloud/ces/v1/widget_service.rb +62 -0
  128. data/proto_docs/google/cloud/ces/v1/widget_tool.rb +146 -0
  129. data/proto_docs/google/longrunning/operations.rb +191 -0
  130. data/proto_docs/google/protobuf/any.rb +145 -0
  131. data/proto_docs/google/protobuf/duration.rb +98 -0
  132. data/proto_docs/google/protobuf/empty.rb +34 -0
  133. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  134. data/proto_docs/google/protobuf/struct.rb +108 -0
  135. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  136. data/proto_docs/google/rpc/status.rb +48 -0
  137. metadata +183 -9
@@ -0,0 +1,723 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/ces/v1/tool_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Ces
26
+ module V1
27
+ module ToolService
28
+ ##
29
+ # Client for the ToolService service.
30
+ #
31
+ # Tool service provides APIs for interacting with CES tools.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "ces.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :tool_service_stub
44
+
45
+ ##
46
+ # Configure the ToolService Client class.
47
+ #
48
+ # See {::Google::Cloud::Ces::V1::ToolService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all ToolService clients
54
+ # ::Google::Cloud::Ces::V1::ToolService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Ces", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.timeout = 60.0
75
+ default_config.retry_policy = {
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the ToolService Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Cloud::Ces::V1::ToolService::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @tool_service_stub.universe_domain
112
+ end
113
+
114
+ ##
115
+ # Create a new ToolService client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::Ces::V1::ToolService::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::Ces::V1::ToolService::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the ToolService client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/cloud/ces/v1/tool_service_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @tool_service_stub = ::Gapic::ServiceStub.new(
159
+ ::Google::Cloud::Ces::V1::ToolService::Stub,
160
+ credentials: credentials,
161
+ endpoint: @config.endpoint,
162
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
+ universe_domain: @config.universe_domain,
164
+ channel_args: @config.channel_args,
165
+ interceptors: @config.interceptors,
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
168
+ )
169
+
170
+ @tool_service_stub.stub_logger&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+
180
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
181
+ config.credentials = credentials
182
+ config.quota_project = @quota_project_id
183
+ config.endpoint = @tool_service_stub.endpoint
184
+ config.universe_domain = @tool_service_stub.universe_domain
185
+ config.logger = @tool_service_stub.logger if config.respond_to? :logger=
186
+ end
187
+ end
188
+
189
+ ##
190
+ # Get the associated client for mix-in of the Locations.
191
+ #
192
+ # @return [Google::Cloud::Location::Locations::Client]
193
+ #
194
+ attr_reader :location_client
195
+
196
+ ##
197
+ # The logger used for request/response debug logging.
198
+ #
199
+ # @return [Logger]
200
+ #
201
+ def logger
202
+ @tool_service_stub.logger
203
+ end
204
+
205
+ # Service calls
206
+
207
+ ##
208
+ # Executes the given tool with the given arguments.
209
+ #
210
+ # @overload execute_tool(request, options = nil)
211
+ # Pass arguments to `execute_tool` via a request object, either of type
212
+ # {::Google::Cloud::Ces::V1::ExecuteToolRequest} or an equivalent Hash.
213
+ #
214
+ # @param request [::Google::Cloud::Ces::V1::ExecuteToolRequest, ::Hash]
215
+ # A request object representing the call parameters. Required. To specify no
216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
217
+ # @param options [::Gapic::CallOptions, ::Hash]
218
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
219
+ #
220
+ # @overload execute_tool(tool: nil, toolset_tool: nil, variables: nil, context: nil, parent: nil, args: nil)
221
+ # Pass arguments to `execute_tool` via keyword arguments. Note that at
222
+ # least one keyword argument is required. To specify no parameters, or to keep all
223
+ # the default parameter values, pass an empty Hash as a request object (see above).
224
+ #
225
+ # @param tool [::String]
226
+ # Optional. The name of the tool to execute.
227
+ # Format:
228
+ # projects/\\{project}/locations/\\{location}/apps/\\{app}/tools/\\{tool}
229
+ #
230
+ # Note: The following parameters are mutually exclusive: `tool`, `toolset_tool`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
231
+ # @param toolset_tool [::Google::Cloud::Ces::V1::ToolsetTool, ::Hash]
232
+ # Optional. The toolset tool to execute. Only one tool should match the
233
+ # predicate from the toolset. Otherwise, an error will be returned.
234
+ #
235
+ # Note: The following parameters are mutually exclusive: `toolset_tool`, `tool`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
236
+ # @param variables [::Google::Protobuf::Struct, ::Hash]
237
+ # Optional. The variables that are available for the tool execution.
238
+ #
239
+ # Note: The following parameters are mutually exclusive: `variables`, `context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
240
+ # @param context [::Google::Protobuf::Struct, ::Hash]
241
+ # Optional. The
242
+ # [ToolCallContext](https://docs.cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool/python#environment
243
+ # for details) to be passed to the Python tool.
244
+ #
245
+ # Note: The following parameters are mutually exclusive: `context`, `variables`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
246
+ # @param parent [::String]
247
+ # Required. The resource name of the app which the tool/toolset belongs to.
248
+ # Format: `projects/{project}/locations/{location}/apps/{app}`
249
+ # @param args [::Google::Protobuf::Struct, ::Hash]
250
+ # Optional. The input parameters and values for the tool in JSON object
251
+ # format.
252
+ #
253
+ # @yield [response, operation] Access the result along with the RPC operation
254
+ # @yieldparam response [::Google::Cloud::Ces::V1::ExecuteToolResponse]
255
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
256
+ #
257
+ # @return [::Google::Cloud::Ces::V1::ExecuteToolResponse]
258
+ #
259
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
260
+ #
261
+ # @example Basic example
262
+ # require "google/cloud/ces/v1"
263
+ #
264
+ # # Create a client object. The client can be reused for multiple calls.
265
+ # client = Google::Cloud::Ces::V1::ToolService::Client.new
266
+ #
267
+ # # Create a request. To set request fields, pass in keyword arguments.
268
+ # request = Google::Cloud::Ces::V1::ExecuteToolRequest.new
269
+ #
270
+ # # Call the execute_tool method.
271
+ # result = client.execute_tool request
272
+ #
273
+ # # The returned object is of type Google::Cloud::Ces::V1::ExecuteToolResponse.
274
+ # p result
275
+ #
276
+ def execute_tool request, options = nil
277
+ raise ::ArgumentError, "request must be provided" if request.nil?
278
+
279
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1::ExecuteToolRequest
280
+
281
+ # Converts hash and nil to an options object
282
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
283
+
284
+ # Customize the options with defaults
285
+ metadata = @config.rpcs.execute_tool.metadata.to_h
286
+
287
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
288
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
289
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
290
+ gapic_version: ::Google::Cloud::Ces::V1::VERSION
291
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
292
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
293
+
294
+ header_params = {}
295
+ if request.parent
296
+ header_params["parent"] = request.parent
297
+ end
298
+
299
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
300
+ metadata[:"x-goog-request-params"] ||= request_params_header
301
+
302
+ options.apply_defaults timeout: @config.rpcs.execute_tool.timeout,
303
+ metadata: metadata,
304
+ retry_policy: @config.rpcs.execute_tool.retry_policy
305
+
306
+ options.apply_defaults timeout: @config.timeout,
307
+ metadata: @config.metadata,
308
+ retry_policy: @config.retry_policy
309
+
310
+ @tool_service_stub.call_rpc :execute_tool, request, options: options do |response, operation|
311
+ yield response, operation if block_given?
312
+ end
313
+ rescue ::GRPC::BadStatus => e
314
+ raise ::Google::Cloud::Error.from_error(e)
315
+ end
316
+
317
+ ##
318
+ # Retrieve the schema of the given tool. The schema is computed on the fly
319
+ # for the given instance of the tool.
320
+ #
321
+ # @overload retrieve_tool_schema(request, options = nil)
322
+ # Pass arguments to `retrieve_tool_schema` via a request object, either of type
323
+ # {::Google::Cloud::Ces::V1::RetrieveToolSchemaRequest} or an equivalent Hash.
324
+ #
325
+ # @param request [::Google::Cloud::Ces::V1::RetrieveToolSchemaRequest, ::Hash]
326
+ # A request object representing the call parameters. Required. To specify no
327
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
328
+ # @param options [::Gapic::CallOptions, ::Hash]
329
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
330
+ #
331
+ # @overload retrieve_tool_schema(tool: nil, toolset_tool: nil, parent: nil)
332
+ # Pass arguments to `retrieve_tool_schema` via keyword arguments. Note that at
333
+ # least one keyword argument is required. To specify no parameters, or to keep all
334
+ # the default parameter values, pass an empty Hash as a request object (see above).
335
+ #
336
+ # @param tool [::String]
337
+ # Optional. The name of the tool to retrieve the schema for.
338
+ # Format:
339
+ # projects/\\{project}/locations/\\{location}/apps/\\{app}/tools/\\{tool}
340
+ #
341
+ # Note: The following parameters are mutually exclusive: `tool`, `toolset_tool`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
342
+ # @param toolset_tool [::Google::Cloud::Ces::V1::ToolsetTool, ::Hash]
343
+ # Optional. The toolset tool to retrieve the schema for. Only one tool
344
+ # should match the predicate from the toolset. Otherwise, an error will be
345
+ # returned.
346
+ #
347
+ # Note: The following parameters are mutually exclusive: `toolset_tool`, `tool`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
348
+ # @param parent [::String]
349
+ # Required. The resource name of the app which the tool/toolset belongs to.
350
+ # Format: `projects/{project}/locations/{location}/apps/{app}`
351
+ #
352
+ # @yield [response, operation] Access the result along with the RPC operation
353
+ # @yieldparam response [::Google::Cloud::Ces::V1::RetrieveToolSchemaResponse]
354
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
355
+ #
356
+ # @return [::Google::Cloud::Ces::V1::RetrieveToolSchemaResponse]
357
+ #
358
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
359
+ #
360
+ # @example Basic example
361
+ # require "google/cloud/ces/v1"
362
+ #
363
+ # # Create a client object. The client can be reused for multiple calls.
364
+ # client = Google::Cloud::Ces::V1::ToolService::Client.new
365
+ #
366
+ # # Create a request. To set request fields, pass in keyword arguments.
367
+ # request = Google::Cloud::Ces::V1::RetrieveToolSchemaRequest.new
368
+ #
369
+ # # Call the retrieve_tool_schema method.
370
+ # result = client.retrieve_tool_schema request
371
+ #
372
+ # # The returned object is of type Google::Cloud::Ces::V1::RetrieveToolSchemaResponse.
373
+ # p result
374
+ #
375
+ def retrieve_tool_schema request, options = nil
376
+ raise ::ArgumentError, "request must be provided" if request.nil?
377
+
378
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1::RetrieveToolSchemaRequest
379
+
380
+ # Converts hash and nil to an options object
381
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
382
+
383
+ # Customize the options with defaults
384
+ metadata = @config.rpcs.retrieve_tool_schema.metadata.to_h
385
+
386
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
387
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
388
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
389
+ gapic_version: ::Google::Cloud::Ces::V1::VERSION
390
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
391
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
392
+
393
+ header_params = {}
394
+ if request.parent
395
+ header_params["parent"] = request.parent
396
+ end
397
+
398
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
399
+ metadata[:"x-goog-request-params"] ||= request_params_header
400
+
401
+ options.apply_defaults timeout: @config.rpcs.retrieve_tool_schema.timeout,
402
+ metadata: metadata,
403
+ retry_policy: @config.rpcs.retrieve_tool_schema.retry_policy
404
+
405
+ options.apply_defaults timeout: @config.timeout,
406
+ metadata: @config.metadata,
407
+ retry_policy: @config.retry_policy
408
+
409
+ @tool_service_stub.call_rpc :retrieve_tool_schema, request, options: options do |response, operation|
410
+ yield response, operation if block_given?
411
+ end
412
+ rescue ::GRPC::BadStatus => e
413
+ raise ::Google::Cloud::Error.from_error(e)
414
+ end
415
+
416
+ ##
417
+ # Retrieve the list of tools included in the specified toolset.
418
+ #
419
+ # @overload retrieve_tools(request, options = nil)
420
+ # Pass arguments to `retrieve_tools` via a request object, either of type
421
+ # {::Google::Cloud::Ces::V1::RetrieveToolsRequest} or an equivalent Hash.
422
+ #
423
+ # @param request [::Google::Cloud::Ces::V1::RetrieveToolsRequest, ::Hash]
424
+ # A request object representing the call parameters. Required. To specify no
425
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
426
+ # @param options [::Gapic::CallOptions, ::Hash]
427
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
428
+ #
429
+ # @overload retrieve_tools(toolset: nil, tool_ids: nil)
430
+ # Pass arguments to `retrieve_tools` via keyword arguments. Note that at
431
+ # least one keyword argument is required. To specify no parameters, or to keep all
432
+ # the default parameter values, pass an empty Hash as a request object (see above).
433
+ #
434
+ # @param toolset [::String]
435
+ # Required. The name of the toolset to retrieve the tools for.
436
+ # Format:
437
+ # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
438
+ # @param tool_ids [::Array<::String>]
439
+ # Optional. The identifiers of the tools to retrieve from the toolset.
440
+ # If empty, all tools in the toolset will be returned.
441
+ #
442
+ # @yield [response, operation] Access the result along with the RPC operation
443
+ # @yieldparam response [::Google::Cloud::Ces::V1::RetrieveToolsResponse]
444
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
445
+ #
446
+ # @return [::Google::Cloud::Ces::V1::RetrieveToolsResponse]
447
+ #
448
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
449
+ #
450
+ # @example Basic example
451
+ # require "google/cloud/ces/v1"
452
+ #
453
+ # # Create a client object. The client can be reused for multiple calls.
454
+ # client = Google::Cloud::Ces::V1::ToolService::Client.new
455
+ #
456
+ # # Create a request. To set request fields, pass in keyword arguments.
457
+ # request = Google::Cloud::Ces::V1::RetrieveToolsRequest.new
458
+ #
459
+ # # Call the retrieve_tools method.
460
+ # result = client.retrieve_tools request
461
+ #
462
+ # # The returned object is of type Google::Cloud::Ces::V1::RetrieveToolsResponse.
463
+ # p result
464
+ #
465
+ def retrieve_tools request, options = nil
466
+ raise ::ArgumentError, "request must be provided" if request.nil?
467
+
468
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1::RetrieveToolsRequest
469
+
470
+ # Converts hash and nil to an options object
471
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
472
+
473
+ # Customize the options with defaults
474
+ metadata = @config.rpcs.retrieve_tools.metadata.to_h
475
+
476
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
477
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
478
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
479
+ gapic_version: ::Google::Cloud::Ces::V1::VERSION
480
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
481
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
482
+
483
+ header_params = {}
484
+ if request.toolset
485
+ header_params["toolset"] = request.toolset
486
+ end
487
+
488
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
489
+ metadata[:"x-goog-request-params"] ||= request_params_header
490
+
491
+ options.apply_defaults timeout: @config.rpcs.retrieve_tools.timeout,
492
+ metadata: metadata,
493
+ retry_policy: @config.rpcs.retrieve_tools.retry_policy
494
+
495
+ options.apply_defaults timeout: @config.timeout,
496
+ metadata: @config.metadata,
497
+ retry_policy: @config.retry_policy
498
+
499
+ @tool_service_stub.call_rpc :retrieve_tools, request, options: options do |response, operation|
500
+ yield response, operation if block_given?
501
+ end
502
+ rescue ::GRPC::BadStatus => e
503
+ raise ::Google::Cloud::Error.from_error(e)
504
+ end
505
+
506
+ ##
507
+ # Configuration class for the ToolService API.
508
+ #
509
+ # This class represents the configuration for ToolService,
510
+ # providing control over timeouts, retry behavior, logging, transport
511
+ # parameters, and other low-level controls. Certain parameters can also be
512
+ # applied individually to specific RPCs. See
513
+ # {::Google::Cloud::Ces::V1::ToolService::Client::Configuration::Rpcs}
514
+ # for a list of RPCs that can be configured independently.
515
+ #
516
+ # Configuration can be applied globally to all clients, or to a single client
517
+ # on construction.
518
+ #
519
+ # @example
520
+ #
521
+ # # Modify the global config, setting the timeout for
522
+ # # execute_tool to 20 seconds,
523
+ # # and all remaining timeouts to 10 seconds.
524
+ # ::Google::Cloud::Ces::V1::ToolService::Client.configure do |config|
525
+ # config.timeout = 10.0
526
+ # config.rpcs.execute_tool.timeout = 20.0
527
+ # end
528
+ #
529
+ # # Apply the above configuration only to a new client.
530
+ # client = ::Google::Cloud::Ces::V1::ToolService::Client.new do |config|
531
+ # config.timeout = 10.0
532
+ # config.rpcs.execute_tool.timeout = 20.0
533
+ # end
534
+ #
535
+ # @!attribute [rw] endpoint
536
+ # A custom service endpoint, as a hostname or hostname:port. The default is
537
+ # nil, indicating to use the default endpoint in the current universe domain.
538
+ # @return [::String,nil]
539
+ # @!attribute [rw] credentials
540
+ # Credentials to send with calls. You may provide any of the following types:
541
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
542
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
543
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
544
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
545
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
546
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
547
+ # * (`nil`) indicating no credentials
548
+ #
549
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
550
+ # is deprecated. Providing an unvalidated credential configuration to
551
+ # Google APIs can compromise the security of your systems and data.
552
+ #
553
+ # @example
554
+ #
555
+ # # The recommended way to provide credentials is to use the `make_creds` method
556
+ # # on the appropriate credentials class for your environment.
557
+ #
558
+ # require "googleauth"
559
+ #
560
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
561
+ # json_key_io: ::File.open("/path/to/keyfile.json")
562
+ # )
563
+ #
564
+ # client = ::Google::Cloud::Ces::V1::ToolService::Client.new do |config|
565
+ # config.credentials = credentials
566
+ # end
567
+ #
568
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
569
+ # external source for authentication to Google Cloud, you must validate it before
570
+ # providing it to a Google API client library. Providing an unvalidated credential
571
+ # configuration to Google APIs can compromise the security of your systems and data.
572
+ # For more information, refer to [Validate credential configurations from external
573
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
574
+ # @return [::Object]
575
+ # @!attribute [rw] scope
576
+ # The OAuth scopes
577
+ # @return [::Array<::String>]
578
+ # @!attribute [rw] lib_name
579
+ # The library name as recorded in instrumentation and logging
580
+ # @return [::String]
581
+ # @!attribute [rw] lib_version
582
+ # The library version as recorded in instrumentation and logging
583
+ # @return [::String]
584
+ # @!attribute [rw] channel_args
585
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
586
+ # `GRPC::Core::Channel` object is provided as the credential.
587
+ # @return [::Hash]
588
+ # @!attribute [rw] interceptors
589
+ # An array of interceptors that are run before calls are executed.
590
+ # @return [::Array<::GRPC::ClientInterceptor>]
591
+ # @!attribute [rw] timeout
592
+ # The call timeout in seconds.
593
+ # @return [::Numeric]
594
+ # @!attribute [rw] metadata
595
+ # Additional gRPC headers to be sent with the call.
596
+ # @return [::Hash{::Symbol=>::String}]
597
+ # @!attribute [rw] retry_policy
598
+ # The retry policy. The value is a hash with the following keys:
599
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
600
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
601
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
602
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
603
+ # trigger a retry.
604
+ # @return [::Hash]
605
+ # @!attribute [rw] quota_project
606
+ # A separate project against which to charge quota.
607
+ # @return [::String]
608
+ # @!attribute [rw] universe_domain
609
+ # The universe domain within which to make requests. This determines the
610
+ # default endpoint URL. The default value of nil uses the environment
611
+ # universe (usually the default "googleapis.com" universe).
612
+ # @return [::String,nil]
613
+ # @!attribute [rw] logger
614
+ # A custom logger to use for request/response debug logging, or the value
615
+ # `:default` (the default) to construct a default logger, or `nil` to
616
+ # explicitly disable logging.
617
+ # @return [::Logger,:default,nil]
618
+ #
619
+ class Configuration
620
+ extend ::Gapic::Config
621
+
622
+ # @private
623
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
624
+ DEFAULT_ENDPOINT = "ces.googleapis.com"
625
+
626
+ config_attr :endpoint, nil, ::String, nil
627
+ config_attr :credentials, nil do |value|
628
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
629
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
630
+ allowed.any? { |klass| klass === value }
631
+ end
632
+ config_attr :scope, nil, ::String, ::Array, nil
633
+ config_attr :lib_name, nil, ::String, nil
634
+ config_attr :lib_version, nil, ::String, nil
635
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
636
+ config_attr :interceptors, nil, ::Array, nil
637
+ config_attr :timeout, nil, ::Numeric, nil
638
+ config_attr :metadata, nil, ::Hash, nil
639
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
640
+ config_attr :quota_project, nil, ::String, nil
641
+ config_attr :universe_domain, nil, ::String, nil
642
+ config_attr :logger, :default, ::Logger, nil, :default
643
+
644
+ # @private
645
+ def initialize parent_config = nil
646
+ @parent_config = parent_config unless parent_config.nil?
647
+
648
+ yield self if block_given?
649
+ end
650
+
651
+ ##
652
+ # Configurations for individual RPCs
653
+ # @return [Rpcs]
654
+ #
655
+ def rpcs
656
+ @rpcs ||= begin
657
+ parent_rpcs = nil
658
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
659
+ Rpcs.new parent_rpcs
660
+ end
661
+ end
662
+
663
+ ##
664
+ # Configuration for the channel pool
665
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
666
+ #
667
+ def channel_pool
668
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
669
+ end
670
+
671
+ ##
672
+ # Configuration RPC class for the ToolService API.
673
+ #
674
+ # Includes fields providing the configuration for each RPC in this service.
675
+ # Each configuration object is of type `Gapic::Config::Method` and includes
676
+ # the following configuration fields:
677
+ #
678
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
679
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
680
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
681
+ # include the following keys:
682
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
683
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
684
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
685
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
686
+ # trigger a retry.
687
+ #
688
+ class Rpcs
689
+ ##
690
+ # RPC-specific configuration for `execute_tool`
691
+ # @return [::Gapic::Config::Method]
692
+ #
693
+ attr_reader :execute_tool
694
+ ##
695
+ # RPC-specific configuration for `retrieve_tool_schema`
696
+ # @return [::Gapic::Config::Method]
697
+ #
698
+ attr_reader :retrieve_tool_schema
699
+ ##
700
+ # RPC-specific configuration for `retrieve_tools`
701
+ # @return [::Gapic::Config::Method]
702
+ #
703
+ attr_reader :retrieve_tools
704
+
705
+ # @private
706
+ def initialize parent_rpcs = nil
707
+ execute_tool_config = parent_rpcs.execute_tool if parent_rpcs.respond_to? :execute_tool
708
+ @execute_tool = ::Gapic::Config::Method.new execute_tool_config
709
+ retrieve_tool_schema_config = parent_rpcs.retrieve_tool_schema if parent_rpcs.respond_to? :retrieve_tool_schema
710
+ @retrieve_tool_schema = ::Gapic::Config::Method.new retrieve_tool_schema_config
711
+ retrieve_tools_config = parent_rpcs.retrieve_tools if parent_rpcs.respond_to? :retrieve_tools
712
+ @retrieve_tools = ::Gapic::Config::Method.new retrieve_tools_config
713
+
714
+ yield self if block_given?
715
+ end
716
+ end
717
+ end
718
+ end
719
+ end
720
+ end
721
+ end
722
+ end
723
+ end