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,459 @@
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/widget_service_pb"
21
+ require "google/cloud/ces/v1/widget_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 WidgetService
29
+ module Rest
30
+ ##
31
+ # REST client for the WidgetService service.
32
+ #
33
+ # Provides APIs for widgets to interact with CES APIs.
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 :widget_service_stub
46
+
47
+ ##
48
+ # Configure the WidgetService Client class.
49
+ #
50
+ # See {::Google::Cloud::Ces::V1::WidgetService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all WidgetService clients
56
+ # ::Google::Cloud::Ces::V1::WidgetService::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
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the WidgetService Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::Ces::V1::WidgetService::Rest::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # The effective universe domain
104
+ #
105
+ # @return [String]
106
+ #
107
+ def universe_domain
108
+ @widget_service_stub.universe_domain
109
+ end
110
+
111
+ ##
112
+ # Create a new WidgetService REST client object.
113
+ #
114
+ # @example
115
+ #
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::Ces::V1::WidgetService::Rest::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::Ces::V1::WidgetService::Rest::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
123
+ #
124
+ # @yield [config] Configure the WidgetService client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ def initialize
128
+ # Create the configuration object
129
+ @config = Configuration.new Client.configure
130
+
131
+ # Yield the configuration if needed
132
+ yield @config if block_given?
133
+
134
+ # Create credentials
135
+ credentials = @config.credentials
136
+ # Use self-signed JWT if the endpoint is unchanged from default,
137
+ # but only if the default endpoint does not have a region prefix.
138
+ enable_self_signed_jwt = @config.endpoint.nil? ||
139
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
+ !@config.endpoint.split(".").first.include?("-"))
141
+ credentials ||= Credentials.default scope: @config.scope,
142
+ enable_self_signed_jwt: enable_self_signed_jwt
143
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
144
+ credentials = Credentials.new credentials, scope: @config.scope
145
+ end
146
+
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @widget_service_stub = ::Google::Cloud::Ces::V1::WidgetService::Rest::ServiceStub.new(
151
+ endpoint: @config.endpoint,
152
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
153
+ universe_domain: @config.universe_domain,
154
+ credentials: credentials,
155
+ logger: @config.logger
156
+ )
157
+
158
+ @widget_service_stub.logger(stub: true)&.info do |entry|
159
+ entry.set_system_name
160
+ entry.set_service
161
+ entry.message = "Created client for #{entry.service}"
162
+ entry.set_credentials_fields credentials
163
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
164
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
165
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
166
+ end
167
+
168
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
169
+ config.credentials = credentials
170
+ config.quota_project = @quota_project_id
171
+ config.endpoint = @widget_service_stub.endpoint
172
+ config.universe_domain = @widget_service_stub.universe_domain
173
+ config.bindings_override = @config.bindings_override
174
+ config.logger = @widget_service_stub.logger if config.respond_to? :logger=
175
+ end
176
+ end
177
+
178
+ ##
179
+ # Get the associated client for mix-in of the Locations.
180
+ #
181
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
182
+ #
183
+ attr_reader :location_client
184
+
185
+ ##
186
+ # The logger used for request/response debug logging.
187
+ #
188
+ # @return [Logger]
189
+ #
190
+ def logger
191
+ @widget_service_stub.logger
192
+ end
193
+
194
+ # Service calls
195
+
196
+ ##
197
+ # Generates a session scoped token for chat widget to authenticate with
198
+ # Session APIs.
199
+ #
200
+ # @overload generate_chat_token(request, options = nil)
201
+ # Pass arguments to `generate_chat_token` via a request object, either of type
202
+ # {::Google::Cloud::Ces::V1::GenerateChatTokenRequest} or an equivalent Hash.
203
+ #
204
+ # @param request [::Google::Cloud::Ces::V1::GenerateChatTokenRequest, ::Hash]
205
+ # A request object representing the call parameters. Required. To specify no
206
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
207
+ # @param options [::Gapic::CallOptions, ::Hash]
208
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
209
+ #
210
+ # @overload generate_chat_token(name: nil, deployment: nil, recaptcha_token: nil, live_handoff_enabled: nil)
211
+ # Pass arguments to `generate_chat_token` via keyword arguments. Note that at
212
+ # least one keyword argument is required. To specify no parameters, or to keep all
213
+ # the default parameter values, pass an empty Hash as a request object (see above).
214
+ #
215
+ # @param name [::String]
216
+ # Required. The session name to generate the chat token for.
217
+ # Format:
218
+ # projects/\\{project}/locations/\\{location}/apps/\\{app}/sessions/\\{session}
219
+ # @param deployment [::String]
220
+ # Required. The deployment of the app to use for the session.
221
+ # Format:
222
+ # projects/\\{project}/locations/\\{location}/apps/\\{app}/deployments/\\{deployment}
223
+ # @param recaptcha_token [::String]
224
+ # Optional. The reCAPTCHA token generated by the client-side chat widget.
225
+ # @param live_handoff_enabled [::Boolean]
226
+ # Optional. Indicates if live handoff is enabled for the session.
227
+ # @yield [result, operation] Access the result along with the TransportOperation object
228
+ # @yieldparam result [::Google::Cloud::Ces::V1::GenerateChatTokenResponse]
229
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
230
+ #
231
+ # @return [::Google::Cloud::Ces::V1::GenerateChatTokenResponse]
232
+ #
233
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
234
+ #
235
+ # @example Basic example
236
+ # require "google/cloud/ces/v1"
237
+ #
238
+ # # Create a client object. The client can be reused for multiple calls.
239
+ # client = Google::Cloud::Ces::V1::WidgetService::Rest::Client.new
240
+ #
241
+ # # Create a request. To set request fields, pass in keyword arguments.
242
+ # request = Google::Cloud::Ces::V1::GenerateChatTokenRequest.new
243
+ #
244
+ # # Call the generate_chat_token method.
245
+ # result = client.generate_chat_token request
246
+ #
247
+ # # The returned object is of type Google::Cloud::Ces::V1::GenerateChatTokenResponse.
248
+ # p result
249
+ #
250
+ def generate_chat_token request, options = nil
251
+ raise ::ArgumentError, "request must be provided" if request.nil?
252
+
253
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1::GenerateChatTokenRequest
254
+
255
+ # Converts hash and nil to an options object
256
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
257
+
258
+ # Customize the options with defaults
259
+ call_metadata = @config.rpcs.generate_chat_token.metadata.to_h
260
+
261
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
262
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
263
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
264
+ gapic_version: ::Google::Cloud::Ces::V1::VERSION,
265
+ transports_version_send: [:rest]
266
+
267
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
268
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
269
+
270
+ options.apply_defaults timeout: @config.rpcs.generate_chat_token.timeout,
271
+ metadata: call_metadata,
272
+ retry_policy: @config.rpcs.generate_chat_token.retry_policy
273
+
274
+ options.apply_defaults timeout: @config.timeout,
275
+ metadata: @config.metadata,
276
+ retry_policy: @config.retry_policy
277
+
278
+ @widget_service_stub.generate_chat_token request, options do |result, operation|
279
+ yield result, operation if block_given?
280
+ end
281
+ rescue ::Gapic::Rest::Error => e
282
+ raise ::Google::Cloud::Error.from_error(e)
283
+ end
284
+
285
+ ##
286
+ # Configuration class for the WidgetService REST API.
287
+ #
288
+ # This class represents the configuration for WidgetService REST,
289
+ # providing control over timeouts, retry behavior, logging, transport
290
+ # parameters, and other low-level controls. Certain parameters can also be
291
+ # applied individually to specific RPCs. See
292
+ # {::Google::Cloud::Ces::V1::WidgetService::Rest::Client::Configuration::Rpcs}
293
+ # for a list of RPCs that can be configured independently.
294
+ #
295
+ # Configuration can be applied globally to all clients, or to a single client
296
+ # on construction.
297
+ #
298
+ # @example
299
+ #
300
+ # # Modify the global config, setting the timeout for
301
+ # # generate_chat_token to 20 seconds,
302
+ # # and all remaining timeouts to 10 seconds.
303
+ # ::Google::Cloud::Ces::V1::WidgetService::Rest::Client.configure do |config|
304
+ # config.timeout = 10.0
305
+ # config.rpcs.generate_chat_token.timeout = 20.0
306
+ # end
307
+ #
308
+ # # Apply the above configuration only to a new client.
309
+ # client = ::Google::Cloud::Ces::V1::WidgetService::Rest::Client.new do |config|
310
+ # config.timeout = 10.0
311
+ # config.rpcs.generate_chat_token.timeout = 20.0
312
+ # end
313
+ #
314
+ # @!attribute [rw] endpoint
315
+ # A custom service endpoint, as a hostname or hostname:port. The default is
316
+ # nil, indicating to use the default endpoint in the current universe domain.
317
+ # @return [::String,nil]
318
+ # @!attribute [rw] credentials
319
+ # Credentials to send with calls. You may provide any of the following types:
320
+ # * (`String`) The path to a service account key file in JSON format
321
+ # * (`Hash`) A service account key as a Hash
322
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
323
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
324
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
325
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
326
+ # * (`nil`) indicating no credentials
327
+ #
328
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
329
+ # external source for authentication to Google Cloud, you must validate it before
330
+ # providing it to a Google API client library. Providing an unvalidated credential
331
+ # configuration to Google APIs can compromise the security of your systems and data.
332
+ # For more information, refer to [Validate credential configurations from external
333
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
334
+ # @return [::Object]
335
+ # @!attribute [rw] scope
336
+ # The OAuth scopes
337
+ # @return [::Array<::String>]
338
+ # @!attribute [rw] lib_name
339
+ # The library name as recorded in instrumentation and logging
340
+ # @return [::String]
341
+ # @!attribute [rw] lib_version
342
+ # The library version as recorded in instrumentation and logging
343
+ # @return [::String]
344
+ # @!attribute [rw] timeout
345
+ # The call timeout in seconds.
346
+ # @return [::Numeric]
347
+ # @!attribute [rw] metadata
348
+ # Additional headers to be sent with the call.
349
+ # @return [::Hash{::Symbol=>::String}]
350
+ # @!attribute [rw] retry_policy
351
+ # The retry policy. The value is a hash with the following keys:
352
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
353
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
354
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
355
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
356
+ # trigger a retry.
357
+ # @return [::Hash]
358
+ # @!attribute [rw] quota_project
359
+ # A separate project against which to charge quota.
360
+ # @return [::String]
361
+ # @!attribute [rw] universe_domain
362
+ # The universe domain within which to make requests. This determines the
363
+ # default endpoint URL. The default value of nil uses the environment
364
+ # universe (usually the default "googleapis.com" universe).
365
+ # @return [::String,nil]
366
+ # @!attribute [rw] logger
367
+ # A custom logger to use for request/response debug logging, or the value
368
+ # `:default` (the default) to construct a default logger, or `nil` to
369
+ # explicitly disable logging.
370
+ # @return [::Logger,:default,nil]
371
+ #
372
+ class Configuration
373
+ extend ::Gapic::Config
374
+
375
+ # @private
376
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
377
+ DEFAULT_ENDPOINT = "ces.googleapis.com"
378
+
379
+ config_attr :endpoint, nil, ::String, nil
380
+ config_attr :credentials, nil do |value|
381
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
382
+ allowed.any? { |klass| klass === value }
383
+ end
384
+ config_attr :scope, nil, ::String, ::Array, nil
385
+ config_attr :lib_name, nil, ::String, nil
386
+ config_attr :lib_version, nil, ::String, nil
387
+ config_attr :timeout, nil, ::Numeric, nil
388
+ config_attr :metadata, nil, ::Hash, nil
389
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
390
+ config_attr :quota_project, nil, ::String, nil
391
+ config_attr :universe_domain, nil, ::String, nil
392
+
393
+ # @private
394
+ # Overrides for http bindings for the RPCs of this service
395
+ # are only used when this service is used as mixin, and only
396
+ # by the host service.
397
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
398
+ config_attr :bindings_override, {}, ::Hash, nil
399
+ config_attr :logger, :default, ::Logger, nil, :default
400
+
401
+ # @private
402
+ def initialize parent_config = nil
403
+ @parent_config = parent_config unless parent_config.nil?
404
+
405
+ yield self if block_given?
406
+ end
407
+
408
+ ##
409
+ # Configurations for individual RPCs
410
+ # @return [Rpcs]
411
+ #
412
+ def rpcs
413
+ @rpcs ||= begin
414
+ parent_rpcs = nil
415
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
416
+ Rpcs.new parent_rpcs
417
+ end
418
+ end
419
+
420
+ ##
421
+ # Configuration RPC class for the WidgetService API.
422
+ #
423
+ # Includes fields providing the configuration for each RPC in this service.
424
+ # Each configuration object is of type `Gapic::Config::Method` and includes
425
+ # the following configuration fields:
426
+ #
427
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
428
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
429
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
430
+ # include the following keys:
431
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
432
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
433
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
434
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
435
+ # trigger a retry.
436
+ #
437
+ class Rpcs
438
+ ##
439
+ # RPC-specific configuration for `generate_chat_token`
440
+ # @return [::Gapic::Config::Method]
441
+ #
442
+ attr_reader :generate_chat_token
443
+
444
+ # @private
445
+ def initialize parent_rpcs = nil
446
+ generate_chat_token_config = parent_rpcs.generate_chat_token if parent_rpcs.respond_to? :generate_chat_token
447
+ @generate_chat_token = ::Gapic::Config::Method.new generate_chat_token_config
448
+
449
+ yield self if block_given?
450
+ end
451
+ end
452
+ end
453
+ end
454
+ end
455
+ end
456
+ end
457
+ end
458
+ end
459
+ end
@@ -0,0 +1,143 @@
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/ces/v1/widget_service_pb"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Ces
24
+ module V1
25
+ module WidgetService
26
+ module Rest
27
+ ##
28
+ # REST service stub for the WidgetService service.
29
+ # Service stub contains baseline method implementations
30
+ # including transcoding, making the REST call, and deserialing the response.
31
+ #
32
+ class ServiceStub
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
+ # These require statements are intentionally placed here to initialize
36
+ # the REST modules only when it's required.
37
+ require "gapic/rest"
38
+
39
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
40
+ endpoint_template: endpoint_template,
41
+ universe_domain: universe_domain,
42
+ credentials: credentials,
43
+ numeric_enums: true,
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
47
+ end
48
+
49
+ ##
50
+ # The effective universe domain
51
+ #
52
+ # @return [String]
53
+ #
54
+ def universe_domain
55
+ @client_stub.universe_domain
56
+ end
57
+
58
+ ##
59
+ # The effective endpoint
60
+ #
61
+ # @return [String]
62
+ #
63
+ def endpoint
64
+ @client_stub.endpoint
65
+ end
66
+
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
76
+ ##
77
+ # Baseline implementation for the generate_chat_token REST call
78
+ #
79
+ # @param request_pb [::Google::Cloud::Ces::V1::GenerateChatTokenRequest]
80
+ # A request object representing the call parameters. Required.
81
+ # @param options [::Gapic::CallOptions]
82
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
83
+ #
84
+ # @yield [result, operation] Access the result along with the TransportOperation object
85
+ # @yieldparam result [::Google::Cloud::Ces::V1::GenerateChatTokenResponse]
86
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
87
+ #
88
+ # @return [::Google::Cloud::Ces::V1::GenerateChatTokenResponse]
89
+ # A result object deserialized from the server's reply
90
+ def generate_chat_token request_pb, options = nil
91
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
92
+
93
+ verb, uri, query_string_params, body = ServiceStub.transcode_generate_chat_token_request request_pb
94
+ query_string_params = if query_string_params.any?
95
+ query_string_params.to_h { |p| p.split "=", 2 }
96
+ else
97
+ {}
98
+ end
99
+
100
+ response = @client_stub.make_http_request(
101
+ verb,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "generate_chat_token",
106
+ options: options
107
+ )
108
+ operation = ::Gapic::Rest::TransportOperation.new response
109
+ result = ::Google::Cloud::Ces::V1::GenerateChatTokenResponse.decode_json response.body, ignore_unknown_fields: true
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
114
+ end
115
+
116
+ ##
117
+ # @private
118
+ #
119
+ # GRPC transcoding helper method for the generate_chat_token REST call
120
+ #
121
+ # @param request_pb [::Google::Cloud::Ces::V1::GenerateChatTokenRequest]
122
+ # A request object representing the call parameters. Required.
123
+ # @return [Array(String, [String, nil], Hash{String => String})]
124
+ # Uri, Body, Query string parameters
125
+ def self.transcode_generate_chat_token_request request_pb
126
+ transcoder = Gapic::Rest::GrpcTranscoder.new
127
+ .with_bindings(
128
+ uri_method: :post,
129
+ uri_template: "/v1/{name}:generateChatToken",
130
+ body: "*",
131
+ matches: [
132
+ ["name", %r{^projects/[^/]+/locations/[^/]+/apps/[^/]+/sessions/[^/]+/?$}, false]
133
+ ]
134
+ )
135
+ transcoder.transcode request_pb
136
+ end
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
@@ -0,0 +1,53 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/ces/v1/version"
24
+ require "google/cloud/ces/v1/bindings_override"
25
+
26
+ require "google/cloud/ces/v1/widget_service/credentials"
27
+ require "google/cloud/ces/v1/widget_service/paths"
28
+ require "google/cloud/ces/v1/widget_service/rest/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Ces
33
+ module V1
34
+ ##
35
+ # Provides APIs for widgets to interact with CES APIs.
36
+ #
37
+ # To load this service and instantiate a REST client:
38
+ #
39
+ # require "google/cloud/ces/v1/widget_service/rest"
40
+ # client = ::Google::Cloud::Ces::V1::WidgetService::Rest::Client.new
41
+ #
42
+ module WidgetService
43
+ # Client for the REST transport
44
+ module Rest
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
53
+ require "google/cloud/ces/v1/widget_service/rest/helpers" if ::File.file? helper_path