google-cloud-dialogflow-v2 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23f87a6406584a8ce3ed90d891e6a83d834ddbdb2f4ba082a07e0b09aa57d0a5
4
- data.tar.gz: cc55c08c88c43b5890c964df5b880f57323165a9142a94de8236c05880d4a94b
3
+ metadata.gz: 2fd0a37beaec6518f58e28845a02c6bcdb5367f5c49e5fd7bcc751bfd68a2a79
4
+ data.tar.gz: 81aee0a4d1d073605d90b60bee483e02364d0672f07c19884d06296de497b2c2
5
5
  SHA512:
6
- metadata.gz: 523cdda865be782ef149d04931046f9633ad73d74f55c9dc62e33caa0a6d65d546c1a67bcb3090807d50d211e2996ddd83493808a49a851b34a5ea1002536912
7
- data.tar.gz: b2f2d2c61a972660f885685244cd004e18273d689800b1d55ced22d378b8592e270f4d7c6edced51fb0dd3cf895b958cbcb2549c513f870761e1f68be3c41a1e
6
+ metadata.gz: c054f75f7b922c0cdb216c3c9dba8faca889d859f226ce775c1c665846e452a8c9b3e11c49537ed493f7a6625f694294ce04a31f4c24a4048fdaed6b604bb034
7
+ data.tar.gz: dcbdd5a1ab9b8e3e41717df1ac5ffe889338bdcef6047bf401e81c7eebdf55da26b4efaeaed8b32f19f511c859b769df88ae77c7b0b3177e853efc9fecb787a4
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/dialogflow/v2/agents"
20
20
  require "google/cloud/dialogflow/v2/contexts"
21
21
  require "google/cloud/dialogflow/v2/entity_types"
22
+ require "google/cloud/dialogflow/v2/environments"
22
23
  require "google/cloud/dialogflow/v2/intents"
23
24
  require "google/cloud/dialogflow/v2/session_entity_types"
24
25
  require "google/cloud/dialogflow/v2/sessions"
@@ -0,0 +1,51 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/dialogflow/v2/environment.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/field_behavior_pb'
8
+ require 'google/api/resource_pb'
9
+ require 'google/protobuf/empty_pb'
10
+ require 'google/protobuf/field_mask_pb'
11
+ require 'google/protobuf/timestamp_pb'
12
+ require 'google/api/client_pb'
13
+ Google::Protobuf::DescriptorPool.generated_pool.build do
14
+ add_file("google/cloud/dialogflow/v2/environment.proto", :syntax => :proto3) do
15
+ add_message "google.cloud.dialogflow.v2.Environment" do
16
+ optional :name, :string, 1
17
+ optional :description, :string, 2
18
+ optional :agent_version, :string, 3
19
+ optional :state, :enum, 4, "google.cloud.dialogflow.v2.Environment.State"
20
+ optional :update_time, :message, 5, "google.protobuf.Timestamp"
21
+ end
22
+ add_enum "google.cloud.dialogflow.v2.Environment.State" do
23
+ value :STATE_UNSPECIFIED, 0
24
+ value :STOPPED, 1
25
+ value :LOADING, 2
26
+ value :RUNNING, 3
27
+ end
28
+ add_message "google.cloud.dialogflow.v2.ListEnvironmentsRequest" do
29
+ optional :parent, :string, 1
30
+ optional :page_size, :int32, 2
31
+ optional :page_token, :string, 3
32
+ end
33
+ add_message "google.cloud.dialogflow.v2.ListEnvironmentsResponse" do
34
+ repeated :environments, :message, 1, "google.cloud.dialogflow.v2.Environment"
35
+ optional :next_page_token, :string, 2
36
+ end
37
+ end
38
+ end
39
+
40
+ module Google
41
+ module Cloud
42
+ module Dialogflow
43
+ module V2
44
+ Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Environment").msgclass
45
+ Environment::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Environment.State").enummodule
46
+ ListEnvironmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEnvironmentsRequest").msgclass
47
+ ListEnvironmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEnvironmentsResponse").msgclass
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,45 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/dialogflow/v2/environment.proto for package 'google.cloud.dialogflow.v2'
3
+ # Original file comments:
4
+ # Copyright 2020 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/dialogflow/v2/environment_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module V2
26
+ module Environments
27
+ # Manages agent environments.
28
+ class Service
29
+
30
+ include GRPC::GenericService
31
+
32
+ self.marshal_class_method = :encode
33
+ self.unmarshal_class_method = :decode
34
+ self.service_name = 'google.cloud.dialogflow.v2.Environments'
35
+
36
+ # Returns the list of all non-draft environments of the specified agent.
37
+ rpc :ListEnvironments, ListEnvironmentsRequest, ListEnvironmentsResponse
38
+ end
39
+
40
+ Stub = Service.rpc_stub_class
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/dialogflow/v2/version"
24
+
25
+ require "google/cloud/dialogflow/v2/environments/credentials"
26
+ require "google/cloud/dialogflow/v2/environments/paths"
27
+ require "google/cloud/dialogflow/v2/environments/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Dialogflow
32
+ module V2
33
+ ##
34
+ # Manages agent environments.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/dialogflow/v2/environments"
39
+ # client = Google::Cloud::Dialogflow::V2::Environments::Client.new
40
+ #
41
+ module Environments
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "environments", "helpers.rb"
49
+ require "google/cloud/dialogflow/v2/environments/helpers" if ::File.file? helper_path
@@ -0,0 +1,379 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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/v2/environment_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module V2
26
+ module Environments
27
+ ##
28
+ # Client for the Environments service.
29
+ #
30
+ # Manages agent environments.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :environments_stub
37
+
38
+ ##
39
+ # Configure the Environments Client class.
40
+ #
41
+ # See {Google::Cloud::Dialogflow::V2::Environments::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all Environments clients:
47
+ #
48
+ # Google::Cloud::Dialogflow::V2::Environments::Client.configure do |config|
49
+ # config.timeout = 10_000
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", "V2"]
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.rpcs.list_environments.timeout = 60.0
69
+ default_config.rpcs.list_environments.retry_policy = {
70
+ initial_delay: 0.1,
71
+ max_delay: 60.0,
72
+ multiplier: 1.3,
73
+ retry_codes: ["UNAVAILABLE", "INTERNAL"]
74
+ }
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the Environments 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::Dialogflow::V2::Environments::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
+ # Create a new Environments client object.
104
+ #
105
+ # ## Examples
106
+ #
107
+ # To create a new Environments client with the default
108
+ # configuration:
109
+ #
110
+ # client = Google::Cloud::Dialogflow::V2::Environments::Client.new
111
+ #
112
+ # To create a new Environments client with a custom
113
+ # configuration:
114
+ #
115
+ # client = Google::Cloud::Dialogflow::V2::Environments::Client.new do |config|
116
+ # config.timeout = 10_000
117
+ # end
118
+ #
119
+ # @yield [config] Configure the Environments client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ def initialize
123
+ # These require statements are intentionally placed here to initialize
124
+ # the gRPC module only when it's required.
125
+ # See https://github.com/googleapis/toolkit/issues/446
126
+ require "gapic/grpc"
127
+ require "google/cloud/dialogflow/v2/environment_services_pb"
128
+
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ credentials ||= Credentials.default scope: @config.scope
138
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
139
+ credentials = Credentials.new credentials, scope: @config.scope
140
+ end
141
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
142
+
143
+ @environments_stub = Gapic::ServiceStub.new(
144
+ Google::Cloud::Dialogflow::V2::Environments::Stub,
145
+ credentials: credentials,
146
+ endpoint: @config.endpoint,
147
+ channel_args: @config.channel_args,
148
+ interceptors: @config.interceptors
149
+ )
150
+ end
151
+
152
+ # Service calls
153
+
154
+ ##
155
+ # Returns the list of all non-draft environments of the specified agent.
156
+ #
157
+ # @overload list_environments(request, options = nil)
158
+ # Pass arguments to `list_environments` via a request object, either of type
159
+ # {Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest} or an equivalent Hash.
160
+ #
161
+ # @param request [Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, Hash]
162
+ # A request object representing the call parameters. Required. To specify no
163
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
164
+ # @param options [Gapic::CallOptions, Hash]
165
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
166
+ #
167
+ # @overload list_environments(parent: nil, page_size: nil, page_token: nil)
168
+ # Pass arguments to `list_environments` via keyword arguments. Note that at
169
+ # least one keyword argument is required. To specify no parameters, or to keep all
170
+ # the default parameter values, pass an empty Hash as a request object (see above).
171
+ #
172
+ # @param parent [String]
173
+ # Required. The agent to list all environments from.
174
+ # Format: `projects/<Project ID>/agent`.
175
+ # @param page_size [Integer]
176
+ # Optional. The maximum number of items to return in a single page. By default 100 and
177
+ # at most 1000.
178
+ # @param page_token [String]
179
+ # Optional. The next_page_token value returned from a previous list request.
180
+ #
181
+ # @yield [response, operation] Access the result along with the RPC operation
182
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Dialogflow::V2::Environment>]
183
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
184
+ #
185
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Dialogflow::V2::Environment>]
186
+ #
187
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
188
+ #
189
+ def list_environments request, options = nil
190
+ raise ArgumentError, "request must be provided" if request.nil?
191
+
192
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest
193
+
194
+ # Converts hash and nil to an options object
195
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
196
+
197
+ # Customize the options with defaults
198
+ metadata = @config.rpcs.list_environments.metadata.to_h
199
+
200
+ # Set x-goog-api-client and x-goog-user-project headers
201
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
202
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
203
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
204
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
205
+
206
+ header_params = {
207
+ "parent" => request.parent
208
+ }
209
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
210
+ metadata[:"x-goog-request-params"] ||= request_params_header
211
+
212
+ options.apply_defaults timeout: @config.rpcs.list_environments.timeout,
213
+ metadata: metadata,
214
+ retry_policy: @config.rpcs.list_environments.retry_policy
215
+ options.apply_defaults metadata: @config.metadata,
216
+ retry_policy: @config.retry_policy
217
+
218
+ @environments_stub.call_rpc :list_environments, request, options: options do |response, operation|
219
+ response = Gapic::PagedEnumerable.new @environments_stub, :list_environments, request, response, operation, options
220
+ yield response, operation if block_given?
221
+ return response
222
+ end
223
+ rescue GRPC::BadStatus => e
224
+ raise Google::Cloud::Error.from_error(e)
225
+ end
226
+
227
+ ##
228
+ # Configuration class for the Environments API.
229
+ #
230
+ # This class represents the configuration for Environments,
231
+ # providing control over timeouts, retry behavior, logging, transport
232
+ # parameters, and other low-level controls. Certain parameters can also be
233
+ # applied individually to specific RPCs. See
234
+ # {Google::Cloud::Dialogflow::V2::Environments::Client::Configuration::Rpcs}
235
+ # for a list of RPCs that can be configured independently.
236
+ #
237
+ # Configuration can be applied globally to all clients, or to a single client
238
+ # on construction.
239
+ #
240
+ # # Examples
241
+ #
242
+ # To modify the global config, setting the timeout for list_environments
243
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
244
+ #
245
+ # Google::Cloud::Dialogflow::V2::Environments::Client.configure do |config|
246
+ # config.timeout = 10_000
247
+ # config.rpcs.list_environments.timeout = 20_000
248
+ # end
249
+ #
250
+ # To apply the above configuration only to a new client:
251
+ #
252
+ # client = Google::Cloud::Dialogflow::V2::Environments::Client.new do |config|
253
+ # config.timeout = 10_000
254
+ # config.rpcs.list_environments.timeout = 20_000
255
+ # end
256
+ #
257
+ # @!attribute [rw] endpoint
258
+ # The hostname or hostname:port of the service endpoint.
259
+ # Defaults to `"dialogflow.googleapis.com"`.
260
+ # @return [String]
261
+ # @!attribute [rw] credentials
262
+ # Credentials to send with calls. You may provide any of the following types:
263
+ # * (`String`) The path to a service account key file in JSON format
264
+ # * (`Hash`) A service account key as a Hash
265
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
266
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
267
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
268
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
269
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
270
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
271
+ # * (`nil`) indicating no credentials
272
+ # @return [Object]
273
+ # @!attribute [rw] scope
274
+ # The OAuth scopes
275
+ # @return [Array<String>]
276
+ # @!attribute [rw] lib_name
277
+ # The library name as recorded in instrumentation and logging
278
+ # @return [String]
279
+ # @!attribute [rw] lib_version
280
+ # The library version as recorded in instrumentation and logging
281
+ # @return [String]
282
+ # @!attribute [rw] channel_args
283
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
284
+ # `GRPC::Core::Channel` object is provided as the credential.
285
+ # @return [Hash]
286
+ # @!attribute [rw] interceptors
287
+ # An array of interceptors that are run before calls are executed.
288
+ # @return [Array<GRPC::ClientInterceptor>]
289
+ # @!attribute [rw] timeout
290
+ # The call timeout in milliseconds.
291
+ # @return [Numeric]
292
+ # @!attribute [rw] metadata
293
+ # Additional gRPC headers to be sent with the call.
294
+ # @return [Hash{Symbol=>String}]
295
+ # @!attribute [rw] retry_policy
296
+ # The retry policy. The value is a hash with the following keys:
297
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
298
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
299
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
300
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
301
+ # trigger a retry.
302
+ # @return [Hash]
303
+ #
304
+ class Configuration
305
+ extend Gapic::Config
306
+
307
+ config_attr :endpoint, "dialogflow.googleapis.com", String
308
+ config_attr :credentials, nil do |value|
309
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
310
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
311
+ allowed.any? { |klass| klass === value }
312
+ end
313
+ config_attr :scope, nil, String, Array, nil
314
+ config_attr :lib_name, nil, String, nil
315
+ config_attr :lib_version, nil, String, nil
316
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
317
+ config_attr :interceptors, nil, Array, nil
318
+ config_attr :timeout, nil, Numeric, nil
319
+ config_attr :metadata, nil, Hash, nil
320
+ config_attr :retry_policy, nil, Hash, Proc, nil
321
+
322
+ # @private
323
+ def initialize parent_config = nil
324
+ @parent_config = parent_config unless parent_config.nil?
325
+
326
+ yield self if block_given?
327
+ end
328
+
329
+ ##
330
+ # Configurations for individual RPCs
331
+ # @return [Rpcs]
332
+ #
333
+ def rpcs
334
+ @rpcs ||= begin
335
+ parent_rpcs = nil
336
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
337
+ Rpcs.new parent_rpcs
338
+ end
339
+ end
340
+
341
+ ##
342
+ # Configuration RPC class for the Environments API.
343
+ #
344
+ # Includes fields providing the configuration for each RPC in this service.
345
+ # Each configuration object is of type `Gapic::Config::Method` and includes
346
+ # the following configuration fields:
347
+ #
348
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
349
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
350
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
351
+ # include 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
+ #
358
+ class Rpcs
359
+ ##
360
+ # RPC-specific configuration for `list_environments`
361
+ # @return [Gapic::Config::Method]
362
+ #
363
+ attr_reader :list_environments
364
+
365
+ # @private
366
+ def initialize parent_rpcs = nil
367
+ list_environments_config = parent_rpcs&.list_environments if parent_rpcs&.respond_to? :list_environments
368
+ @list_environments = Gapic::Config::Method.new list_environments_config
369
+
370
+ yield self if block_given?
371
+ end
372
+ end
373
+ end
374
+ end
375
+ end
376
+ end
377
+ end
378
+ end
379
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Dialogflow
24
+ module V2
25
+ module Environments
26
+ # Credentials for the Environments API.
27
+ class Credentials < Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/dialogflow"
31
+ ]
32
+ self.env_vars = [
33
+ "DIALOGFLOW_CREDENTIALS",
34
+ "DIALOGFLOW_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "DIALOGFLOW_CREDENTIALS_JSON",
39
+ "DIALOGFLOW_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Dialogflow
23
+ module V2
24
+ module Environments
25
+ # Path helper methods for the Environments API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Agent resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/agent`
33
+ #
34
+ # @param project [String]
35
+ #
36
+ # @return [String]
37
+ def agent_path project:
38
+ "projects/#{project}/agent"
39
+ end
40
+
41
+ extend self
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Dialogflow
23
23
  module V2
24
- VERSION = "0.4.1"
24
+ VERSION = "0.5.0"
25
25
  end
26
26
  end
27
27
  end
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Dialogflow
23
+ module V2
24
+ # Represents an agent environment.
25
+ # @!attribute [r] name
26
+ # @return [String]
27
+ # Output only. The unique identifier of this agent environment.
28
+ # Format: `projects/<Project ID>/agent/environments/<Environment ID>`.
29
+ # For Environment ID, "-" is reserved for 'draft' environment.
30
+ # @!attribute [rw] description
31
+ # @return [String]
32
+ # Optional. The developer-provided description for this environment.
33
+ # The maximum length is 500 characters. If exceeded, the request is rejected.
34
+ # @!attribute [rw] agent_version
35
+ # @return [String]
36
+ # Optional. The agent version loaded into this environment.
37
+ # Format: `projects/<Project ID>/agent/versions/<Version ID>`.
38
+ # @!attribute [r] state
39
+ # @return [Google::Cloud::Dialogflow::V2::Environment::State]
40
+ # Output only. The state of this environment. This field is read-only, i.e., it cannot be
41
+ # set by create and update methods.
42
+ # @!attribute [r] update_time
43
+ # @return [Google::Protobuf::Timestamp]
44
+ # Output only. The last update time of this environment. This field is read-only, i.e., it
45
+ # cannot be set by create and update methods.
46
+ class Environment
47
+ include Google::Protobuf::MessageExts
48
+ extend Google::Protobuf::MessageExts::ClassMethods
49
+
50
+ # Represents an environment state. When a environment is pointed to a new
51
+ # agent version, the environment is temporarily set to the `LOADING` state.
52
+ # During that time, the environment keeps on serving the previous version of
53
+ # the agent. After the new agent version is done loading, the environment is
54
+ # set back to the `RUNNING` state.
55
+ module State
56
+ # Not specified. This value is not used.
57
+ STATE_UNSPECIFIED = 0
58
+
59
+ # Stopped.
60
+ STOPPED = 1
61
+
62
+ # Loading.
63
+ LOADING = 2
64
+
65
+ # Running.
66
+ RUNNING = 3
67
+ end
68
+ end
69
+
70
+ # The request message for {Google::Cloud::Dialogflow::V2::Environments::Client#list_environments Environments.ListEnvironments}.
71
+ # @!attribute [rw] parent
72
+ # @return [String]
73
+ # Required. The agent to list all environments from.
74
+ # Format: `projects/<Project ID>/agent`.
75
+ # @!attribute [rw] page_size
76
+ # @return [Integer]
77
+ # Optional. The maximum number of items to return in a single page. By default 100 and
78
+ # at most 1000.
79
+ # @!attribute [rw] page_token
80
+ # @return [String]
81
+ # Optional. The next_page_token value returned from a previous list request.
82
+ class ListEnvironmentsRequest
83
+ include Google::Protobuf::MessageExts
84
+ extend Google::Protobuf::MessageExts::ClassMethods
85
+ end
86
+
87
+ # The response message for {Google::Cloud::Dialogflow::V2::Environments::Client#list_environments Environments.ListEnvironments}.
88
+ # @!attribute [rw] environments
89
+ # @return [Array<Google::Cloud::Dialogflow::V2::Environment>]
90
+ # The list of agent environments. There will be a maximum number of items
91
+ # returned based on the page_size field in the request.
92
+ # @!attribute [rw] next_page_token
93
+ # @return [String]
94
+ # Token to retrieve the next page of results, or empty if there are no
95
+ # more results in the list.
96
+ class ListEnvironmentsResponse
97
+ include Google::Protobuf::MessageExts
98
+ extend Google::Protobuf::MessageExts::ClassMethods
99
+ end
100
+ end
101
+ end
102
+ end
103
+ end
@@ -62,21 +62,27 @@ module Google
62
62
  # Guide](https://developers.google.com/protocol-buffers/docs/proto3#json).
63
63
  # @!attribute [rw] fulfillment_text
64
64
  # @return [String]
65
- # Optional. The text to be shown on the screen. This value is passed directly
66
- # to `QueryResult.fulfillment_text`.
65
+ # Optional. The text response message intended for the end-user.
66
+ # It is recommended to use `fulfillment_messages.text.text[0]` instead.
67
+ # When provided, Dialogflow uses this field to populate
68
+ # {Google::Cloud::Dialogflow::V2::QueryResult#fulfillment_text QueryResult.fulfillment_text} sent to the integration or API caller.
67
69
  # @!attribute [rw] fulfillment_messages
68
70
  # @return [Array<Google::Cloud::Dialogflow::V2::Intent::Message>]
69
- # Optional. The collection of rich messages to present to the user. This
70
- # value is passed directly to `QueryResult.fulfillment_messages`.
71
+ # Optional. The rich response messages intended for the end-user.
72
+ # When provided, Dialogflow uses this field to populate
73
+ # {Google::Cloud::Dialogflow::V2::QueryResult#fulfillment_messages QueryResult.fulfillment_messages} sent to the integration or API caller.
71
74
  # @!attribute [rw] source
72
75
  # @return [String]
73
- # Optional. This value is passed directly to `QueryResult.webhook_source`.
76
+ # Optional. A custom field used to identify the webhook source.
77
+ # Arbitrary strings are supported.
78
+ # When provided, Dialogflow uses this field to populate
79
+ # {Google::Cloud::Dialogflow::V2::QueryResult#webhook_source QueryResult.webhook_source} sent to the integration or API caller.
74
80
  # @!attribute [rw] payload
75
81
  # @return [Google::Protobuf::Struct]
76
- # Optional. This field can be used to pass custom data from your webhook to the API
77
- # caller. Arbitrary JSON objects are supported.
82
+ # Optional. This field can be used to pass custom data from your webhook to the
83
+ # integration or API caller. Arbitrary JSON objects are supported.
78
84
  # When provided, Dialogflow uses this field to populate
79
- # `QueryResult.webhook_payload` sent to the API caller.
85
+ # {Google::Cloud::Dialogflow::V2::QueryResult#webhook_payload QueryResult.webhook_payload} sent to the integration or API caller.
80
86
  # This field is also used by the
81
87
  # [Google Assistant
82
88
  # integration](https://cloud.google.com/dialogflow/docs/integrations/aog)
@@ -85,21 +91,22 @@ module Google
85
91
  # format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json)
86
92
  # @!attribute [rw] output_contexts
87
93
  # @return [Array<Google::Cloud::Dialogflow::V2::Context>]
88
- # Optional. The collection of output contexts. This value is passed directly
89
- # to `QueryResult.output_contexts`.
94
+ # Optional. The collection of output contexts that will overwrite currently
95
+ # active contexts for the session and reset their lifespans.
96
+ # When provided, Dialogflow uses this field to populate
97
+ # {Google::Cloud::Dialogflow::V2::QueryResult#output_contexts QueryResult.output_contexts} sent to the integration or API caller.
90
98
  # @!attribute [rw] followup_event_input
91
99
  # @return [Google::Cloud::Dialogflow::V2::EventInput]
92
- # Optional. Makes the platform immediately invoke another `DetectIntent` call
93
- # internally with the specified event as input.
100
+ # Optional. Invokes the supplied events.
94
101
  # When this field is set, Dialogflow ignores the `fulfillment_text`,
95
102
  # `fulfillment_messages`, and `payload` fields.
96
103
  # @!attribute [rw] session_entity_types
97
104
  # @return [Array<Google::Cloud::Dialogflow::V2::SessionEntityType>]
98
105
  # Optional. Additional session entity types to replace or extend developer
99
106
  # entity types with. The entity synonyms apply to all languages and persist
100
- # for the session of this query. Setting the session entity types inside
101
- # webhook overwrites the session entity types that have been set through
102
- # `DetectIntentRequest.query_params.session_entity_types`.
107
+ # for the session. Setting this data from a webhook overwrites
108
+ # the session entity types that have been set using `detectIntent`,
109
+ # `streamingDetectIntent` or {Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} management methods.
103
110
  class WebhookResponse
104
111
  include Google::Protobuf::MessageExts
105
112
  extend Google::Protobuf::MessageExts::ClassMethods
@@ -0,0 +1,120 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 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 Protobuf
22
+ # A Timestamp represents a point in time independent of any time zone or local
23
+ # calendar, encoded as a count of seconds and fractions of seconds at
24
+ # nanosecond resolution. The count is relative to an epoch at UTC midnight on
25
+ # January 1, 1970, in the proleptic Gregorian calendar which extends the
26
+ # Gregorian calendar backwards to year one.
27
+ #
28
+ # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
29
+ # second table is needed for interpretation, using a [24-hour linear
30
+ # smear](https://developers.google.com/time/smear).
31
+ #
32
+ # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
33
+ # restricting to that range, we ensure that we can convert to and from [RFC
34
+ # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
35
+ #
36
+ # # Examples
37
+ #
38
+ # Example 1: Compute Timestamp from POSIX `time()`.
39
+ #
40
+ # Timestamp timestamp;
41
+ # timestamp.set_seconds(time(NULL));
42
+ # timestamp.set_nanos(0);
43
+ #
44
+ # Example 2: Compute Timestamp from POSIX `gettimeofday()`.
45
+ #
46
+ # struct timeval tv;
47
+ # gettimeofday(&tv, NULL);
48
+ #
49
+ # Timestamp timestamp;
50
+ # timestamp.set_seconds(tv.tv_sec);
51
+ # timestamp.set_nanos(tv.tv_usec * 1000);
52
+ #
53
+ # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
54
+ #
55
+ # FILETIME ft;
56
+ # GetSystemTimeAsFileTime(&ft);
57
+ # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
58
+ #
59
+ # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
60
+ # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
61
+ # Timestamp timestamp;
62
+ # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
63
+ # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
64
+ #
65
+ # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
66
+ #
67
+ # long millis = System.currentTimeMillis();
68
+ #
69
+ # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
70
+ # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
+ #
72
+ #
73
+ # Example 5: Compute Timestamp from current time in Python.
74
+ #
75
+ # timestamp = Timestamp()
76
+ # timestamp.GetCurrentTime()
77
+ #
78
+ # # JSON Mapping
79
+ #
80
+ # In JSON format, the Timestamp type is encoded as a string in the
81
+ # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
82
+ # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
83
+ # where \\{year} is always expressed using four digits while \\{month}, \\{day},
84
+ # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
85
+ # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
86
+ # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
87
+ # is required. A proto3 JSON serializer should always use UTC (as indicated by
88
+ # "Z") when printing the Timestamp type and a proto3 JSON parser should be
89
+ # able to accept both UTC and other timezones (as indicated by an offset).
90
+ #
91
+ # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
92
+ # 01:30 UTC on January 15, 2017.
93
+ #
94
+ # In JavaScript, one can convert a Date object to this format using the
95
+ # standard
96
+ # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
97
+ # method. In Python, a standard `datetime.datetime` object can be converted
98
+ # to this format using
99
+ # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
100
+ # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
101
+ # the Joda Time's [`ISODateTimeFormat.dateTime()`](
102
+ # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
103
+ # ) to obtain a formatter capable of generating timestamps in this format.
104
+ # @!attribute [rw] seconds
105
+ # @return [Integer]
106
+ # Represents seconds of UTC time since Unix epoch
107
+ # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
108
+ # 9999-12-31T23:59:59Z inclusive.
109
+ # @!attribute [rw] nanos
110
+ # @return [Integer]
111
+ # Non-negative fractions of a second at nanosecond resolution. Negative
112
+ # second values with fractions must still have non-negative nanos values
113
+ # that count forward in time. Must be from 0 to 999,999,999
114
+ # inclusive.
115
+ class Timestamp
116
+ include Google::Protobuf::MessageExts
117
+ extend Google::Protobuf::MessageExts::ClassMethods
118
+ end
119
+ end
120
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-dialogflow-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-22 00:00:00.000000000 Z
11
+ date: 2020-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -160,6 +160,12 @@ files:
160
160
  - lib/google/cloud/dialogflow/v2/entity_types/credentials.rb
161
161
  - lib/google/cloud/dialogflow/v2/entity_types/operations.rb
162
162
  - lib/google/cloud/dialogflow/v2/entity_types/paths.rb
163
+ - lib/google/cloud/dialogflow/v2/environment_pb.rb
164
+ - lib/google/cloud/dialogflow/v2/environment_services_pb.rb
165
+ - lib/google/cloud/dialogflow/v2/environments.rb
166
+ - lib/google/cloud/dialogflow/v2/environments/client.rb
167
+ - lib/google/cloud/dialogflow/v2/environments/credentials.rb
168
+ - lib/google/cloud/dialogflow/v2/environments/paths.rb
163
169
  - lib/google/cloud/dialogflow/v2/intent_pb.rb
164
170
  - lib/google/cloud/dialogflow/v2/intent_services_pb.rb
165
171
  - lib/google/cloud/dialogflow/v2/intents.rb
@@ -189,6 +195,7 @@ files:
189
195
  - proto_docs/google/cloud/dialogflow/v2/audio_config.rb
190
196
  - proto_docs/google/cloud/dialogflow/v2/context.rb
191
197
  - proto_docs/google/cloud/dialogflow/v2/entity_type.rb
198
+ - proto_docs/google/cloud/dialogflow/v2/environment.rb
192
199
  - proto_docs/google/cloud/dialogflow/v2/intent.rb
193
200
  - proto_docs/google/cloud/dialogflow/v2/session.rb
194
201
  - proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb
@@ -200,6 +207,7 @@ files:
200
207
  - proto_docs/google/protobuf/empty.rb
201
208
  - proto_docs/google/protobuf/field_mask.rb
202
209
  - proto_docs/google/protobuf/struct.rb
210
+ - proto_docs/google/protobuf/timestamp.rb
203
211
  - proto_docs/google/rpc/status.rb
204
212
  - proto_docs/google/type/latlng.rb
205
213
  homepage: https://github.com/googleapis/google-cloud-ruby