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