google-cloud-dialogflow-cx-v3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +139 -0
  6. data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +32 -0
  7. data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +122 -0
  8. data/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb +82 -0
  9. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +1051 -0
  10. data/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb +54 -0
  11. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +666 -0
  12. data/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +151 -0
  13. data/lib/google/cloud/dialogflow/cx/v3/agents.rb +52 -0
  14. data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +94 -0
  15. data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +92 -0
  16. data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +67 -0
  17. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +766 -0
  18. data/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb +54 -0
  19. data/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb +75 -0
  20. data/lib/google/cloud/dialogflow/cx/v3/entity_types.rb +51 -0
  21. data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +117 -0
  22. data/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb +61 -0
  23. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +950 -0
  24. data/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb +54 -0
  25. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +666 -0
  26. data/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb +98 -0
  27. data/lib/google/cloud/dialogflow/cx/v3/environments.rb +52 -0
  28. data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +177 -0
  29. data/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb +61 -0
  30. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +851 -0
  31. data/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb +54 -0
  32. data/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb +102 -0
  33. data/lib/google/cloud/dialogflow/cx/v3/experiments.rb +51 -0
  34. data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +145 -0
  35. data/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb +88 -0
  36. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +1200 -0
  37. data/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb +54 -0
  38. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +666 -0
  39. data/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb +184 -0
  40. data/lib/google/cloud/dialogflow/cx/v3/flows.rb +52 -0
  41. data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +55 -0
  42. data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +97 -0
  43. data/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb +67 -0
  44. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +750 -0
  45. data/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb +54 -0
  46. data/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb +96 -0
  47. data/lib/google/cloud/dialogflow/cx/v3/intents.rb +51 -0
  48. data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +113 -0
  49. data/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb +67 -0
  50. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +805 -0
  51. data/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb +54 -0
  52. data/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb +165 -0
  53. data/lib/google/cloud/dialogflow/cx/v3/pages.rb +51 -0
  54. data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +77 -0
  55. data/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +89 -0
  56. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +696 -0
  57. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb +54 -0
  58. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb +157 -0
  59. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb +51 -0
  60. data/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb +56 -0
  61. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb +68 -0
  62. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb +55 -0
  63. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +715 -0
  64. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb +54 -0
  65. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb +137 -0
  66. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb +51 -0
  67. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +209 -0
  68. data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +71 -0
  69. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +654 -0
  70. data/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb +54 -0
  71. data/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb +225 -0
  72. data/lib/google/cloud/dialogflow/cx/v3/sessions.rb +53 -0
  73. data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +302 -0
  74. data/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb +73 -0
  75. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +1324 -0
  76. data/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb +54 -0
  77. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +666 -0
  78. data/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb +249 -0
  79. data/lib/google/cloud/dialogflow/cx/v3/test_cases.rb +53 -0
  80. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +67 -0
  81. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb +67 -0
  82. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +766 -0
  83. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb +54 -0
  84. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb +144 -0
  85. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb +51 -0
  86. data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +59 -0
  87. data/lib/google/cloud/dialogflow/cx/v3/version.rb +30 -0
  88. data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +88 -0
  89. data/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb +57 -0
  90. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +792 -0
  91. data/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb +54 -0
  92. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +666 -0
  93. data/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb +79 -0
  94. data/lib/google/cloud/dialogflow/cx/v3/versions.rb +52 -0
  95. data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +172 -0
  96. data/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb +55 -0
  97. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +704 -0
  98. data/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb +54 -0
  99. data/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb +96 -0
  100. data/lib/google/cloud/dialogflow/cx/v3/webhooks.rb +51 -0
  101. data/lib/google/cloud/dialogflow/cx/v3.rb +53 -0
  102. data/lib/google-cloud-dialogflow-cx-v3.rb +21 -0
  103. data/proto_docs/README.md +4 -0
  104. data/proto_docs/google/api/field_behavior.rb +71 -0
  105. data/proto_docs/google/api/resource.rb +283 -0
  106. data/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +57 -0
  107. data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +301 -0
  108. data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +322 -0
  109. data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +306 -0
  110. data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +279 -0
  111. data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +438 -0
  112. data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +438 -0
  113. data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +126 -0
  114. data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +318 -0
  115. data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +478 -0
  116. data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +220 -0
  117. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +222 -0
  118. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +798 -0
  119. data/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb +184 -0
  120. data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +757 -0
  121. data/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb +195 -0
  122. data/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb +121 -0
  123. data/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +182 -0
  124. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +496 -0
  125. data/proto_docs/google/longrunning/operations.rb +164 -0
  126. data/proto_docs/google/protobuf/any.rb +141 -0
  127. data/proto_docs/google/protobuf/duration.rb +98 -0
  128. data/proto_docs/google/protobuf/empty.rb +36 -0
  129. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  130. data/proto_docs/google/protobuf/struct.rb +96 -0
  131. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  132. data/proto_docs/google/rpc/status.rb +46 -0
  133. data/proto_docs/google/type/latlng.rb +38 -0
  134. metadata +326 -0
@@ -0,0 +1,715 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/dialogflow/cx/v3/session_entity_type_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module SessionEntityTypes
28
+ ##
29
+ # Client for the SessionEntityTypes service.
30
+ #
31
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::SessionEntityType SessionEntityTypes}.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :session_entity_types_stub
38
+
39
+ ##
40
+ # Configure the SessionEntityTypes Client class.
41
+ #
42
+ # See {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all SessionEntityTypes clients
48
+ # ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Dialogflow", "CX", "V3"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.timeout = 60.0
69
+ default_config.retry_policy = {
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
71
+ }
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the SessionEntityTypes Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # Create a new SessionEntityTypes client object.
101
+ #
102
+ # @example
103
+ #
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new
106
+ #
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the SessionEntityTypes client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ def initialize
116
+ # These require statements are intentionally placed here to initialize
117
+ # the gRPC module only when it's required.
118
+ # See https://github.com/googleapis/toolkit/issues/446
119
+ require "gapic/grpc"
120
+ require "google/cloud/dialogflow/cx/v3/session_entity_type_services_pb"
121
+
122
+ # Create the configuration object
123
+ @config = Configuration.new Client.configure
124
+
125
+ # Yield the configuration if needed
126
+ yield @config if block_given?
127
+
128
+ # Create credentials
129
+ credentials = @config.credentials
130
+ # Use self-signed JWT if the endpoint is unchanged from default,
131
+ # but only if the default endpoint does not have a region prefix.
132
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
133
+ !@config.endpoint.split(".").first.include?("-")
134
+ credentials ||= Credentials.default scope: @config.scope,
135
+ enable_self_signed_jwt: enable_self_signed_jwt
136
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
137
+ credentials = Credentials.new credentials, scope: @config.scope
138
+ end
139
+ @quota_project_id = @config.quota_project
140
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
141
+
142
+ @session_entity_types_stub = ::Gapic::ServiceStub.new(
143
+ ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Stub,
144
+ credentials: credentials,
145
+ endpoint: @config.endpoint,
146
+ channel_args: @config.channel_args,
147
+ interceptors: @config.interceptors
148
+ )
149
+ end
150
+
151
+ # Service calls
152
+
153
+ ##
154
+ # Returns the list of all session entity types in the specified session.
155
+ #
156
+ # @overload list_session_entity_types(request, options = nil)
157
+ # Pass arguments to `list_session_entity_types` via a request object, either of type
158
+ # {::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest} or an equivalent Hash.
159
+ #
160
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest, ::Hash]
161
+ # A request object representing the call parameters. Required. To specify no
162
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
163
+ # @param options [::Gapic::CallOptions, ::Hash]
164
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
165
+ #
166
+ # @overload list_session_entity_types(parent: nil, page_size: nil, page_token: nil)
167
+ # Pass arguments to `list_session_entity_types` via keyword arguments. Note that at
168
+ # least one keyword argument is required. To specify no parameters, or to keep all
169
+ # the default parameter values, pass an empty Hash as a request object (see above).
170
+ #
171
+ # @param parent [::String]
172
+ # Required. The session to list all session entity types from.
173
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
174
+ # ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
175
+ # ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
176
+ # If `Environment ID` is not specified, we assume default 'draft'
177
+ # environment.
178
+ # @param page_size [::Integer]
179
+ # The maximum number of items to return in a single page. By default 100 and
180
+ # at most 1000.
181
+ # @param page_token [::String]
182
+ # The next_page_token value returned from a previous list request.
183
+ #
184
+ # @yield [response, operation] Access the result along with the RPC operation
185
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>]
186
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
187
+ #
188
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::SessionEntityType>]
189
+ #
190
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
191
+ #
192
+ def list_session_entity_types request, options = nil
193
+ raise ::ArgumentError, "request must be provided" if request.nil?
194
+
195
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest
196
+
197
+ # Converts hash and nil to an options object
198
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
199
+
200
+ # Customize the options with defaults
201
+ metadata = @config.rpcs.list_session_entity_types.metadata.to_h
202
+
203
+ # Set x-goog-api-client and x-goog-user-project headers
204
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
205
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
206
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
207
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
208
+
209
+ header_params = {
210
+ "parent" => request.parent
211
+ }
212
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
213
+ metadata[:"x-goog-request-params"] ||= request_params_header
214
+
215
+ options.apply_defaults timeout: @config.rpcs.list_session_entity_types.timeout,
216
+ metadata: metadata,
217
+ retry_policy: @config.rpcs.list_session_entity_types.retry_policy
218
+
219
+ options.apply_defaults timeout: @config.timeout,
220
+ metadata: @config.metadata,
221
+ retry_policy: @config.retry_policy
222
+
223
+ @session_entity_types_stub.call_rpc :list_session_entity_types, request, options: options do |response, operation|
224
+ response = ::Gapic::PagedEnumerable.new @session_entity_types_stub, :list_session_entity_types, request, response, operation, options
225
+ yield response, operation if block_given?
226
+ return response
227
+ end
228
+ rescue ::GRPC::BadStatus => e
229
+ raise ::Google::Cloud::Error.from_error(e)
230
+ end
231
+
232
+ ##
233
+ # Retrieves the specified session entity type.
234
+ #
235
+ # @overload get_session_entity_type(request, options = nil)
236
+ # Pass arguments to `get_session_entity_type` via a request object, either of type
237
+ # {::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest} or an equivalent Hash.
238
+ #
239
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest, ::Hash]
240
+ # A request object representing the call parameters. Required. To specify no
241
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
242
+ # @param options [::Gapic::CallOptions, ::Hash]
243
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
244
+ #
245
+ # @overload get_session_entity_type(name: nil)
246
+ # Pass arguments to `get_session_entity_type` via keyword arguments. Note that at
247
+ # least one keyword argument is required. To specify no parameters, or to keep all
248
+ # the default parameter values, pass an empty Hash as a request object (see above).
249
+ #
250
+ # @param name [::String]
251
+ # Required. The name of the session entity type.
252
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
253
+ # ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
254
+ # `projects/<Project ID>/locations/<Location ID>/agents/<Agent
255
+ # ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
256
+ # Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
257
+ # environment.
258
+ #
259
+ # @yield [response, operation] Access the result along with the RPC operation
260
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
261
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
262
+ #
263
+ # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
264
+ #
265
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
266
+ #
267
+ def get_session_entity_type request, options = nil
268
+ raise ::ArgumentError, "request must be provided" if request.nil?
269
+
270
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest
271
+
272
+ # Converts hash and nil to an options object
273
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
274
+
275
+ # Customize the options with defaults
276
+ metadata = @config.rpcs.get_session_entity_type.metadata.to_h
277
+
278
+ # Set x-goog-api-client and x-goog-user-project headers
279
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
280
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
281
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
282
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
283
+
284
+ header_params = {
285
+ "name" => request.name
286
+ }
287
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
288
+ metadata[:"x-goog-request-params"] ||= request_params_header
289
+
290
+ options.apply_defaults timeout: @config.rpcs.get_session_entity_type.timeout,
291
+ metadata: metadata,
292
+ retry_policy: @config.rpcs.get_session_entity_type.retry_policy
293
+
294
+ options.apply_defaults timeout: @config.timeout,
295
+ metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @session_entity_types_stub.call_rpc :get_session_entity_type, request, options: options do |response, operation|
299
+ yield response, operation if block_given?
300
+ return response
301
+ end
302
+ rescue ::GRPC::BadStatus => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Creates a session entity type.
308
+ #
309
+ # @overload create_session_entity_type(request, options = nil)
310
+ # Pass arguments to `create_session_entity_type` via a request object, either of type
311
+ # {::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest} or an equivalent Hash.
312
+ #
313
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest, ::Hash]
314
+ # A request object representing the call parameters. Required. To specify no
315
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
316
+ # @param options [::Gapic::CallOptions, ::Hash]
317
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
318
+ #
319
+ # @overload create_session_entity_type(parent: nil, session_entity_type: nil)
320
+ # Pass arguments to `create_session_entity_type` via keyword arguments. Note that at
321
+ # least one keyword argument is required. To specify no parameters, or to keep all
322
+ # the default parameter values, pass an empty Hash as a request object (see above).
323
+ #
324
+ # @param parent [::String]
325
+ # Required. The session to create a session entity type for.
326
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
327
+ # ID>/sessions/<Session ID>` or `projects/<Project ID>/locations/<Location
328
+ # ID>/agents/<Agent ID>/environments/<Environment ID>/sessions/<Session ID>`.
329
+ # If `Environment ID` is not specified, we assume default 'draft'
330
+ # environment.
331
+ # @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType, ::Hash]
332
+ # Required. The session entity type to create.
333
+ #
334
+ # @yield [response, operation] Access the result along with the RPC operation
335
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
336
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
337
+ #
338
+ # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
339
+ #
340
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
341
+ #
342
+ def create_session_entity_type request, options = nil
343
+ raise ::ArgumentError, "request must be provided" if request.nil?
344
+
345
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest
346
+
347
+ # Converts hash and nil to an options object
348
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
349
+
350
+ # Customize the options with defaults
351
+ metadata = @config.rpcs.create_session_entity_type.metadata.to_h
352
+
353
+ # Set x-goog-api-client and x-goog-user-project headers
354
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
355
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
356
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
357
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
358
+
359
+ header_params = {
360
+ "parent" => request.parent
361
+ }
362
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
363
+ metadata[:"x-goog-request-params"] ||= request_params_header
364
+
365
+ options.apply_defaults timeout: @config.rpcs.create_session_entity_type.timeout,
366
+ metadata: metadata,
367
+ retry_policy: @config.rpcs.create_session_entity_type.retry_policy
368
+
369
+ options.apply_defaults timeout: @config.timeout,
370
+ metadata: @config.metadata,
371
+ retry_policy: @config.retry_policy
372
+
373
+ @session_entity_types_stub.call_rpc :create_session_entity_type, request, options: options do |response, operation|
374
+ yield response, operation if block_given?
375
+ return response
376
+ end
377
+ rescue ::GRPC::BadStatus => e
378
+ raise ::Google::Cloud::Error.from_error(e)
379
+ end
380
+
381
+ ##
382
+ # Updates the specified session entity type.
383
+ #
384
+ # @overload update_session_entity_type(request, options = nil)
385
+ # Pass arguments to `update_session_entity_type` via a request object, either of type
386
+ # {::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest} or an equivalent Hash.
387
+ #
388
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest, ::Hash]
389
+ # A request object representing the call parameters. Required. To specify no
390
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
391
+ # @param options [::Gapic::CallOptions, ::Hash]
392
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
393
+ #
394
+ # @overload update_session_entity_type(session_entity_type: nil, update_mask: nil)
395
+ # Pass arguments to `update_session_entity_type` via keyword arguments. Note that at
396
+ # least one keyword argument is required. To specify no parameters, or to keep all
397
+ # the default parameter values, pass an empty Hash as a request object (see above).
398
+ #
399
+ # @param session_entity_type [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType, ::Hash]
400
+ # Required. The session entity type to update.
401
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
402
+ # ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
403
+ # `projects/<Project ID>/locations/<Location ID>/agents/<Agent
404
+ # ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
405
+ # Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
406
+ # environment.
407
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
408
+ # The mask to control which fields get updated.
409
+ #
410
+ # @yield [response, operation] Access the result along with the RPC operation
411
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
412
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
413
+ #
414
+ # @return [::Google::Cloud::Dialogflow::CX::V3::SessionEntityType]
415
+ #
416
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
417
+ #
418
+ def update_session_entity_type request, options = nil
419
+ raise ::ArgumentError, "request must be provided" if request.nil?
420
+
421
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest
422
+
423
+ # Converts hash and nil to an options object
424
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
425
+
426
+ # Customize the options with defaults
427
+ metadata = @config.rpcs.update_session_entity_type.metadata.to_h
428
+
429
+ # Set x-goog-api-client and x-goog-user-project headers
430
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
432
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
433
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
434
+
435
+ header_params = {
436
+ "session_entity_type.name" => request.session_entity_type.name
437
+ }
438
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
439
+ metadata[:"x-goog-request-params"] ||= request_params_header
440
+
441
+ options.apply_defaults timeout: @config.rpcs.update_session_entity_type.timeout,
442
+ metadata: metadata,
443
+ retry_policy: @config.rpcs.update_session_entity_type.retry_policy
444
+
445
+ options.apply_defaults timeout: @config.timeout,
446
+ metadata: @config.metadata,
447
+ retry_policy: @config.retry_policy
448
+
449
+ @session_entity_types_stub.call_rpc :update_session_entity_type, request, options: options do |response, operation|
450
+ yield response, operation if block_given?
451
+ return response
452
+ end
453
+ rescue ::GRPC::BadStatus => e
454
+ raise ::Google::Cloud::Error.from_error(e)
455
+ end
456
+
457
+ ##
458
+ # Deletes the specified session entity type.
459
+ #
460
+ # @overload delete_session_entity_type(request, options = nil)
461
+ # Pass arguments to `delete_session_entity_type` via a request object, either of type
462
+ # {::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest} or an equivalent Hash.
463
+ #
464
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest, ::Hash]
465
+ # A request object representing the call parameters. Required. To specify no
466
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
467
+ # @param options [::Gapic::CallOptions, ::Hash]
468
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
469
+ #
470
+ # @overload delete_session_entity_type(name: nil)
471
+ # Pass arguments to `delete_session_entity_type` via keyword arguments. Note that at
472
+ # least one keyword argument is required. To specify no parameters, or to keep all
473
+ # the default parameter values, pass an empty Hash as a request object (see above).
474
+ #
475
+ # @param name [::String]
476
+ # Required. The name of the session entity type to delete.
477
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
478
+ # ID>/sessions/<Session ID>/entityTypes/<Entity Type ID>` or
479
+ # `projects/<Project ID>/locations/<Location ID>/agents/<Agent
480
+ # ID>/environments/<Environment ID>/sessions/<Session ID>/entityTypes/<Entity
481
+ # Type ID>`. If `Environment ID` is not specified, we assume default 'draft'
482
+ # environment.
483
+ #
484
+ # @yield [response, operation] Access the result along with the RPC operation
485
+ # @yieldparam response [::Google::Protobuf::Empty]
486
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
487
+ #
488
+ # @return [::Google::Protobuf::Empty]
489
+ #
490
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
491
+ #
492
+ def delete_session_entity_type request, options = nil
493
+ raise ::ArgumentError, "request must be provided" if request.nil?
494
+
495
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest
496
+
497
+ # Converts hash and nil to an options object
498
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
499
+
500
+ # Customize the options with defaults
501
+ metadata = @config.rpcs.delete_session_entity_type.metadata.to_h
502
+
503
+ # Set x-goog-api-client and x-goog-user-project headers
504
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
505
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
506
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
507
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
508
+
509
+ header_params = {
510
+ "name" => request.name
511
+ }
512
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
513
+ metadata[:"x-goog-request-params"] ||= request_params_header
514
+
515
+ options.apply_defaults timeout: @config.rpcs.delete_session_entity_type.timeout,
516
+ metadata: metadata,
517
+ retry_policy: @config.rpcs.delete_session_entity_type.retry_policy
518
+
519
+ options.apply_defaults timeout: @config.timeout,
520
+ metadata: @config.metadata,
521
+ retry_policy: @config.retry_policy
522
+
523
+ @session_entity_types_stub.call_rpc :delete_session_entity_type, request, options: options do |response, operation|
524
+ yield response, operation if block_given?
525
+ return response
526
+ end
527
+ rescue ::GRPC::BadStatus => e
528
+ raise ::Google::Cloud::Error.from_error(e)
529
+ end
530
+
531
+ ##
532
+ # Configuration class for the SessionEntityTypes API.
533
+ #
534
+ # This class represents the configuration for SessionEntityTypes,
535
+ # providing control over timeouts, retry behavior, logging, transport
536
+ # parameters, and other low-level controls. Certain parameters can also be
537
+ # applied individually to specific RPCs. See
538
+ # {::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client::Configuration::Rpcs}
539
+ # for a list of RPCs that can be configured independently.
540
+ #
541
+ # Configuration can be applied globally to all clients, or to a single client
542
+ # on construction.
543
+ #
544
+ # @example
545
+ #
546
+ # # Modify the global config, setting the timeout for
547
+ # # list_session_entity_types to 20 seconds,
548
+ # # and all remaining timeouts to 10 seconds.
549
+ # ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.configure do |config|
550
+ # config.timeout = 10.0
551
+ # config.rpcs.list_session_entity_types.timeout = 20.0
552
+ # end
553
+ #
554
+ # # Apply the above configuration only to a new client.
555
+ # client = ::Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new do |config|
556
+ # config.timeout = 10.0
557
+ # config.rpcs.list_session_entity_types.timeout = 20.0
558
+ # end
559
+ #
560
+ # @!attribute [rw] endpoint
561
+ # The hostname or hostname:port of the service endpoint.
562
+ # Defaults to `"dialogflow.googleapis.com"`.
563
+ # @return [::String]
564
+ # @!attribute [rw] credentials
565
+ # Credentials to send with calls. You may provide any of the following types:
566
+ # * (`String`) The path to a service account key file in JSON format
567
+ # * (`Hash`) A service account key as a Hash
568
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
569
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
570
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
571
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
572
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
573
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
574
+ # * (`nil`) indicating no credentials
575
+ # @return [::Object]
576
+ # @!attribute [rw] scope
577
+ # The OAuth scopes
578
+ # @return [::Array<::String>]
579
+ # @!attribute [rw] lib_name
580
+ # The library name as recorded in instrumentation and logging
581
+ # @return [::String]
582
+ # @!attribute [rw] lib_version
583
+ # The library version as recorded in instrumentation and logging
584
+ # @return [::String]
585
+ # @!attribute [rw] channel_args
586
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
587
+ # `GRPC::Core::Channel` object is provided as the credential.
588
+ # @return [::Hash]
589
+ # @!attribute [rw] interceptors
590
+ # An array of interceptors that are run before calls are executed.
591
+ # @return [::Array<::GRPC::ClientInterceptor>]
592
+ # @!attribute [rw] timeout
593
+ # The call timeout in seconds.
594
+ # @return [::Numeric]
595
+ # @!attribute [rw] metadata
596
+ # Additional gRPC headers to be sent with the call.
597
+ # @return [::Hash{::Symbol=>::String}]
598
+ # @!attribute [rw] retry_policy
599
+ # The retry policy. The value is a hash with the following keys:
600
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
601
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
602
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
603
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
604
+ # trigger a retry.
605
+ # @return [::Hash]
606
+ # @!attribute [rw] quota_project
607
+ # A separate project against which to charge quota.
608
+ # @return [::String]
609
+ #
610
+ class Configuration
611
+ extend ::Gapic::Config
612
+
613
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
614
+ config_attr :credentials, nil do |value|
615
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
616
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
617
+ allowed.any? { |klass| klass === value }
618
+ end
619
+ config_attr :scope, nil, ::String, ::Array, nil
620
+ config_attr :lib_name, nil, ::String, nil
621
+ config_attr :lib_version, nil, ::String, nil
622
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
623
+ config_attr :interceptors, nil, ::Array, nil
624
+ config_attr :timeout, nil, ::Numeric, nil
625
+ config_attr :metadata, nil, ::Hash, nil
626
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
627
+ config_attr :quota_project, nil, ::String, nil
628
+
629
+ # @private
630
+ def initialize parent_config = nil
631
+ @parent_config = parent_config unless parent_config.nil?
632
+
633
+ yield self if block_given?
634
+ end
635
+
636
+ ##
637
+ # Configurations for individual RPCs
638
+ # @return [Rpcs]
639
+ #
640
+ def rpcs
641
+ @rpcs ||= begin
642
+ parent_rpcs = nil
643
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
644
+ Rpcs.new parent_rpcs
645
+ end
646
+ end
647
+
648
+ ##
649
+ # Configuration RPC class for the SessionEntityTypes API.
650
+ #
651
+ # Includes fields providing the configuration for each RPC in this service.
652
+ # Each configuration object is of type `Gapic::Config::Method` and includes
653
+ # the following configuration fields:
654
+ #
655
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
656
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
657
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
658
+ # include the following keys:
659
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
660
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
661
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
662
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
663
+ # trigger a retry.
664
+ #
665
+ class Rpcs
666
+ ##
667
+ # RPC-specific configuration for `list_session_entity_types`
668
+ # @return [::Gapic::Config::Method]
669
+ #
670
+ attr_reader :list_session_entity_types
671
+ ##
672
+ # RPC-specific configuration for `get_session_entity_type`
673
+ # @return [::Gapic::Config::Method]
674
+ #
675
+ attr_reader :get_session_entity_type
676
+ ##
677
+ # RPC-specific configuration for `create_session_entity_type`
678
+ # @return [::Gapic::Config::Method]
679
+ #
680
+ attr_reader :create_session_entity_type
681
+ ##
682
+ # RPC-specific configuration for `update_session_entity_type`
683
+ # @return [::Gapic::Config::Method]
684
+ #
685
+ attr_reader :update_session_entity_type
686
+ ##
687
+ # RPC-specific configuration for `delete_session_entity_type`
688
+ # @return [::Gapic::Config::Method]
689
+ #
690
+ attr_reader :delete_session_entity_type
691
+
692
+ # @private
693
+ def initialize parent_rpcs = nil
694
+ list_session_entity_types_config = parent_rpcs.list_session_entity_types if parent_rpcs.respond_to? :list_session_entity_types
695
+ @list_session_entity_types = ::Gapic::Config::Method.new list_session_entity_types_config
696
+ get_session_entity_type_config = parent_rpcs.get_session_entity_type if parent_rpcs.respond_to? :get_session_entity_type
697
+ @get_session_entity_type = ::Gapic::Config::Method.new get_session_entity_type_config
698
+ create_session_entity_type_config = parent_rpcs.create_session_entity_type if parent_rpcs.respond_to? :create_session_entity_type
699
+ @create_session_entity_type = ::Gapic::Config::Method.new create_session_entity_type_config
700
+ update_session_entity_type_config = parent_rpcs.update_session_entity_type if parent_rpcs.respond_to? :update_session_entity_type
701
+ @update_session_entity_type = ::Gapic::Config::Method.new update_session_entity_type_config
702
+ delete_session_entity_type_config = parent_rpcs.delete_session_entity_type if parent_rpcs.respond_to? :delete_session_entity_type
703
+ @delete_session_entity_type = ::Gapic::Config::Method.new delete_session_entity_type_config
704
+
705
+ yield self if block_given?
706
+ end
707
+ end
708
+ end
709
+ end
710
+ end
711
+ end
712
+ end
713
+ end
714
+ end
715
+ end