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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) 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/v1beta/agent_card_pb.rb +26 -0
  6. data/lib/google/cloud/ces/v1beta/agent_pb.rb +30 -0
  7. data/lib/google/cloud/ces/v1beta/agent_service/client.rb +5641 -0
  8. data/lib/google/cloud/ces/v1beta/agent_service/credentials.rb +48 -0
  9. data/lib/google/cloud/ces/v1beta/agent_service/operations.rb +843 -0
  10. data/lib/google/cloud/ces/v1beta/agent_service/paths.rb +481 -0
  11. data/lib/google/cloud/ces/v1beta/agent_service/rest/client.rb +5249 -0
  12. data/lib/google/cloud/ces/v1beta/agent_service/rest/operations.rb +927 -0
  13. data/lib/google/cloud/ces/v1beta/agent_service/rest/service_stub.rb +3213 -0
  14. data/lib/google/cloud/ces/v1beta/agent_service/rest.rb +55 -0
  15. data/lib/google/cloud/ces/v1beta/agent_service.rb +57 -0
  16. data/lib/google/cloud/ces/v1beta/agent_service_pb.rb +132 -0
  17. data/lib/google/cloud/ces/v1beta/agent_service_services_pb.rb +148 -0
  18. data/lib/google/cloud/ces/v1beta/agent_tool_pb.rb +24 -0
  19. data/lib/google/cloud/ces/v1beta/agent_transfers_pb.rb +29 -0
  20. data/lib/google/cloud/ces/v1beta/app_pb.rb +70 -0
  21. data/lib/google/cloud/ces/v1beta/app_version_pb.rb +32 -0
  22. data/lib/google/cloud/ces/v1beta/auth_pb.rb +34 -0
  23. data/lib/google/cloud/ces/v1beta/bigquery_export_pb.rb +23 -0
  24. data/lib/google/cloud/ces/v1beta/bindings_override.rb +75 -0
  25. data/lib/google/cloud/ces/v1beta/changelog_pb.rb +26 -0
  26. data/lib/google/cloud/ces/v1beta/client_function_pb.rb +24 -0
  27. data/lib/google/cloud/ces/v1beta/common_pb.rb +46 -0
  28. data/lib/google/cloud/ces/v1beta/connector_tool_pb.rb +27 -0
  29. data/lib/google/cloud/ces/v1beta/connector_toolset_pb.rb +25 -0
  30. data/lib/google/cloud/ces/v1beta/conversation_pb.rb +31 -0
  31. data/lib/google/cloud/ces/v1beta/data_store_pb.rb +27 -0
  32. data/lib/google/cloud/ces/v1beta/data_store_tool_pb.rb +40 -0
  33. data/lib/google/cloud/ces/v1beta/deployment_pb.rb +30 -0
  34. data/lib/google/cloud/ces/v1beta/evaluation_metrics_config_pb.rb +31 -0
  35. data/lib/google/cloud/ces/v1beta/evaluation_pb.rb +99 -0
  36. data/lib/google/cloud/ces/v1beta/evaluation_service/client.rb +4050 -0
  37. data/lib/google/cloud/ces/v1beta/evaluation_service/credentials.rb +48 -0
  38. data/lib/google/cloud/ces/v1beta/evaluation_service/operations.rb +843 -0
  39. data/lib/google/cloud/ces/v1beta/evaluation_service/paths.rb +306 -0
  40. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/client.rb +3770 -0
  41. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/operations.rb +927 -0
  42. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/service_stub.rb +2233 -0
  43. data/lib/google/cloud/ces/v1beta/evaluation_service/rest.rb +54 -0
  44. data/lib/google/cloud/ces/v1beta/evaluation_service.rb +56 -0
  45. data/lib/google/cloud/ces/v1beta/evaluation_service_pb.rb +93 -0
  46. data/lib/google/cloud/ces/v1beta/evaluation_service_services_pb.rb +116 -0
  47. data/lib/google/cloud/ces/v1beta/example_pb.rb +34 -0
  48. data/lib/google/cloud/ces/v1beta/fakes_pb.rb +25 -0
  49. data/lib/google/cloud/ces/v1beta/file_context_pb.rb +24 -0
  50. data/lib/google/cloud/ces/v1beta/file_search_tool_pb.rb +24 -0
  51. data/lib/google/cloud/ces/v1beta/golden_run_pb.rb +21 -0
  52. data/lib/google/cloud/ces/v1beta/google_search_tool_pb.rb +24 -0
  53. data/lib/google/cloud/ces/v1beta/guardrail_pb.rb +37 -0
  54. data/lib/google/cloud/ces/v1beta/mcp_tool_pb.rb +27 -0
  55. data/lib/google/cloud/ces/v1beta/mcp_toolset_pb.rb +28 -0
  56. data/lib/google/cloud/ces/v1beta/mocks_pb.rb +26 -0
  57. data/lib/google/cloud/ces/v1beta/omnichannel_pb.rb +31 -0
  58. data/lib/google/cloud/ces/v1beta/omnichannel_service_pb.rb +27 -0
  59. data/lib/google/cloud/ces/v1beta/open_api_tool_pb.rb +25 -0
  60. data/lib/google/cloud/ces/v1beta/open_api_toolset_pb.rb +25 -0
  61. data/lib/google/cloud/ces/v1beta/python_function_pb.rb +24 -0
  62. data/lib/google/cloud/ces/v1beta/rest.rb +42 -0
  63. data/lib/google/cloud/ces/v1beta/schema_pb.rb +25 -0
  64. data/lib/google/cloud/ces/v1beta/search_suggestions_pb.rb +22 -0
  65. data/lib/google/cloud/ces/v1beta/security_settings_pb.rb +27 -0
  66. data/lib/google/cloud/ces/v1beta/session_service/client.rb +762 -0
  67. data/lib/google/cloud/ces/v1beta/session_service/credentials.rb +48 -0
  68. data/lib/google/cloud/ces/v1beta/session_service/paths.rb +117 -0
  69. data/lib/google/cloud/ces/v1beta/session_service/rest/client.rb +562 -0
  70. data/lib/google/cloud/ces/v1beta/session_service/rest/service_stub.rb +199 -0
  71. data/lib/google/cloud/ces/v1beta/session_service/rest.rb +53 -0
  72. data/lib/google/cloud/ces/v1beta/session_service.rb +55 -0
  73. data/lib/google/cloud/ces/v1beta/session_service_pb.rb +54 -0
  74. data/lib/google/cloud/ces/v1beta/session_service_services_pb.rb +120 -0
  75. data/lib/google/cloud/ces/v1beta/system_tool_pb.rb +23 -0
  76. data/lib/google/cloud/ces/v1beta/tool_pb.rb +40 -0
  77. data/lib/google/cloud/ces/v1beta/tool_service/client.rb +733 -0
  78. data/lib/google/cloud/ces/v1beta/tool_service/credentials.rb +48 -0
  79. data/lib/google/cloud/ces/v1beta/tool_service/paths.rb +94 -0
  80. data/lib/google/cloud/ces/v1beta/tool_service/rest/client.rb +677 -0
  81. data/lib/google/cloud/ces/v1beta/tool_service/rest/service_stub.rb +267 -0
  82. data/lib/google/cloud/ces/v1beta/tool_service/rest.rb +53 -0
  83. data/lib/google/cloud/ces/v1beta/tool_service.rb +55 -0
  84. data/lib/google/cloud/ces/v1beta/tool_service_pb.rb +37 -0
  85. data/lib/google/cloud/ces/v1beta/tool_service_services_pb.rb +50 -0
  86. data/lib/google/cloud/ces/v1beta/toolset_pb.rb +30 -0
  87. data/lib/google/cloud/ces/v1beta/toolset_tool_pb.rb +24 -0
  88. data/lib/google/cloud/ces/v1beta/version.rb +7 -2
  89. data/lib/google/cloud/ces/v1beta/widget_service/client.rb +503 -0
  90. data/lib/google/cloud/ces/v1beta/widget_service/credentials.rb +48 -0
  91. data/lib/google/cloud/ces/v1beta/widget_service/paths.rb +75 -0
  92. data/lib/google/cloud/ces/v1beta/widget_service/rest/client.rb +461 -0
  93. data/lib/google/cloud/ces/v1beta/widget_service/rest/service_stub.rb +143 -0
  94. data/lib/google/cloud/ces/v1beta/widget_service/rest.rb +53 -0
  95. data/lib/google/cloud/ces/v1beta/widget_service.rb +55 -0
  96. data/lib/google/cloud/ces/v1beta/widget_service_pb.rb +28 -0
  97. data/lib/google/cloud/ces/v1beta/widget_service_services_pb.rb +46 -0
  98. data/lib/google/cloud/ces/v1beta/widget_tool_pb.rb +31 -0
  99. data/lib/google/cloud/ces/v1beta.rb +49 -0
  100. data/lib/google-cloud-ces-v1beta.rb +21 -0
  101. data/proto_docs/README.md +4 -0
  102. data/proto_docs/google/api/client.rb +593 -0
  103. data/proto_docs/google/api/field_behavior.rb +85 -0
  104. data/proto_docs/google/api/launch_stage.rb +71 -0
  105. data/proto_docs/google/api/resource.rb +227 -0
  106. data/proto_docs/google/cloud/ces/v1beta/agent.rb +233 -0
  107. data/proto_docs/google/cloud/ces/v1beta/agent_card.rb +122 -0
  108. data/proto_docs/google/cloud/ces/v1beta/agent_service.rb +1682 -0
  109. data/proto_docs/google/cloud/ces/v1beta/agent_tool.rb +48 -0
  110. data/proto_docs/google/cloud/ces/v1beta/agent_transfers.rb +111 -0
  111. data/proto_docs/google/cloud/ces/v1beta/app.rb +883 -0
  112. data/proto_docs/google/cloud/ces/v1beta/app_version.rb +83 -0
  113. data/proto_docs/google/cloud/ces/v1beta/auth.rb +214 -0
  114. data/proto_docs/google/cloud/ces/v1beta/bigquery_export.rb +45 -0
  115. data/proto_docs/google/cloud/ces/v1beta/changelog.rb +73 -0
  116. data/proto_docs/google/cloud/ces/v1beta/client_function.rb +48 -0
  117. data/proto_docs/google/cloud/ces/v1beta/common.rb +375 -0
  118. data/proto_docs/google/cloud/ces/v1beta/connector_tool.rb +122 -0
  119. data/proto_docs/google/cloud/ces/v1beta/connector_toolset.rb +52 -0
  120. data/proto_docs/google/cloud/ces/v1beta/conversation.rb +159 -0
  121. data/proto_docs/google/cloud/ces/v1beta/data_store.rb +102 -0
  122. data/proto_docs/google/cloud/ces/v1beta/data_store_tool.rb +328 -0
  123. data/proto_docs/google/cloud/ces/v1beta/deployment.rb +123 -0
  124. data/proto_docs/google/cloud/ces/v1beta/evaluation.rb +1687 -0
  125. data/proto_docs/google/cloud/ces/v1beta/evaluation_metrics_config.rb +151 -0
  126. data/proto_docs/google/cloud/ces/v1beta/evaluation_service.rb +1087 -0
  127. data/proto_docs/google/cloud/ces/v1beta/example.rb +245 -0
  128. data/proto_docs/google/cloud/ces/v1beta/fakes.rb +67 -0
  129. data/proto_docs/google/cloud/ces/v1beta/file_context.rb +50 -0
  130. data/proto_docs/google/cloud/ces/v1beta/file_search_tool.rb +60 -0
  131. data/proto_docs/google/cloud/ces/v1beta/golden_run.rb +40 -0
  132. data/proto_docs/google/cloud/ces/v1beta/google_search_tool.rb +76 -0
  133. data/proto_docs/google/cloud/ces/v1beta/guardrail.rb +324 -0
  134. data/proto_docs/google/cloud/ces/v1beta/mcp_tool.rb +110 -0
  135. data/proto_docs/google/cloud/ces/v1beta/mcp_toolset.rb +118 -0
  136. data/proto_docs/google/cloud/ces/v1beta/mocks.rb +60 -0
  137. data/proto_docs/google/cloud/ces/v1beta/omnichannel.rb +163 -0
  138. data/proto_docs/google/cloud/ces/v1beta/omnichannel_service.rb +45 -0
  139. data/proto_docs/google/cloud/ces/v1beta/open_api_tool.rb +66 -0
  140. data/proto_docs/google/cloud/ces/v1beta/open_api_toolset.rb +57 -0
  141. data/proto_docs/google/cloud/ces/v1beta/python_function.rb +47 -0
  142. data/proto_docs/google/cloud/ces/v1beta/schema.rb +162 -0
  143. data/proto_docs/google/cloud/ces/v1beta/search_suggestions.rb +55 -0
  144. data/proto_docs/google/cloud/ces/v1beta/security_settings.rb +80 -0
  145. data/proto_docs/google/cloud/ces/v1beta/session_service.rb +493 -0
  146. data/proto_docs/google/cloud/ces/v1beta/system_tool.rb +38 -0
  147. data/proto_docs/google/cloud/ces/v1beta/tool.rb +136 -0
  148. data/proto_docs/google/cloud/ces/v1beta/tool_service.rb +185 -0
  149. data/proto_docs/google/cloud/ces/v1beta/toolset.rb +80 -0
  150. data/proto_docs/google/cloud/ces/v1beta/toolset_tool.rb +40 -0
  151. data/proto_docs/google/cloud/ces/v1beta/widget_service.rb +62 -0
  152. data/proto_docs/google/cloud/ces/v1beta/widget_tool.rb +182 -0
  153. data/proto_docs/google/longrunning/operations.rb +191 -0
  154. data/proto_docs/google/protobuf/any.rb +145 -0
  155. data/proto_docs/google/protobuf/duration.rb +98 -0
  156. data/proto_docs/google/protobuf/empty.rb +34 -0
  157. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  158. data/proto_docs/google/protobuf/struct.rb +108 -0
  159. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  160. data/proto_docs/google/rpc/status.rb +48 -0
  161. metadata +208 -9
@@ -0,0 +1,677 @@
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/v1beta/tool_service_pb"
21
+ require "google/cloud/ces/v1beta/tool_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Ces
27
+ module V1beta
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::V1beta::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::V1beta::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", "V1beta"]
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::V1beta::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::V1beta::ToolService::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::Ces::V1beta::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::V1beta::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::V1beta::ExecuteToolRequest} or an equivalent Hash.
207
+ #
208
+ # @param request [::Google::Cloud::Ces::V1beta::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, mock_config: 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::V1beta::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
+ # @param mock_config [::Google::Cloud::Ces::V1beta::MockConfig, ::Hash]
247
+ # Optional. Mock configuration for the tool execution.
248
+ # If this field is set, tools that call other tools will be
249
+ # mocked based on the provided patterns and responses.
250
+ # @yield [result, operation] Access the result along with the TransportOperation object
251
+ # @yieldparam result [::Google::Cloud::Ces::V1beta::ExecuteToolResponse]
252
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
253
+ #
254
+ # @return [::Google::Cloud::Ces::V1beta::ExecuteToolResponse]
255
+ #
256
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
257
+ #
258
+ # @example Basic example
259
+ # require "google/cloud/ces/v1beta"
260
+ #
261
+ # # Create a client object. The client can be reused for multiple calls.
262
+ # client = Google::Cloud::Ces::V1beta::ToolService::Rest::Client.new
263
+ #
264
+ # # Create a request. To set request fields, pass in keyword arguments.
265
+ # request = Google::Cloud::Ces::V1beta::ExecuteToolRequest.new
266
+ #
267
+ # # Call the execute_tool method.
268
+ # result = client.execute_tool request
269
+ #
270
+ # # The returned object is of type Google::Cloud::Ces::V1beta::ExecuteToolResponse.
271
+ # p result
272
+ #
273
+ def execute_tool request, options = nil
274
+ raise ::ArgumentError, "request must be provided" if request.nil?
275
+
276
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::ExecuteToolRequest
277
+
278
+ # Converts hash and nil to an options object
279
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
280
+
281
+ # Customize the options with defaults
282
+ call_metadata = @config.rpcs.execute_tool.metadata.to_h
283
+
284
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
285
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
286
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
287
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
288
+ transports_version_send: [:rest]
289
+
290
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
291
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
292
+
293
+ options.apply_defaults timeout: @config.rpcs.execute_tool.timeout,
294
+ metadata: call_metadata,
295
+ retry_policy: @config.rpcs.execute_tool.retry_policy
296
+
297
+ options.apply_defaults timeout: @config.timeout,
298
+ metadata: @config.metadata,
299
+ retry_policy: @config.retry_policy
300
+
301
+ @tool_service_stub.execute_tool request, options do |result, operation|
302
+ yield result, operation if block_given?
303
+ end
304
+ rescue ::Gapic::Rest::Error => e
305
+ raise ::Google::Cloud::Error.from_error(e)
306
+ end
307
+
308
+ ##
309
+ # Retrieve the schema of the given tool. The schema is computed on the fly
310
+ # for the given instance of the tool.
311
+ #
312
+ # @overload retrieve_tool_schema(request, options = nil)
313
+ # Pass arguments to `retrieve_tool_schema` via a request object, either of type
314
+ # {::Google::Cloud::Ces::V1beta::RetrieveToolSchemaRequest} or an equivalent Hash.
315
+ #
316
+ # @param request [::Google::Cloud::Ces::V1beta::RetrieveToolSchemaRequest, ::Hash]
317
+ # A request object representing the call parameters. Required. To specify no
318
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
319
+ # @param options [::Gapic::CallOptions, ::Hash]
320
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
321
+ #
322
+ # @overload retrieve_tool_schema(tool: nil, toolset_tool: nil, parent: nil)
323
+ # Pass arguments to `retrieve_tool_schema` via keyword arguments. Note that at
324
+ # least one keyword argument is required. To specify no parameters, or to keep all
325
+ # the default parameter values, pass an empty Hash as a request object (see above).
326
+ #
327
+ # @param tool [::String]
328
+ # Optional. The name of the tool to retrieve the schema for.
329
+ # Format:
330
+ # projects/\\{project}/locations/\\{location}/apps/\\{app}/tools/\\{tool}
331
+ #
332
+ # 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.
333
+ # @param toolset_tool [::Google::Cloud::Ces::V1beta::ToolsetTool, ::Hash]
334
+ # Optional. The toolset tool to retrieve the schema for. Only one tool
335
+ # should match the predicate from the toolset. Otherwise, an error will be
336
+ # returned.
337
+ #
338
+ # 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.
339
+ # @param parent [::String]
340
+ # Required. The resource name of the app which the tool/toolset belongs to.
341
+ # Format: `projects/{project}/locations/{location}/apps/{app}`
342
+ # @yield [result, operation] Access the result along with the TransportOperation object
343
+ # @yieldparam result [::Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponse]
344
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
345
+ #
346
+ # @return [::Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponse]
347
+ #
348
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
349
+ #
350
+ # @example Basic example
351
+ # require "google/cloud/ces/v1beta"
352
+ #
353
+ # # Create a client object. The client can be reused for multiple calls.
354
+ # client = Google::Cloud::Ces::V1beta::ToolService::Rest::Client.new
355
+ #
356
+ # # Create a request. To set request fields, pass in keyword arguments.
357
+ # request = Google::Cloud::Ces::V1beta::RetrieveToolSchemaRequest.new
358
+ #
359
+ # # Call the retrieve_tool_schema method.
360
+ # result = client.retrieve_tool_schema request
361
+ #
362
+ # # The returned object is of type Google::Cloud::Ces::V1beta::RetrieveToolSchemaResponse.
363
+ # p result
364
+ #
365
+ def retrieve_tool_schema request, options = nil
366
+ raise ::ArgumentError, "request must be provided" if request.nil?
367
+
368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::RetrieveToolSchemaRequest
369
+
370
+ # Converts hash and nil to an options object
371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
372
+
373
+ # Customize the options with defaults
374
+ call_metadata = @config.rpcs.retrieve_tool_schema.metadata.to_h
375
+
376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
377
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
379
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
380
+ transports_version_send: [:rest]
381
+
382
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
383
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
+
385
+ options.apply_defaults timeout: @config.rpcs.retrieve_tool_schema.timeout,
386
+ metadata: call_metadata,
387
+ retry_policy: @config.rpcs.retrieve_tool_schema.retry_policy
388
+
389
+ options.apply_defaults timeout: @config.timeout,
390
+ metadata: @config.metadata,
391
+ retry_policy: @config.retry_policy
392
+
393
+ @tool_service_stub.retrieve_tool_schema request, options do |result, operation|
394
+ yield result, operation if block_given?
395
+ end
396
+ rescue ::Gapic::Rest::Error => e
397
+ raise ::Google::Cloud::Error.from_error(e)
398
+ end
399
+
400
+ ##
401
+ # Retrieve the list of tools included in the specified toolset.
402
+ #
403
+ # @overload retrieve_tools(request, options = nil)
404
+ # Pass arguments to `retrieve_tools` via a request object, either of type
405
+ # {::Google::Cloud::Ces::V1beta::RetrieveToolsRequest} or an equivalent Hash.
406
+ #
407
+ # @param request [::Google::Cloud::Ces::V1beta::RetrieveToolsRequest, ::Hash]
408
+ # A request object representing the call parameters. Required. To specify no
409
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
410
+ # @param options [::Gapic::CallOptions, ::Hash]
411
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
412
+ #
413
+ # @overload retrieve_tools(toolset: nil, tool_ids: nil, bypass_persistence_config: nil)
414
+ # Pass arguments to `retrieve_tools` via keyword arguments. Note that at
415
+ # least one keyword argument is required. To specify no parameters, or to keep all
416
+ # the default parameter values, pass an empty Hash as a request object (see above).
417
+ #
418
+ # @param toolset [::String]
419
+ # Required. The name of the toolset to retrieve the tools for.
420
+ # Format:
421
+ # `projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`
422
+ # @param tool_ids [::Array<::String>]
423
+ # Optional. The identifiers of the tools to retrieve from the toolset.
424
+ # If empty, all tools in the toolset will be returned.
425
+ # @param bypass_persistence_config [::Boolean]
426
+ # Optional. If true, the returned tools will contain raw descriptions and
427
+ # schemas directly from the server, bypassing any stored persistence
428
+ # configurations (overrides/snapshots).
429
+ # @yield [result, operation] Access the result along with the TransportOperation object
430
+ # @yieldparam result [::Google::Cloud::Ces::V1beta::RetrieveToolsResponse]
431
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
432
+ #
433
+ # @return [::Google::Cloud::Ces::V1beta::RetrieveToolsResponse]
434
+ #
435
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
436
+ #
437
+ # @example Basic example
438
+ # require "google/cloud/ces/v1beta"
439
+ #
440
+ # # Create a client object. The client can be reused for multiple calls.
441
+ # client = Google::Cloud::Ces::V1beta::ToolService::Rest::Client.new
442
+ #
443
+ # # Create a request. To set request fields, pass in keyword arguments.
444
+ # request = Google::Cloud::Ces::V1beta::RetrieveToolsRequest.new
445
+ #
446
+ # # Call the retrieve_tools method.
447
+ # result = client.retrieve_tools request
448
+ #
449
+ # # The returned object is of type Google::Cloud::Ces::V1beta::RetrieveToolsResponse.
450
+ # p result
451
+ #
452
+ def retrieve_tools request, options = nil
453
+ raise ::ArgumentError, "request must be provided" if request.nil?
454
+
455
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::RetrieveToolsRequest
456
+
457
+ # Converts hash and nil to an options object
458
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
459
+
460
+ # Customize the options with defaults
461
+ call_metadata = @config.rpcs.retrieve_tools.metadata.to_h
462
+
463
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
464
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
465
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
466
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION,
467
+ transports_version_send: [:rest]
468
+
469
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
470
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
471
+
472
+ options.apply_defaults timeout: @config.rpcs.retrieve_tools.timeout,
473
+ metadata: call_metadata,
474
+ retry_policy: @config.rpcs.retrieve_tools.retry_policy
475
+
476
+ options.apply_defaults timeout: @config.timeout,
477
+ metadata: @config.metadata,
478
+ retry_policy: @config.retry_policy
479
+
480
+ @tool_service_stub.retrieve_tools request, options do |result, operation|
481
+ yield result, operation if block_given?
482
+ end
483
+ rescue ::Gapic::Rest::Error => e
484
+ raise ::Google::Cloud::Error.from_error(e)
485
+ end
486
+
487
+ ##
488
+ # Configuration class for the ToolService REST API.
489
+ #
490
+ # This class represents the configuration for ToolService REST,
491
+ # providing control over timeouts, retry behavior, logging, transport
492
+ # parameters, and other low-level controls. Certain parameters can also be
493
+ # applied individually to specific RPCs. See
494
+ # {::Google::Cloud::Ces::V1beta::ToolService::Rest::Client::Configuration::Rpcs}
495
+ # for a list of RPCs that can be configured independently.
496
+ #
497
+ # Configuration can be applied globally to all clients, or to a single client
498
+ # on construction.
499
+ #
500
+ # @example
501
+ #
502
+ # # Modify the global config, setting the timeout for
503
+ # # execute_tool to 20 seconds,
504
+ # # and all remaining timeouts to 10 seconds.
505
+ # ::Google::Cloud::Ces::V1beta::ToolService::Rest::Client.configure do |config|
506
+ # config.timeout = 10.0
507
+ # config.rpcs.execute_tool.timeout = 20.0
508
+ # end
509
+ #
510
+ # # Apply the above configuration only to a new client.
511
+ # client = ::Google::Cloud::Ces::V1beta::ToolService::Rest::Client.new do |config|
512
+ # config.timeout = 10.0
513
+ # config.rpcs.execute_tool.timeout = 20.0
514
+ # end
515
+ #
516
+ # @!attribute [rw] endpoint
517
+ # A custom service endpoint, as a hostname or hostname:port. The default is
518
+ # nil, indicating to use the default endpoint in the current universe domain.
519
+ # @return [::String,nil]
520
+ # @!attribute [rw] credentials
521
+ # Credentials to send with calls. You may provide any of the following types:
522
+ # * (`String`) The path to a service account key file in JSON format
523
+ # * (`Hash`) A service account key as a Hash
524
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
525
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
526
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
527
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
528
+ # * (`nil`) indicating no credentials
529
+ #
530
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
531
+ # external source for authentication to Google Cloud, you must validate it before
532
+ # providing it to a Google API client library. Providing an unvalidated credential
533
+ # configuration to Google APIs can compromise the security of your systems and data.
534
+ # For more information, refer to [Validate credential configurations from external
535
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
536
+ # @return [::Object]
537
+ # @!attribute [rw] scope
538
+ # The OAuth scopes
539
+ # @return [::Array<::String>]
540
+ # @!attribute [rw] lib_name
541
+ # The library name as recorded in instrumentation and logging
542
+ # @return [::String]
543
+ # @!attribute [rw] lib_version
544
+ # The library version as recorded in instrumentation and logging
545
+ # @return [::String]
546
+ # @!attribute [rw] timeout
547
+ # The call timeout in seconds.
548
+ # @return [::Numeric]
549
+ # @!attribute [rw] metadata
550
+ # Additional headers to be sent with the call.
551
+ # @return [::Hash{::Symbol=>::String}]
552
+ # @!attribute [rw] retry_policy
553
+ # The retry policy. The value is a hash with the following keys:
554
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
555
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
556
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
557
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
558
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
559
+ # trigger a retry.
560
+ # @return [::Hash]
561
+ # @!attribute [rw] quota_project
562
+ # A separate project against which to charge quota.
563
+ # @return [::String]
564
+ # @!attribute [rw] universe_domain
565
+ # The universe domain within which to make requests. This determines the
566
+ # default endpoint URL. The default value of nil uses the environment
567
+ # universe (usually the default "googleapis.com" universe).
568
+ # @return [::String,nil]
569
+ # @!attribute [rw] logger
570
+ # A custom logger to use for request/response debug logging, or the value
571
+ # `:default` (the default) to construct a default logger, or `nil` to
572
+ # explicitly disable logging.
573
+ # @return [::Logger,:default,nil]
574
+ #
575
+ class Configuration
576
+ extend ::Gapic::Config
577
+
578
+ # @private
579
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
580
+ DEFAULT_ENDPOINT = "ces.googleapis.com"
581
+
582
+ config_attr :endpoint, nil, ::String, nil
583
+ config_attr :credentials, nil do |value|
584
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
585
+ allowed.any? { |klass| klass === value }
586
+ end
587
+ config_attr :scope, nil, ::String, ::Array, nil
588
+ config_attr :lib_name, nil, ::String, nil
589
+ config_attr :lib_version, nil, ::String, nil
590
+ config_attr :timeout, nil, ::Numeric, nil
591
+ config_attr :metadata, nil, ::Hash, nil
592
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
593
+ config_attr :quota_project, nil, ::String, nil
594
+ config_attr :universe_domain, nil, ::String, nil
595
+
596
+ # @private
597
+ # Overrides for http bindings for the RPCs of this service
598
+ # are only used when this service is used as mixin, and only
599
+ # by the host service.
600
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
601
+ config_attr :bindings_override, {}, ::Hash, nil
602
+ config_attr :logger, :default, ::Logger, nil, :default
603
+
604
+ # @private
605
+ def initialize parent_config = nil
606
+ @parent_config = parent_config unless parent_config.nil?
607
+
608
+ yield self if block_given?
609
+ end
610
+
611
+ ##
612
+ # Configurations for individual RPCs
613
+ # @return [Rpcs]
614
+ #
615
+ def rpcs
616
+ @rpcs ||= begin
617
+ parent_rpcs = nil
618
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
619
+ Rpcs.new parent_rpcs
620
+ end
621
+ end
622
+
623
+ ##
624
+ # Configuration RPC class for the ToolService API.
625
+ #
626
+ # Includes fields providing the configuration for each RPC in this service.
627
+ # Each configuration object is of type `Gapic::Config::Method` and includes
628
+ # the following configuration fields:
629
+ #
630
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
631
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
632
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
633
+ # include the following keys:
634
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
635
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
636
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
637
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
638
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
639
+ # trigger a retry.
640
+ #
641
+ class Rpcs
642
+ ##
643
+ # RPC-specific configuration for `execute_tool`
644
+ # @return [::Gapic::Config::Method]
645
+ #
646
+ attr_reader :execute_tool
647
+ ##
648
+ # RPC-specific configuration for `retrieve_tool_schema`
649
+ # @return [::Gapic::Config::Method]
650
+ #
651
+ attr_reader :retrieve_tool_schema
652
+ ##
653
+ # RPC-specific configuration for `retrieve_tools`
654
+ # @return [::Gapic::Config::Method]
655
+ #
656
+ attr_reader :retrieve_tools
657
+
658
+ # @private
659
+ def initialize parent_rpcs = nil
660
+ execute_tool_config = parent_rpcs.execute_tool if parent_rpcs.respond_to? :execute_tool
661
+ @execute_tool = ::Gapic::Config::Method.new execute_tool_config
662
+ retrieve_tool_schema_config = parent_rpcs.retrieve_tool_schema if parent_rpcs.respond_to? :retrieve_tool_schema
663
+ @retrieve_tool_schema = ::Gapic::Config::Method.new retrieve_tool_schema_config
664
+ retrieve_tools_config = parent_rpcs.retrieve_tools if parent_rpcs.respond_to? :retrieve_tools
665
+ @retrieve_tools = ::Gapic::Config::Method.new retrieve_tools_config
666
+
667
+ yield self if block_given?
668
+ end
669
+ end
670
+ end
671
+ end
672
+ end
673
+ end
674
+ end
675
+ end
676
+ end
677
+ end