google-cloud-ces-v1beta 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 (157) 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_pb.rb +30 -0
  6. data/lib/google/cloud/ces/v1beta/agent_service/client.rb +5635 -0
  7. data/lib/google/cloud/ces/v1beta/agent_service/credentials.rb +48 -0
  8. data/lib/google/cloud/ces/v1beta/agent_service/operations.rb +841 -0
  9. data/lib/google/cloud/ces/v1beta/agent_service/paths.rb +481 -0
  10. data/lib/google/cloud/ces/v1beta/agent_service/rest/client.rb +5243 -0
  11. data/lib/google/cloud/ces/v1beta/agent_service/rest/operations.rb +925 -0
  12. data/lib/google/cloud/ces/v1beta/agent_service/rest/service_stub.rb +3213 -0
  13. data/lib/google/cloud/ces/v1beta/agent_service/rest.rb +55 -0
  14. data/lib/google/cloud/ces/v1beta/agent_service.rb +57 -0
  15. data/lib/google/cloud/ces/v1beta/agent_service_pb.rb +131 -0
  16. data/lib/google/cloud/ces/v1beta/agent_service_services_pb.rb +148 -0
  17. data/lib/google/cloud/ces/v1beta/agent_tool_pb.rb +24 -0
  18. data/lib/google/cloud/ces/v1beta/agent_transfers_pb.rb +29 -0
  19. data/lib/google/cloud/ces/v1beta/app_pb.rb +67 -0
  20. data/lib/google/cloud/ces/v1beta/app_version_pb.rb +32 -0
  21. data/lib/google/cloud/ces/v1beta/auth_pb.rb +34 -0
  22. data/lib/google/cloud/ces/v1beta/bigquery_export_pb.rb +23 -0
  23. data/lib/google/cloud/ces/v1beta/bindings_override.rb +75 -0
  24. data/lib/google/cloud/ces/v1beta/changelog_pb.rb +26 -0
  25. data/lib/google/cloud/ces/v1beta/client_function_pb.rb +24 -0
  26. data/lib/google/cloud/ces/v1beta/common_pb.rb +46 -0
  27. data/lib/google/cloud/ces/v1beta/connector_tool_pb.rb +27 -0
  28. data/lib/google/cloud/ces/v1beta/connector_toolset_pb.rb +25 -0
  29. data/lib/google/cloud/ces/v1beta/conversation_pb.rb +31 -0
  30. data/lib/google/cloud/ces/v1beta/data_store_pb.rb +27 -0
  31. data/lib/google/cloud/ces/v1beta/data_store_tool_pb.rb +40 -0
  32. data/lib/google/cloud/ces/v1beta/deployment_pb.rb +26 -0
  33. data/lib/google/cloud/ces/v1beta/evaluation_pb.rb +98 -0
  34. data/lib/google/cloud/ces/v1beta/evaluation_service/client.rb +3732 -0
  35. data/lib/google/cloud/ces/v1beta/evaluation_service/credentials.rb +48 -0
  36. data/lib/google/cloud/ces/v1beta/evaluation_service/operations.rb +841 -0
  37. data/lib/google/cloud/ces/v1beta/evaluation_service/paths.rb +306 -0
  38. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/client.rb +3473 -0
  39. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/operations.rb +925 -0
  40. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/service_stub.rb +2047 -0
  41. data/lib/google/cloud/ces/v1beta/evaluation_service/rest.rb +54 -0
  42. data/lib/google/cloud/ces/v1beta/evaluation_service.rb +56 -0
  43. data/lib/google/cloud/ces/v1beta/evaluation_service_pb.rb +86 -0
  44. data/lib/google/cloud/ces/v1beta/evaluation_service_services_pb.rb +110 -0
  45. data/lib/google/cloud/ces/v1beta/example_pb.rb +34 -0
  46. data/lib/google/cloud/ces/v1beta/fakes_pb.rb +25 -0
  47. data/lib/google/cloud/ces/v1beta/file_context_pb.rb +24 -0
  48. data/lib/google/cloud/ces/v1beta/file_search_tool_pb.rb +24 -0
  49. data/lib/google/cloud/ces/v1beta/golden_run_pb.rb +21 -0
  50. data/lib/google/cloud/ces/v1beta/google_search_tool_pb.rb +24 -0
  51. data/lib/google/cloud/ces/v1beta/guardrail_pb.rb +37 -0
  52. data/lib/google/cloud/ces/v1beta/mcp_tool_pb.rb +26 -0
  53. data/lib/google/cloud/ces/v1beta/mcp_toolset_pb.rb +25 -0
  54. data/lib/google/cloud/ces/v1beta/mocks_pb.rb +26 -0
  55. data/lib/google/cloud/ces/v1beta/omnichannel_pb.rb +31 -0
  56. data/lib/google/cloud/ces/v1beta/omnichannel_service_pb.rb +27 -0
  57. data/lib/google/cloud/ces/v1beta/open_api_tool_pb.rb +25 -0
  58. data/lib/google/cloud/ces/v1beta/open_api_toolset_pb.rb +25 -0
  59. data/lib/google/cloud/ces/v1beta/python_function_pb.rb +23 -0
  60. data/lib/google/cloud/ces/v1beta/rest.rb +42 -0
  61. data/lib/google/cloud/ces/v1beta/schema_pb.rb +25 -0
  62. data/lib/google/cloud/ces/v1beta/search_suggestions_pb.rb +22 -0
  63. data/lib/google/cloud/ces/v1beta/security_settings_pb.rb +27 -0
  64. data/lib/google/cloud/ces/v1beta/session_service/client.rb +760 -0
  65. data/lib/google/cloud/ces/v1beta/session_service/credentials.rb +48 -0
  66. data/lib/google/cloud/ces/v1beta/session_service/paths.rb +117 -0
  67. data/lib/google/cloud/ces/v1beta/session_service/rest/client.rb +560 -0
  68. data/lib/google/cloud/ces/v1beta/session_service/rest/service_stub.rb +199 -0
  69. data/lib/google/cloud/ces/v1beta/session_service/rest.rb +53 -0
  70. data/lib/google/cloud/ces/v1beta/session_service.rb +55 -0
  71. data/lib/google/cloud/ces/v1beta/session_service_pb.rb +53 -0
  72. data/lib/google/cloud/ces/v1beta/session_service_services_pb.rb +120 -0
  73. data/lib/google/cloud/ces/v1beta/system_tool_pb.rb +23 -0
  74. data/lib/google/cloud/ces/v1beta/tool_pb.rb +38 -0
  75. data/lib/google/cloud/ces/v1beta/tool_service/client.rb +727 -0
  76. data/lib/google/cloud/ces/v1beta/tool_service/credentials.rb +48 -0
  77. data/lib/google/cloud/ces/v1beta/tool_service/paths.rb +94 -0
  78. data/lib/google/cloud/ces/v1beta/tool_service/rest/client.rb +671 -0
  79. data/lib/google/cloud/ces/v1beta/tool_service/rest/service_stub.rb +267 -0
  80. data/lib/google/cloud/ces/v1beta/tool_service/rest.rb +53 -0
  81. data/lib/google/cloud/ces/v1beta/tool_service.rb +55 -0
  82. data/lib/google/cloud/ces/v1beta/tool_service_pb.rb +36 -0
  83. data/lib/google/cloud/ces/v1beta/tool_service_services_pb.rb +50 -0
  84. data/lib/google/cloud/ces/v1beta/toolset_pb.rb +30 -0
  85. data/lib/google/cloud/ces/v1beta/toolset_tool_pb.rb +24 -0
  86. data/lib/google/cloud/ces/v1beta/version.rb +7 -2
  87. data/lib/google/cloud/ces/v1beta/widget_service/client.rb +501 -0
  88. data/lib/google/cloud/ces/v1beta/widget_service/credentials.rb +48 -0
  89. data/lib/google/cloud/ces/v1beta/widget_service/paths.rb +75 -0
  90. data/lib/google/cloud/ces/v1beta/widget_service/rest/client.rb +459 -0
  91. data/lib/google/cloud/ces/v1beta/widget_service/rest/service_stub.rb +143 -0
  92. data/lib/google/cloud/ces/v1beta/widget_service/rest.rb +53 -0
  93. data/lib/google/cloud/ces/v1beta/widget_service.rb +55 -0
  94. data/lib/google/cloud/ces/v1beta/widget_service_pb.rb +28 -0
  95. data/lib/google/cloud/ces/v1beta/widget_service_services_pb.rb +46 -0
  96. data/lib/google/cloud/ces/v1beta/widget_tool_pb.rb +29 -0
  97. data/lib/google/cloud/ces/v1beta.rb +49 -0
  98. data/lib/google-cloud-ces-v1beta.rb +21 -0
  99. data/proto_docs/README.md +4 -0
  100. data/proto_docs/google/api/client.rb +593 -0
  101. data/proto_docs/google/api/field_behavior.rb +85 -0
  102. data/proto_docs/google/api/launch_stage.rb +71 -0
  103. data/proto_docs/google/api/resource.rb +227 -0
  104. data/proto_docs/google/cloud/ces/v1beta/agent.rb +224 -0
  105. data/proto_docs/google/cloud/ces/v1beta/agent_service.rb +1661 -0
  106. data/proto_docs/google/cloud/ces/v1beta/agent_tool.rb +48 -0
  107. data/proto_docs/google/cloud/ces/v1beta/agent_transfers.rb +111 -0
  108. data/proto_docs/google/cloud/ces/v1beta/app.rb +836 -0
  109. data/proto_docs/google/cloud/ces/v1beta/app_version.rb +83 -0
  110. data/proto_docs/google/cloud/ces/v1beta/auth.rb +214 -0
  111. data/proto_docs/google/cloud/ces/v1beta/bigquery_export.rb +45 -0
  112. data/proto_docs/google/cloud/ces/v1beta/changelog.rb +73 -0
  113. data/proto_docs/google/cloud/ces/v1beta/client_function.rb +48 -0
  114. data/proto_docs/google/cloud/ces/v1beta/common.rb +375 -0
  115. data/proto_docs/google/cloud/ces/v1beta/connector_tool.rb +122 -0
  116. data/proto_docs/google/cloud/ces/v1beta/connector_toolset.rb +52 -0
  117. data/proto_docs/google/cloud/ces/v1beta/conversation.rb +156 -0
  118. data/proto_docs/google/cloud/ces/v1beta/data_store.rb +102 -0
  119. data/proto_docs/google/cloud/ces/v1beta/data_store_tool.rb +328 -0
  120. data/proto_docs/google/cloud/ces/v1beta/deployment.rb +62 -0
  121. data/proto_docs/google/cloud/ces/v1beta/evaluation.rb +1618 -0
  122. data/proto_docs/google/cloud/ces/v1beta/evaluation_service.rb +1009 -0
  123. data/proto_docs/google/cloud/ces/v1beta/example.rb +245 -0
  124. data/proto_docs/google/cloud/ces/v1beta/fakes.rb +67 -0
  125. data/proto_docs/google/cloud/ces/v1beta/file_context.rb +50 -0
  126. data/proto_docs/google/cloud/ces/v1beta/file_search_tool.rb +60 -0
  127. data/proto_docs/google/cloud/ces/v1beta/golden_run.rb +40 -0
  128. data/proto_docs/google/cloud/ces/v1beta/google_search_tool.rb +76 -0
  129. data/proto_docs/google/cloud/ces/v1beta/guardrail.rb +324 -0
  130. data/proto_docs/google/cloud/ces/v1beta/mcp_tool.rb +85 -0
  131. data/proto_docs/google/cloud/ces/v1beta/mcp_toolset.rb +71 -0
  132. data/proto_docs/google/cloud/ces/v1beta/mocks.rb +60 -0
  133. data/proto_docs/google/cloud/ces/v1beta/omnichannel.rb +163 -0
  134. data/proto_docs/google/cloud/ces/v1beta/omnichannel_service.rb +45 -0
  135. data/proto_docs/google/cloud/ces/v1beta/open_api_tool.rb +66 -0
  136. data/proto_docs/google/cloud/ces/v1beta/open_api_toolset.rb +57 -0
  137. data/proto_docs/google/cloud/ces/v1beta/python_function.rb +44 -0
  138. data/proto_docs/google/cloud/ces/v1beta/schema.rb +162 -0
  139. data/proto_docs/google/cloud/ces/v1beta/search_suggestions.rb +55 -0
  140. data/proto_docs/google/cloud/ces/v1beta/security_settings.rb +80 -0
  141. data/proto_docs/google/cloud/ces/v1beta/session_service.rb +490 -0
  142. data/proto_docs/google/cloud/ces/v1beta/system_tool.rb +38 -0
  143. data/proto_docs/google/cloud/ces/v1beta/tool.rb +126 -0
  144. data/proto_docs/google/cloud/ces/v1beta/tool_service.rb +173 -0
  145. data/proto_docs/google/cloud/ces/v1beta/toolset.rb +80 -0
  146. data/proto_docs/google/cloud/ces/v1beta/toolset_tool.rb +40 -0
  147. data/proto_docs/google/cloud/ces/v1beta/widget_service.rb +62 -0
  148. data/proto_docs/google/cloud/ces/v1beta/widget_tool.rb +146 -0
  149. data/proto_docs/google/longrunning/operations.rb +191 -0
  150. data/proto_docs/google/protobuf/any.rb +145 -0
  151. data/proto_docs/google/protobuf/duration.rb +98 -0
  152. data/proto_docs/google/protobuf/empty.rb +34 -0
  153. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  154. data/proto_docs/google/protobuf/struct.rb +108 -0
  155. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  156. data/proto_docs/google/rpc/status.rb +48 -0
  157. metadata +204 -9
@@ -0,0 +1,501 @@
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/widget_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Ces
26
+ module V1beta
27
+ module WidgetService
28
+ ##
29
+ # Client for the WidgetService service.
30
+ #
31
+ # Provides APIs for widgets to interact with CES APIs.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "ces.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :widget_service_stub
44
+
45
+ ##
46
+ # Configure the WidgetService Client class.
47
+ #
48
+ # See {::Google::Cloud::Ces::V1beta::WidgetService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all WidgetService clients
54
+ # ::Google::Cloud::Ces::V1beta::WidgetService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Ces", "V1beta"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the WidgetService Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::Ces::V1beta::WidgetService::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @widget_service_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new WidgetService client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::Ces::V1beta::WidgetService::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Ces::V1beta::WidgetService::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the WidgetService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/ces/v1beta/widget_service_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+ @quota_project_id = @config.quota_project
151
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
152
+
153
+ @widget_service_stub = ::Gapic::ServiceStub.new(
154
+ ::Google::Cloud::Ces::V1beta::WidgetService::Stub,
155
+ credentials: credentials,
156
+ endpoint: @config.endpoint,
157
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
+ universe_domain: @config.universe_domain,
159
+ channel_args: @config.channel_args,
160
+ interceptors: @config.interceptors,
161
+ channel_pool_config: @config.channel_pool,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @widget_service_stub.stub_logger&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
175
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
176
+ config.credentials = credentials
177
+ config.quota_project = @quota_project_id
178
+ config.endpoint = @widget_service_stub.endpoint
179
+ config.universe_domain = @widget_service_stub.universe_domain
180
+ config.logger = @widget_service_stub.logger if config.respond_to? :logger=
181
+ end
182
+ end
183
+
184
+ ##
185
+ # Get the associated client for mix-in of the Locations.
186
+ #
187
+ # @return [Google::Cloud::Location::Locations::Client]
188
+ #
189
+ attr_reader :location_client
190
+
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @widget_service_stub.logger
198
+ end
199
+
200
+ # Service calls
201
+
202
+ ##
203
+ # Generates a session scoped token for chat widget to authenticate with
204
+ # Session APIs.
205
+ #
206
+ # @overload generate_chat_token(request, options = nil)
207
+ # Pass arguments to `generate_chat_token` via a request object, either of type
208
+ # {::Google::Cloud::Ces::V1beta::GenerateChatTokenRequest} or an equivalent Hash.
209
+ #
210
+ # @param request [::Google::Cloud::Ces::V1beta::GenerateChatTokenRequest, ::Hash]
211
+ # A request object representing the call parameters. Required. To specify no
212
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
213
+ # @param options [::Gapic::CallOptions, ::Hash]
214
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
215
+ #
216
+ # @overload generate_chat_token(name: nil, deployment: nil, recaptcha_token: nil, live_handoff_enabled: nil)
217
+ # Pass arguments to `generate_chat_token` via keyword arguments. Note that at
218
+ # least one keyword argument is required. To specify no parameters, or to keep all
219
+ # the default parameter values, pass an empty Hash as a request object (see above).
220
+ #
221
+ # @param name [::String]
222
+ # Required. The session name to generate the chat token for.
223
+ # Format:
224
+ # projects/\\{project}/locations/\\{location}/apps/\\{app}/sessions/\\{session}
225
+ # @param deployment [::String]
226
+ # Required. The deployment of the app to use for the session.
227
+ # Format:
228
+ # projects/\\{project}/locations/\\{location}/apps/\\{app}/deployments/\\{deployment}
229
+ # @param recaptcha_token [::String]
230
+ # Optional. The reCAPTCHA token generated by the client-side chat widget.
231
+ # @param live_handoff_enabled [::Boolean]
232
+ # Optional. Indicates if live handoff is enabled for the session.
233
+ #
234
+ # @yield [response, operation] Access the result along with the RPC operation
235
+ # @yieldparam response [::Google::Cloud::Ces::V1beta::GenerateChatTokenResponse]
236
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
237
+ #
238
+ # @return [::Google::Cloud::Ces::V1beta::GenerateChatTokenResponse]
239
+ #
240
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
241
+ #
242
+ # @example Basic example
243
+ # require "google/cloud/ces/v1beta"
244
+ #
245
+ # # Create a client object. The client can be reused for multiple calls.
246
+ # client = Google::Cloud::Ces::V1beta::WidgetService::Client.new
247
+ #
248
+ # # Create a request. To set request fields, pass in keyword arguments.
249
+ # request = Google::Cloud::Ces::V1beta::GenerateChatTokenRequest.new
250
+ #
251
+ # # Call the generate_chat_token method.
252
+ # result = client.generate_chat_token request
253
+ #
254
+ # # The returned object is of type Google::Cloud::Ces::V1beta::GenerateChatTokenResponse.
255
+ # p result
256
+ #
257
+ def generate_chat_token request, options = nil
258
+ raise ::ArgumentError, "request must be provided" if request.nil?
259
+
260
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::GenerateChatTokenRequest
261
+
262
+ # Converts hash and nil to an options object
263
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
264
+
265
+ # Customize the options with defaults
266
+ metadata = @config.rpcs.generate_chat_token.metadata.to_h
267
+
268
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
269
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
270
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
271
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION
272
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
273
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
274
+
275
+ header_params = {}
276
+ if request.name
277
+ header_params["name"] = request.name
278
+ end
279
+
280
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
281
+ metadata[:"x-goog-request-params"] ||= request_params_header
282
+
283
+ options.apply_defaults timeout: @config.rpcs.generate_chat_token.timeout,
284
+ metadata: metadata,
285
+ retry_policy: @config.rpcs.generate_chat_token.retry_policy
286
+
287
+ options.apply_defaults timeout: @config.timeout,
288
+ metadata: @config.metadata,
289
+ retry_policy: @config.retry_policy
290
+
291
+ @widget_service_stub.call_rpc :generate_chat_token, request, options: options do |response, operation|
292
+ yield response, operation if block_given?
293
+ end
294
+ rescue ::GRPC::BadStatus => e
295
+ raise ::Google::Cloud::Error.from_error(e)
296
+ end
297
+
298
+ ##
299
+ # Configuration class for the WidgetService API.
300
+ #
301
+ # This class represents the configuration for WidgetService,
302
+ # providing control over timeouts, retry behavior, logging, transport
303
+ # parameters, and other low-level controls. Certain parameters can also be
304
+ # applied individually to specific RPCs. See
305
+ # {::Google::Cloud::Ces::V1beta::WidgetService::Client::Configuration::Rpcs}
306
+ # for a list of RPCs that can be configured independently.
307
+ #
308
+ # Configuration can be applied globally to all clients, or to a single client
309
+ # on construction.
310
+ #
311
+ # @example
312
+ #
313
+ # # Modify the global config, setting the timeout for
314
+ # # generate_chat_token to 20 seconds,
315
+ # # and all remaining timeouts to 10 seconds.
316
+ # ::Google::Cloud::Ces::V1beta::WidgetService::Client.configure do |config|
317
+ # config.timeout = 10.0
318
+ # config.rpcs.generate_chat_token.timeout = 20.0
319
+ # end
320
+ #
321
+ # # Apply the above configuration only to a new client.
322
+ # client = ::Google::Cloud::Ces::V1beta::WidgetService::Client.new do |config|
323
+ # config.timeout = 10.0
324
+ # config.rpcs.generate_chat_token.timeout = 20.0
325
+ # end
326
+ #
327
+ # @!attribute [rw] endpoint
328
+ # A custom service endpoint, as a hostname or hostname:port. The default is
329
+ # nil, indicating to use the default endpoint in the current universe domain.
330
+ # @return [::String,nil]
331
+ # @!attribute [rw] credentials
332
+ # Credentials to send with calls. You may provide any of the following types:
333
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
334
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
335
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
336
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
337
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
338
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
339
+ # * (`nil`) indicating no credentials
340
+ #
341
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
342
+ # is deprecated. Providing an unvalidated credential configuration to
343
+ # Google APIs can compromise the security of your systems and data.
344
+ #
345
+ # @example
346
+ #
347
+ # # The recommended way to provide credentials is to use the `make_creds` method
348
+ # # on the appropriate credentials class for your environment.
349
+ #
350
+ # require "googleauth"
351
+ #
352
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
353
+ # json_key_io: ::File.open("/path/to/keyfile.json")
354
+ # )
355
+ #
356
+ # client = ::Google::Cloud::Ces::V1beta::WidgetService::Client.new do |config|
357
+ # config.credentials = credentials
358
+ # end
359
+ #
360
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
361
+ # external source for authentication to Google Cloud, you must validate it before
362
+ # providing it to a Google API client library. Providing an unvalidated credential
363
+ # configuration to Google APIs can compromise the security of your systems and data.
364
+ # For more information, refer to [Validate credential configurations from external
365
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
366
+ # @return [::Object]
367
+ # @!attribute [rw] scope
368
+ # The OAuth scopes
369
+ # @return [::Array<::String>]
370
+ # @!attribute [rw] lib_name
371
+ # The library name as recorded in instrumentation and logging
372
+ # @return [::String]
373
+ # @!attribute [rw] lib_version
374
+ # The library version as recorded in instrumentation and logging
375
+ # @return [::String]
376
+ # @!attribute [rw] channel_args
377
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
378
+ # `GRPC::Core::Channel` object is provided as the credential.
379
+ # @return [::Hash]
380
+ # @!attribute [rw] interceptors
381
+ # An array of interceptors that are run before calls are executed.
382
+ # @return [::Array<::GRPC::ClientInterceptor>]
383
+ # @!attribute [rw] timeout
384
+ # The call timeout in seconds.
385
+ # @return [::Numeric]
386
+ # @!attribute [rw] metadata
387
+ # Additional gRPC headers to be sent with the call.
388
+ # @return [::Hash{::Symbol=>::String}]
389
+ # @!attribute [rw] retry_policy
390
+ # The retry policy. The value is a hash with the following keys:
391
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
392
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
393
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
394
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
395
+ # trigger a retry.
396
+ # @return [::Hash]
397
+ # @!attribute [rw] quota_project
398
+ # A separate project against which to charge quota.
399
+ # @return [::String]
400
+ # @!attribute [rw] universe_domain
401
+ # The universe domain within which to make requests. This determines the
402
+ # default endpoint URL. The default value of nil uses the environment
403
+ # universe (usually the default "googleapis.com" universe).
404
+ # @return [::String,nil]
405
+ # @!attribute [rw] logger
406
+ # A custom logger to use for request/response debug logging, or the value
407
+ # `:default` (the default) to construct a default logger, or `nil` to
408
+ # explicitly disable logging.
409
+ # @return [::Logger,:default,nil]
410
+ #
411
+ class Configuration
412
+ extend ::Gapic::Config
413
+
414
+ # @private
415
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
416
+ DEFAULT_ENDPOINT = "ces.googleapis.com"
417
+
418
+ config_attr :endpoint, nil, ::String, nil
419
+ config_attr :credentials, nil do |value|
420
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
421
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
422
+ allowed.any? { |klass| klass === value }
423
+ end
424
+ config_attr :scope, nil, ::String, ::Array, nil
425
+ config_attr :lib_name, nil, ::String, nil
426
+ config_attr :lib_version, nil, ::String, nil
427
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
428
+ config_attr :interceptors, nil, ::Array, nil
429
+ config_attr :timeout, nil, ::Numeric, nil
430
+ config_attr :metadata, nil, ::Hash, nil
431
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
432
+ config_attr :quota_project, nil, ::String, nil
433
+ config_attr :universe_domain, nil, ::String, nil
434
+ config_attr :logger, :default, ::Logger, nil, :default
435
+
436
+ # @private
437
+ def initialize parent_config = nil
438
+ @parent_config = parent_config unless parent_config.nil?
439
+
440
+ yield self if block_given?
441
+ end
442
+
443
+ ##
444
+ # Configurations for individual RPCs
445
+ # @return [Rpcs]
446
+ #
447
+ def rpcs
448
+ @rpcs ||= begin
449
+ parent_rpcs = nil
450
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
451
+ Rpcs.new parent_rpcs
452
+ end
453
+ end
454
+
455
+ ##
456
+ # Configuration for the channel pool
457
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
458
+ #
459
+ def channel_pool
460
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
461
+ end
462
+
463
+ ##
464
+ # Configuration RPC class for the WidgetService API.
465
+ #
466
+ # Includes fields providing the configuration for each RPC in this service.
467
+ # Each configuration object is of type `Gapic::Config::Method` and includes
468
+ # the following configuration fields:
469
+ #
470
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
471
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
472
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
473
+ # include the following keys:
474
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
475
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
476
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
477
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
478
+ # trigger a retry.
479
+ #
480
+ class Rpcs
481
+ ##
482
+ # RPC-specific configuration for `generate_chat_token`
483
+ # @return [::Gapic::Config::Method]
484
+ #
485
+ attr_reader :generate_chat_token
486
+
487
+ # @private
488
+ def initialize parent_rpcs = nil
489
+ generate_chat_token_config = parent_rpcs.generate_chat_token if parent_rpcs.respond_to? :generate_chat_token
490
+ @generate_chat_token = ::Gapic::Config::Method.new generate_chat_token_config
491
+
492
+ yield self if block_given?
493
+ end
494
+ end
495
+ end
496
+ end
497
+ end
498
+ end
499
+ end
500
+ end
501
+ end
@@ -0,0 +1,48 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Ces
24
+ module V1beta
25
+ module WidgetService
26
+ # Credentials for the WidgetService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/ces",
30
+ "https://www.googleapis.com/auth/cloud-platform"
31
+ ]
32
+ self.env_vars = [
33
+ "GOOGLE_CLOUD_CREDENTIALS",
34
+ "GOOGLE_CLOUD_KEYFILE",
35
+ "GCLOUD_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
37
+ "GOOGLE_CLOUD_KEYFILE_JSON",
38
+ "GCLOUD_KEYFILE_JSON"
39
+ ]
40
+ self.paths = [
41
+ "~/.config/google_cloud/application_default_credentials.json"
42
+ ]
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,75 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module Ces
23
+ module V1beta
24
+ module WidgetService
25
+ # Path helper methods for the WidgetService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Deployment resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param app [String]
37
+ # @param deployment [String]
38
+ #
39
+ # @return [::String]
40
+ def deployment_path project:, location:, app:, deployment:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+ raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/"
44
+
45
+ "projects/#{project}/locations/#{location}/apps/#{app}/deployments/#{deployment}"
46
+ end
47
+
48
+ ##
49
+ # Create a fully-qualified Session resource string.
50
+ #
51
+ # The resource will be in the following format:
52
+ #
53
+ # `projects/{project}/locations/{location}/apps/{app}/sessions/{session}`
54
+ #
55
+ # @param project [String]
56
+ # @param location [String]
57
+ # @param app [String]
58
+ # @param session [String]
59
+ #
60
+ # @return [::String]
61
+ def session_path project:, location:, app:, session:
62
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
63
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
64
+ raise ::ArgumentError, "app cannot contain /" if app.to_s.include? "/"
65
+
66
+ "projects/#{project}/locations/#{location}/apps/#{app}/sessions/#{session}"
67
+ end
68
+
69
+ extend self
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end