google-cloud-dialogflow 0.13.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -59
- data/LICENSE.md +203 -0
- data/MIGRATING.md +445 -0
- data/README.md +35 -25
- data/lib/{google/cloud/dialogflow/v2/doc/google/protobuf/empty.rb → google-cloud-dialogflow.rb} +4 -14
- data/lib/google/cloud/dialogflow.rb +374 -506
- data/lib/google/cloud/dialogflow/version.rb +1 -1
- metadata +62 -83
- data/LICENSE +0 -201
- data/lib/google/cloud/dialogflow/v2.rb +0 -598
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +0 -115
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +0 -109
- data/lib/google/cloud/dialogflow/v2/agents_client.rb +0 -760
- data/lib/google/cloud/dialogflow/v2/agents_client_config.json +0 -66
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +0 -96
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +0 -63
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +0 -76
- data/lib/google/cloud/dialogflow/v2/contexts_client.rb +0 -519
- data/lib/google/cloud/dialogflow/v2/contexts_client_config.json +0 -56
- data/lib/google/cloud/dialogflow/v2/credentials.rb +0 -42
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +0 -233
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/audio_config.rb +0 -341
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +0 -116
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +0 -305
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +0 -937
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +0 -482
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +0 -130
- data/lib/google/cloud/dialogflow/v2/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +0 -31
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +0 -125
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +0 -106
- data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +0 -994
- data/lib/google/cloud/dialogflow/v2/entity_types_client_config.json +0 -76
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +0 -367
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +0 -94
- data/lib/google/cloud/dialogflow/v2/intents_client.rb +0 -760
- data/lib/google/cloud/dialogflow/v2/intents_client_config.json +0 -61
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +0 -65
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +0 -94
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +0 -504
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client_config.json +0 -51
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +0 -138
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +0 -57
- data/lib/google/cloud/dialogflow/v2/sessions_client.rb +0 -326
- data/lib/google/cloud/dialogflow/v2/sessions_client_config.json +0 -36
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +0 -46
@@ -1,74 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
module Google
|
17
|
-
module Protobuf
|
18
|
-
# `Struct` represents a structured data value, consisting of fields
|
19
|
-
# which map to dynamically typed values. In some languages, `Struct`
|
20
|
-
# might be supported by a native representation. For example, in
|
21
|
-
# scripting languages like JS a struct is represented as an
|
22
|
-
# object. The details of that representation are described together
|
23
|
-
# with the proto support for the language.
|
24
|
-
#
|
25
|
-
# The JSON representation for `Struct` is JSON object.
|
26
|
-
# @!attribute [rw] fields
|
27
|
-
# @return [Hash{String => Google::Protobuf::Value}]
|
28
|
-
# Unordered map of dynamically typed values.
|
29
|
-
class Struct; end
|
30
|
-
|
31
|
-
# `Value` represents a dynamically typed value which can be either
|
32
|
-
# null, a number, a string, a boolean, a recursive struct value, or a
|
33
|
-
# list of values. A producer of value is expected to set one of that
|
34
|
-
# variants, absence of any variant indicates an error.
|
35
|
-
#
|
36
|
-
# The JSON representation for `Value` is JSON value.
|
37
|
-
# @!attribute [rw] null_value
|
38
|
-
# @return [Google::Protobuf::NullValue]
|
39
|
-
# Represents a null value.
|
40
|
-
# @!attribute [rw] number_value
|
41
|
-
# @return [Float]
|
42
|
-
# Represents a double value.
|
43
|
-
# @!attribute [rw] string_value
|
44
|
-
# @return [String]
|
45
|
-
# Represents a string value.
|
46
|
-
# @!attribute [rw] bool_value
|
47
|
-
# @return [true, false]
|
48
|
-
# Represents a boolean value.
|
49
|
-
# @!attribute [rw] struct_value
|
50
|
-
# @return [Google::Protobuf::Struct]
|
51
|
-
# Represents a structured value.
|
52
|
-
# @!attribute [rw] list_value
|
53
|
-
# @return [Google::Protobuf::ListValue]
|
54
|
-
# Represents a repeated `Value`.
|
55
|
-
class Value; end
|
56
|
-
|
57
|
-
# `ListValue` is a wrapper around a repeated field of values.
|
58
|
-
#
|
59
|
-
# The JSON representation for `ListValue` is JSON array.
|
60
|
-
# @!attribute [rw] values
|
61
|
-
# @return [Array<Google::Protobuf::Value>]
|
62
|
-
# Repeated field of dynamically typed values.
|
63
|
-
class ListValue; end
|
64
|
-
|
65
|
-
# `NullValue` is a singleton enumeration to represent the null value for the
|
66
|
-
# `Value` type union.
|
67
|
-
#
|
68
|
-
# The JSON representation for `NullValue` is JSON `null`.
|
69
|
-
module NullValue
|
70
|
-
# Null value.
|
71
|
-
NULL_VALUE = 0
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
module Google
|
17
|
-
module Rpc
|
18
|
-
# The `Status` type defines a logical error model that is suitable for
|
19
|
-
# different programming environments, including REST APIs and RPC APIs. It is
|
20
|
-
# used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
21
|
-
# three pieces of data: error code, error message, and error details.
|
22
|
-
#
|
23
|
-
# You can find out more about this error model and how to work with it in the
|
24
|
-
# [API Design Guide](https://cloud.google.com/apis/design/errors).
|
25
|
-
# @!attribute [rw] code
|
26
|
-
# @return [Integer]
|
27
|
-
# The status code, which should be an enum value of {Google::Rpc::Code}.
|
28
|
-
# @!attribute [rw] message
|
29
|
-
# @return [String]
|
30
|
-
# A developer-facing error message, which should be in English. Any
|
31
|
-
# user-facing error message should be localized and sent in the
|
32
|
-
# {Google::Rpc::Status#details} field, or localized by the client.
|
33
|
-
# @!attribute [rw] details
|
34
|
-
# @return [Array<Google::Protobuf::Any>]
|
35
|
-
# A list of messages that carry the error details. There is a common set of
|
36
|
-
# message types for APIs to use.
|
37
|
-
class Status; end
|
38
|
-
end
|
39
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
|
15
|
-
|
16
|
-
module Google
|
17
|
-
module Type
|
18
|
-
# An object representing a latitude/longitude pair. This is expressed as a pair
|
19
|
-
# of doubles representing degrees latitude and degrees longitude. Unless
|
20
|
-
# specified otherwise, this must conform to the
|
21
|
-
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
22
|
-
# standard</a>. Values must be within normalized ranges.
|
23
|
-
# @!attribute [rw] latitude
|
24
|
-
# @return [Float]
|
25
|
-
# The latitude in degrees. It must be in the range [-90.0, +90.0].
|
26
|
-
# @!attribute [rw] longitude
|
27
|
-
# @return [Float]
|
28
|
-
# The longitude in degrees. It must be in the range [-180.0, +180.0].
|
29
|
-
class LatLng; end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,125 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/dialogflow/v2/entity_type.proto
|
3
|
-
|
4
|
-
|
5
|
-
require 'google/protobuf'
|
6
|
-
|
7
|
-
require 'google/api/annotations_pb'
|
8
|
-
require 'google/api/client_pb'
|
9
|
-
require 'google/api/field_behavior_pb'
|
10
|
-
require 'google/api/resource_pb'
|
11
|
-
require 'google/longrunning/operations_pb'
|
12
|
-
require 'google/protobuf/empty_pb'
|
13
|
-
require 'google/protobuf/field_mask_pb'
|
14
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
15
|
-
add_message "google.cloud.dialogflow.v2.EntityType" do
|
16
|
-
optional :name, :string, 1
|
17
|
-
optional :display_name, :string, 2
|
18
|
-
optional :kind, :enum, 3, "google.cloud.dialogflow.v2.EntityType.Kind"
|
19
|
-
optional :auto_expansion_mode, :enum, 4, "google.cloud.dialogflow.v2.EntityType.AutoExpansionMode"
|
20
|
-
repeated :entities, :message, 6, "google.cloud.dialogflow.v2.EntityType.Entity"
|
21
|
-
optional :enable_fuzzy_extraction, :bool, 7
|
22
|
-
end
|
23
|
-
add_message "google.cloud.dialogflow.v2.EntityType.Entity" do
|
24
|
-
optional :value, :string, 1
|
25
|
-
repeated :synonyms, :string, 2
|
26
|
-
end
|
27
|
-
add_enum "google.cloud.dialogflow.v2.EntityType.Kind" do
|
28
|
-
value :KIND_UNSPECIFIED, 0
|
29
|
-
value :KIND_MAP, 1
|
30
|
-
value :KIND_LIST, 2
|
31
|
-
value :KIND_REGEXP, 3
|
32
|
-
end
|
33
|
-
add_enum "google.cloud.dialogflow.v2.EntityType.AutoExpansionMode" do
|
34
|
-
value :AUTO_EXPANSION_MODE_UNSPECIFIED, 0
|
35
|
-
value :AUTO_EXPANSION_MODE_DEFAULT, 1
|
36
|
-
end
|
37
|
-
add_message "google.cloud.dialogflow.v2.ListEntityTypesRequest" do
|
38
|
-
optional :parent, :string, 1
|
39
|
-
optional :language_code, :string, 2
|
40
|
-
optional :page_size, :int32, 3
|
41
|
-
optional :page_token, :string, 4
|
42
|
-
end
|
43
|
-
add_message "google.cloud.dialogflow.v2.ListEntityTypesResponse" do
|
44
|
-
repeated :entity_types, :message, 1, "google.cloud.dialogflow.v2.EntityType"
|
45
|
-
optional :next_page_token, :string, 2
|
46
|
-
end
|
47
|
-
add_message "google.cloud.dialogflow.v2.GetEntityTypeRequest" do
|
48
|
-
optional :name, :string, 1
|
49
|
-
optional :language_code, :string, 2
|
50
|
-
end
|
51
|
-
add_message "google.cloud.dialogflow.v2.CreateEntityTypeRequest" do
|
52
|
-
optional :parent, :string, 1
|
53
|
-
optional :entity_type, :message, 2, "google.cloud.dialogflow.v2.EntityType"
|
54
|
-
optional :language_code, :string, 3
|
55
|
-
end
|
56
|
-
add_message "google.cloud.dialogflow.v2.UpdateEntityTypeRequest" do
|
57
|
-
optional :entity_type, :message, 1, "google.cloud.dialogflow.v2.EntityType"
|
58
|
-
optional :language_code, :string, 2
|
59
|
-
optional :update_mask, :message, 3, "google.protobuf.FieldMask"
|
60
|
-
end
|
61
|
-
add_message "google.cloud.dialogflow.v2.DeleteEntityTypeRequest" do
|
62
|
-
optional :name, :string, 1
|
63
|
-
end
|
64
|
-
add_message "google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest" do
|
65
|
-
optional :parent, :string, 1
|
66
|
-
optional :language_code, :string, 4
|
67
|
-
optional :update_mask, :message, 5, "google.protobuf.FieldMask"
|
68
|
-
oneof :entity_type_batch do
|
69
|
-
optional :entity_type_batch_uri, :string, 2
|
70
|
-
optional :entity_type_batch_inline, :message, 3, "google.cloud.dialogflow.v2.EntityTypeBatch"
|
71
|
-
end
|
72
|
-
end
|
73
|
-
add_message "google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse" do
|
74
|
-
repeated :entity_types, :message, 1, "google.cloud.dialogflow.v2.EntityType"
|
75
|
-
end
|
76
|
-
add_message "google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest" do
|
77
|
-
optional :parent, :string, 1
|
78
|
-
repeated :entity_type_names, :string, 2
|
79
|
-
end
|
80
|
-
add_message "google.cloud.dialogflow.v2.BatchCreateEntitiesRequest" do
|
81
|
-
optional :parent, :string, 1
|
82
|
-
repeated :entities, :message, 2, "google.cloud.dialogflow.v2.EntityType.Entity"
|
83
|
-
optional :language_code, :string, 3
|
84
|
-
end
|
85
|
-
add_message "google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest" do
|
86
|
-
optional :parent, :string, 1
|
87
|
-
repeated :entities, :message, 2, "google.cloud.dialogflow.v2.EntityType.Entity"
|
88
|
-
optional :language_code, :string, 3
|
89
|
-
optional :update_mask, :message, 4, "google.protobuf.FieldMask"
|
90
|
-
end
|
91
|
-
add_message "google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest" do
|
92
|
-
optional :parent, :string, 1
|
93
|
-
repeated :entity_values, :string, 2
|
94
|
-
optional :language_code, :string, 3
|
95
|
-
end
|
96
|
-
add_message "google.cloud.dialogflow.v2.EntityTypeBatch" do
|
97
|
-
repeated :entity_types, :message, 1, "google.cloud.dialogflow.v2.EntityType"
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
module Google
|
102
|
-
module Cloud
|
103
|
-
module Dialogflow
|
104
|
-
module V2
|
105
|
-
EntityType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType").msgclass
|
106
|
-
EntityType::Entity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Entity").msgclass
|
107
|
-
EntityType::Kind = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Kind").enummodule
|
108
|
-
EntityType::AutoExpansionMode = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.AutoExpansionMode").enummodule
|
109
|
-
ListEntityTypesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesRequest").msgclass
|
110
|
-
ListEntityTypesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesResponse").msgclass
|
111
|
-
GetEntityTypeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEntityTypeRequest").msgclass
|
112
|
-
CreateEntityTypeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateEntityTypeRequest").msgclass
|
113
|
-
UpdateEntityTypeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateEntityTypeRequest").msgclass
|
114
|
-
DeleteEntityTypeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteEntityTypeRequest").msgclass
|
115
|
-
BatchUpdateEntityTypesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest").msgclass
|
116
|
-
BatchUpdateEntityTypesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse").msgclass
|
117
|
-
BatchDeleteEntityTypesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest").msgclass
|
118
|
-
BatchCreateEntitiesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchCreateEntitiesRequest").msgclass
|
119
|
-
BatchUpdateEntitiesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest").msgclass
|
120
|
-
BatchDeleteEntitiesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest").msgclass
|
121
|
-
EntityTypeBatch = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityTypeBatch").msgclass
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
125
|
-
end
|
@@ -1,106 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# Source: google/cloud/dialogflow/v2/entity_type.proto for package 'google.cloud.dialogflow.v2'
|
3
|
-
# Original file comments:
|
4
|
-
# Copyright 2019 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
|
-
|
20
|
-
|
21
|
-
require 'grpc'
|
22
|
-
require 'google/cloud/dialogflow/v2/entity_type_pb'
|
23
|
-
|
24
|
-
module Google
|
25
|
-
module Cloud
|
26
|
-
module Dialogflow
|
27
|
-
module V2
|
28
|
-
module EntityTypes
|
29
|
-
# Entities are extracted from user input and represent parameters that are
|
30
|
-
# meaningful to your application. For example, a date range, a proper name
|
31
|
-
# such as a geographic location or landmark, and so on. Entities represent
|
32
|
-
# actionable data for your application.
|
33
|
-
#
|
34
|
-
# When you define an entity, you can also include synonyms that all map to
|
35
|
-
# that entity. For example, "soft drink", "soda", "pop", and so on.
|
36
|
-
#
|
37
|
-
# There are three types of entities:
|
38
|
-
#
|
39
|
-
# * **System** - entities that are defined by the Dialogflow API for common
|
40
|
-
# data types such as date, time, currency, and so on. A system entity is
|
41
|
-
# represented by the `EntityType` type.
|
42
|
-
#
|
43
|
-
# * **Custom** - entities that are defined by you that represent
|
44
|
-
# actionable data that is meaningful to your application. For example,
|
45
|
-
# you could define a `pizza.sauce` entity for red or white pizza sauce,
|
46
|
-
# a `pizza.cheese` entity for the different types of cheese on a pizza,
|
47
|
-
# a `pizza.topping` entity for different toppings, and so on. A custom
|
48
|
-
# entity is represented by the `EntityType` type.
|
49
|
-
#
|
50
|
-
# * **User** - entities that are built for an individual user such as
|
51
|
-
# favorites, preferences, playlists, and so on. A user entity is
|
52
|
-
# represented by the [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type.
|
53
|
-
#
|
54
|
-
# For more information about entity types, see the
|
55
|
-
# [Dialogflow
|
56
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
57
|
-
class Service
|
58
|
-
|
59
|
-
include GRPC::GenericService
|
60
|
-
|
61
|
-
self.marshal_class_method = :encode
|
62
|
-
self.unmarshal_class_method = :decode
|
63
|
-
self.service_name = 'google.cloud.dialogflow.v2.EntityTypes'
|
64
|
-
|
65
|
-
# Returns the list of all entity types in the specified agent.
|
66
|
-
rpc :ListEntityTypes, ListEntityTypesRequest, ListEntityTypesResponse
|
67
|
-
# Retrieves the specified entity type.
|
68
|
-
rpc :GetEntityType, GetEntityTypeRequest, EntityType
|
69
|
-
# Creates an entity type in the specified agent.
|
70
|
-
rpc :CreateEntityType, CreateEntityTypeRequest, EntityType
|
71
|
-
# Updates the specified entity type.
|
72
|
-
rpc :UpdateEntityType, UpdateEntityTypeRequest, EntityType
|
73
|
-
# Deletes the specified entity type.
|
74
|
-
rpc :DeleteEntityType, DeleteEntityTypeRequest, Google::Protobuf::Empty
|
75
|
-
# Updates/Creates multiple entity types in the specified agent.
|
76
|
-
#
|
77
|
-
# Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
|
78
|
-
rpc :BatchUpdateEntityTypes, BatchUpdateEntityTypesRequest, Google::Longrunning::Operation
|
79
|
-
# Deletes entity types in the specified agent.
|
80
|
-
#
|
81
|
-
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
82
|
-
rpc :BatchDeleteEntityTypes, BatchDeleteEntityTypesRequest, Google::Longrunning::Operation
|
83
|
-
# Creates multiple new entities in the specified entity type.
|
84
|
-
#
|
85
|
-
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
86
|
-
rpc :BatchCreateEntities, BatchCreateEntitiesRequest, Google::Longrunning::Operation
|
87
|
-
# Updates or creates multiple entities in the specified entity type. This
|
88
|
-
# method does not affect entities in the entity type that aren't explicitly
|
89
|
-
# specified in the request.
|
90
|
-
#
|
91
|
-
#
|
92
|
-
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
93
|
-
rpc :BatchUpdateEntities, BatchUpdateEntitiesRequest, Google::Longrunning::Operation
|
94
|
-
# Deletes entities in the specified entity type.
|
95
|
-
#
|
96
|
-
#
|
97
|
-
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
98
|
-
rpc :BatchDeleteEntities, BatchDeleteEntitiesRequest, Google::Longrunning::Operation
|
99
|
-
end
|
100
|
-
|
101
|
-
Stub = Service.rpc_stub_class
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
@@ -1,994 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
#
|
15
|
-
# EDITING INSTRUCTIONS
|
16
|
-
# This file was generated from the file
|
17
|
-
# https://github.com/googleapis/googleapis/blob/master/google/cloud/dialogflow/v2/entity_type.proto,
|
18
|
-
# and updates to that file get reflected here through a refresh process.
|
19
|
-
# For the short term, the refresh process will only be runnable by Google
|
20
|
-
# engineers.
|
21
|
-
|
22
|
-
|
23
|
-
require "json"
|
24
|
-
require "pathname"
|
25
|
-
|
26
|
-
require "google/gax"
|
27
|
-
require "google/gax/operation"
|
28
|
-
require "google/longrunning/operations_client"
|
29
|
-
|
30
|
-
require "google/cloud/dialogflow/v2/entity_type_pb"
|
31
|
-
require "google/cloud/dialogflow/v2/credentials"
|
32
|
-
require "google/cloud/dialogflow/version"
|
33
|
-
|
34
|
-
module Google
|
35
|
-
module Cloud
|
36
|
-
module Dialogflow
|
37
|
-
module V2
|
38
|
-
# Entities are extracted from user input and represent parameters that are
|
39
|
-
# meaningful to your application. For example, a date range, a proper name
|
40
|
-
# such as a geographic location or landmark, and so on. Entities represent
|
41
|
-
# actionable data for your application.
|
42
|
-
#
|
43
|
-
# When you define an entity, you can also include synonyms that all map to
|
44
|
-
# that entity. For example, "soft drink", "soda", "pop", and so on.
|
45
|
-
#
|
46
|
-
# There are three types of entities:
|
47
|
-
#
|
48
|
-
# * **System** - entities that are defined by the Dialogflow API for common
|
49
|
-
# data types such as date, time, currency, and so on. A system entity is
|
50
|
-
# represented by the `EntityType` type.
|
51
|
-
#
|
52
|
-
# * **Custom** - entities that are defined by you that represent
|
53
|
-
# actionable data that is meaningful to your application. For example,
|
54
|
-
# you could define a `pizza.sauce` entity for red or white pizza sauce,
|
55
|
-
# a `pizza.cheese` entity for the different types of cheese on a pizza,
|
56
|
-
# a `pizza.topping` entity for different toppings, and so on. A custom
|
57
|
-
# entity is represented by the `EntityType` type.
|
58
|
-
#
|
59
|
-
# * **User** - entities that are built for an individual user such as
|
60
|
-
# favorites, preferences, playlists, and so on. A user entity is
|
61
|
-
# represented by the {Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} type.
|
62
|
-
#
|
63
|
-
# For more information about entity types, see the
|
64
|
-
# [Dialogflow
|
65
|
-
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
66
|
-
#
|
67
|
-
# @!attribute [r] entity_types_stub
|
68
|
-
# @return [Google::Cloud::Dialogflow::V2::EntityTypes::Stub]
|
69
|
-
class EntityTypesClient
|
70
|
-
# @private
|
71
|
-
attr_reader :entity_types_stub
|
72
|
-
|
73
|
-
# The default address of the service.
|
74
|
-
SERVICE_ADDRESS = "dialogflow.googleapis.com".freeze
|
75
|
-
|
76
|
-
# The default port of the service.
|
77
|
-
DEFAULT_SERVICE_PORT = 443
|
78
|
-
|
79
|
-
# The default set of gRPC interceptors.
|
80
|
-
GRPC_INTERCEPTORS = []
|
81
|
-
|
82
|
-
DEFAULT_TIMEOUT = 30
|
83
|
-
|
84
|
-
PAGE_DESCRIPTORS = {
|
85
|
-
"list_entity_types" => Google::Gax::PageDescriptor.new(
|
86
|
-
"page_token",
|
87
|
-
"next_page_token",
|
88
|
-
"entity_types")
|
89
|
-
}.freeze
|
90
|
-
|
91
|
-
private_constant :PAGE_DESCRIPTORS
|
92
|
-
|
93
|
-
# The scopes needed to make gRPC calls to all of the methods defined in
|
94
|
-
# this service.
|
95
|
-
ALL_SCOPES = [
|
96
|
-
"https://www.googleapis.com/auth/cloud-platform",
|
97
|
-
"https://www.googleapis.com/auth/dialogflow"
|
98
|
-
].freeze
|
99
|
-
|
100
|
-
# @private
|
101
|
-
class OperationsClient < Google::Longrunning::OperationsClient
|
102
|
-
self::SERVICE_ADDRESS = EntityTypesClient::SERVICE_ADDRESS
|
103
|
-
self::GRPC_INTERCEPTORS = EntityTypesClient::GRPC_INTERCEPTORS
|
104
|
-
end
|
105
|
-
|
106
|
-
ENTITY_TYPE_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
107
|
-
"projects/{project}/agent/entityTypes/{entity_type}"
|
108
|
-
)
|
109
|
-
|
110
|
-
private_constant :ENTITY_TYPE_PATH_TEMPLATE
|
111
|
-
|
112
|
-
PROJECT_AGENT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
113
|
-
"projects/{project}/agent"
|
114
|
-
)
|
115
|
-
|
116
|
-
private_constant :PROJECT_AGENT_PATH_TEMPLATE
|
117
|
-
|
118
|
-
# Returns a fully-qualified entity_type resource name string.
|
119
|
-
# @param project [String]
|
120
|
-
# @param entity_type [String]
|
121
|
-
# @return [String]
|
122
|
-
def self.entity_type_path project, entity_type
|
123
|
-
ENTITY_TYPE_PATH_TEMPLATE.render(
|
124
|
-
:"project" => project,
|
125
|
-
:"entity_type" => entity_type
|
126
|
-
)
|
127
|
-
end
|
128
|
-
|
129
|
-
# Returns a fully-qualified project_agent resource name string.
|
130
|
-
# @param project [String]
|
131
|
-
# @return [String]
|
132
|
-
def self.project_agent_path project
|
133
|
-
PROJECT_AGENT_PATH_TEMPLATE.render(
|
134
|
-
:"project" => project
|
135
|
-
)
|
136
|
-
end
|
137
|
-
|
138
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
139
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
140
|
-
# be many types.
|
141
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
142
|
-
# authenticating requests made by this client.
|
143
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
144
|
-
# credentials for this client.
|
145
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
146
|
-
# credentials for this client.
|
147
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
148
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
149
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
150
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
151
|
-
# metadata for requests, generally, to give OAuth credentials.
|
152
|
-
# @param scopes [Array<String>]
|
153
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
154
|
-
# an updater_proc is supplied.
|
155
|
-
# @param client_config [Hash]
|
156
|
-
# A Hash for call options for each method. See
|
157
|
-
# Google::Gax#construct_settings for the structure of
|
158
|
-
# this data. Falls back to the default config if not specified
|
159
|
-
# or the specified config is missing data points.
|
160
|
-
# @param timeout [Numeric]
|
161
|
-
# The default timeout, in seconds, for calls made through this client.
|
162
|
-
# @param metadata [Hash]
|
163
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
164
|
-
# @param service_address [String]
|
165
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
166
|
-
# @param service_port [Integer]
|
167
|
-
# Override for the service port, or `nil` to leave as the default.
|
168
|
-
# @param exception_transformer [Proc]
|
169
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
170
|
-
# custom error handling.
|
171
|
-
def initialize \
|
172
|
-
credentials: nil,
|
173
|
-
scopes: ALL_SCOPES,
|
174
|
-
client_config: {},
|
175
|
-
timeout: DEFAULT_TIMEOUT,
|
176
|
-
metadata: nil,
|
177
|
-
service_address: nil,
|
178
|
-
service_port: nil,
|
179
|
-
exception_transformer: nil,
|
180
|
-
lib_name: nil,
|
181
|
-
lib_version: ""
|
182
|
-
# These require statements are intentionally placed here to initialize
|
183
|
-
# the gRPC module only when it's required.
|
184
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
185
|
-
require "google/gax/grpc"
|
186
|
-
require "google/cloud/dialogflow/v2/entity_type_services_pb"
|
187
|
-
|
188
|
-
credentials ||= Google::Cloud::Dialogflow::V2::Credentials.default
|
189
|
-
|
190
|
-
@operations_client = OperationsClient.new(
|
191
|
-
credentials: credentials,
|
192
|
-
scopes: scopes,
|
193
|
-
client_config: client_config,
|
194
|
-
timeout: timeout,
|
195
|
-
lib_name: lib_name,
|
196
|
-
service_address: service_address,
|
197
|
-
service_port: service_port,
|
198
|
-
lib_version: lib_version,
|
199
|
-
metadata: metadata,
|
200
|
-
)
|
201
|
-
|
202
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
203
|
-
updater_proc = Google::Cloud::Dialogflow::V2::Credentials.new(credentials).updater_proc
|
204
|
-
end
|
205
|
-
if credentials.is_a?(GRPC::Core::Channel)
|
206
|
-
channel = credentials
|
207
|
-
end
|
208
|
-
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
209
|
-
chan_creds = credentials
|
210
|
-
end
|
211
|
-
if credentials.is_a?(Proc)
|
212
|
-
updater_proc = credentials
|
213
|
-
end
|
214
|
-
if credentials.is_a?(Google::Auth::Credentials)
|
215
|
-
updater_proc = credentials.updater_proc
|
216
|
-
end
|
217
|
-
|
218
|
-
package_version = Google::Cloud::Dialogflow::VERSION
|
219
|
-
|
220
|
-
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
221
|
-
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
222
|
-
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
223
|
-
google_api_client << " grpc/#{GRPC::VERSION}"
|
224
|
-
google_api_client.freeze
|
225
|
-
|
226
|
-
headers = { :"x-goog-api-client" => google_api_client }
|
227
|
-
headers.merge!(metadata) unless metadata.nil?
|
228
|
-
client_config_file = Pathname.new(__dir__).join(
|
229
|
-
"entity_types_client_config.json"
|
230
|
-
)
|
231
|
-
defaults = client_config_file.open do |f|
|
232
|
-
Google::Gax.construct_settings(
|
233
|
-
"google.cloud.dialogflow.v2.EntityTypes",
|
234
|
-
JSON.parse(f.read),
|
235
|
-
client_config,
|
236
|
-
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
237
|
-
timeout,
|
238
|
-
page_descriptors: PAGE_DESCRIPTORS,
|
239
|
-
errors: Google::Gax::Grpc::API_ERRORS,
|
240
|
-
metadata: headers
|
241
|
-
)
|
242
|
-
end
|
243
|
-
|
244
|
-
# Allow overriding the service path/port in subclasses.
|
245
|
-
service_path = service_address || self.class::SERVICE_ADDRESS
|
246
|
-
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
247
|
-
interceptors = self.class::GRPC_INTERCEPTORS
|
248
|
-
@entity_types_stub = Google::Gax::Grpc.create_stub(
|
249
|
-
service_path,
|
250
|
-
port,
|
251
|
-
chan_creds: chan_creds,
|
252
|
-
channel: channel,
|
253
|
-
updater_proc: updater_proc,
|
254
|
-
scopes: scopes,
|
255
|
-
interceptors: interceptors,
|
256
|
-
&Google::Cloud::Dialogflow::V2::EntityTypes::Stub.method(:new)
|
257
|
-
)
|
258
|
-
|
259
|
-
@list_entity_types = Google::Gax.create_api_call(
|
260
|
-
@entity_types_stub.method(:list_entity_types),
|
261
|
-
defaults["list_entity_types"],
|
262
|
-
exception_transformer: exception_transformer,
|
263
|
-
params_extractor: proc do |request|
|
264
|
-
{'parent' => request.parent}
|
265
|
-
end
|
266
|
-
)
|
267
|
-
@get_entity_type = Google::Gax.create_api_call(
|
268
|
-
@entity_types_stub.method(:get_entity_type),
|
269
|
-
defaults["get_entity_type"],
|
270
|
-
exception_transformer: exception_transformer,
|
271
|
-
params_extractor: proc do |request|
|
272
|
-
{'name' => request.name}
|
273
|
-
end
|
274
|
-
)
|
275
|
-
@create_entity_type = Google::Gax.create_api_call(
|
276
|
-
@entity_types_stub.method(:create_entity_type),
|
277
|
-
defaults["create_entity_type"],
|
278
|
-
exception_transformer: exception_transformer,
|
279
|
-
params_extractor: proc do |request|
|
280
|
-
{'parent' => request.parent}
|
281
|
-
end
|
282
|
-
)
|
283
|
-
@update_entity_type = Google::Gax.create_api_call(
|
284
|
-
@entity_types_stub.method(:update_entity_type),
|
285
|
-
defaults["update_entity_type"],
|
286
|
-
exception_transformer: exception_transformer,
|
287
|
-
params_extractor: proc do |request|
|
288
|
-
{'entity_type.name' => request.entity_type.name}
|
289
|
-
end
|
290
|
-
)
|
291
|
-
@delete_entity_type = Google::Gax.create_api_call(
|
292
|
-
@entity_types_stub.method(:delete_entity_type),
|
293
|
-
defaults["delete_entity_type"],
|
294
|
-
exception_transformer: exception_transformer,
|
295
|
-
params_extractor: proc do |request|
|
296
|
-
{'name' => request.name}
|
297
|
-
end
|
298
|
-
)
|
299
|
-
@batch_update_entity_types = Google::Gax.create_api_call(
|
300
|
-
@entity_types_stub.method(:batch_update_entity_types),
|
301
|
-
defaults["batch_update_entity_types"],
|
302
|
-
exception_transformer: exception_transformer,
|
303
|
-
params_extractor: proc do |request|
|
304
|
-
{'parent' => request.parent}
|
305
|
-
end
|
306
|
-
)
|
307
|
-
@batch_delete_entity_types = Google::Gax.create_api_call(
|
308
|
-
@entity_types_stub.method(:batch_delete_entity_types),
|
309
|
-
defaults["batch_delete_entity_types"],
|
310
|
-
exception_transformer: exception_transformer,
|
311
|
-
params_extractor: proc do |request|
|
312
|
-
{'parent' => request.parent}
|
313
|
-
end
|
314
|
-
)
|
315
|
-
@batch_create_entities = Google::Gax.create_api_call(
|
316
|
-
@entity_types_stub.method(:batch_create_entities),
|
317
|
-
defaults["batch_create_entities"],
|
318
|
-
exception_transformer: exception_transformer,
|
319
|
-
params_extractor: proc do |request|
|
320
|
-
{'parent' => request.parent}
|
321
|
-
end
|
322
|
-
)
|
323
|
-
@batch_update_entities = Google::Gax.create_api_call(
|
324
|
-
@entity_types_stub.method(:batch_update_entities),
|
325
|
-
defaults["batch_update_entities"],
|
326
|
-
exception_transformer: exception_transformer,
|
327
|
-
params_extractor: proc do |request|
|
328
|
-
{'parent' => request.parent}
|
329
|
-
end
|
330
|
-
)
|
331
|
-
@batch_delete_entities = Google::Gax.create_api_call(
|
332
|
-
@entity_types_stub.method(:batch_delete_entities),
|
333
|
-
defaults["batch_delete_entities"],
|
334
|
-
exception_transformer: exception_transformer,
|
335
|
-
params_extractor: proc do |request|
|
336
|
-
{'parent' => request.parent}
|
337
|
-
end
|
338
|
-
)
|
339
|
-
end
|
340
|
-
|
341
|
-
# Service calls
|
342
|
-
|
343
|
-
# Returns the list of all entity types in the specified agent.
|
344
|
-
#
|
345
|
-
# @param parent [String]
|
346
|
-
# Required. The agent to list all entity types from.
|
347
|
-
# Format: `projects/<Project ID>/agent`.
|
348
|
-
# @param language_code [String]
|
349
|
-
# Optional. The language to list entity synonyms for. If not specified,
|
350
|
-
# the agent's default language is used.
|
351
|
-
# [Many
|
352
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
353
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
354
|
-
# be used.
|
355
|
-
# @param page_size [Integer]
|
356
|
-
# The maximum number of resources contained in the underlying API
|
357
|
-
# response. If page streaming is performed per-resource, this
|
358
|
-
# parameter does not affect the return value. If page streaming is
|
359
|
-
# performed per-page, this determines the maximum number of
|
360
|
-
# resources in a page.
|
361
|
-
# @param options [Google::Gax::CallOptions]
|
362
|
-
# Overrides the default settings for this call, e.g, timeout,
|
363
|
-
# retries, etc.
|
364
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
365
|
-
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Dialogflow::V2::EntityType>]
|
366
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
367
|
-
# @return [Google::Gax::PagedEnumerable<Google::Cloud::Dialogflow::V2::EntityType>]
|
368
|
-
# An enumerable of Google::Cloud::Dialogflow::V2::EntityType instances.
|
369
|
-
# See Google::Gax::PagedEnumerable documentation for other
|
370
|
-
# operations such as per-page iteration or access to the response
|
371
|
-
# object.
|
372
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
373
|
-
# @example
|
374
|
-
# require "google/cloud/dialogflow"
|
375
|
-
#
|
376
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
377
|
-
# formatted_parent = Google::Cloud::Dialogflow::V2::EntityTypesClient.project_agent_path("[PROJECT]")
|
378
|
-
#
|
379
|
-
# # Iterate over all results.
|
380
|
-
# entity_types_client.list_entity_types(formatted_parent).each do |element|
|
381
|
-
# # Process element.
|
382
|
-
# end
|
383
|
-
#
|
384
|
-
# # Or iterate over results one page at a time.
|
385
|
-
# entity_types_client.list_entity_types(formatted_parent).each_page do |page|
|
386
|
-
# # Process each page at a time.
|
387
|
-
# page.each do |element|
|
388
|
-
# # Process element.
|
389
|
-
# end
|
390
|
-
# end
|
391
|
-
|
392
|
-
def list_entity_types \
|
393
|
-
parent,
|
394
|
-
language_code: nil,
|
395
|
-
page_size: nil,
|
396
|
-
options: nil,
|
397
|
-
&block
|
398
|
-
req = {
|
399
|
-
parent: parent,
|
400
|
-
language_code: language_code,
|
401
|
-
page_size: page_size
|
402
|
-
}.delete_if { |_, v| v.nil? }
|
403
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::ListEntityTypesRequest)
|
404
|
-
@list_entity_types.call(req, options, &block)
|
405
|
-
end
|
406
|
-
|
407
|
-
# Retrieves the specified entity type.
|
408
|
-
#
|
409
|
-
# @param name [String]
|
410
|
-
# Required. The name of the entity type.
|
411
|
-
# Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
|
412
|
-
# @param language_code [String]
|
413
|
-
# Optional. The language to retrieve entity synonyms for. If not specified,
|
414
|
-
# the agent's default language is used.
|
415
|
-
# [Many
|
416
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
417
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
418
|
-
# be used.
|
419
|
-
# @param options [Google::Gax::CallOptions]
|
420
|
-
# Overrides the default settings for this call, e.g, timeout,
|
421
|
-
# retries, etc.
|
422
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
423
|
-
# @yieldparam result [Google::Cloud::Dialogflow::V2::EntityType]
|
424
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
425
|
-
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
426
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
427
|
-
# @example
|
428
|
-
# require "google/cloud/dialogflow"
|
429
|
-
#
|
430
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
431
|
-
# formatted_name = Google::Cloud::Dialogflow::V2::EntityTypesClient.entity_type_path("[PROJECT]", "[ENTITY_TYPE]")
|
432
|
-
# response = entity_types_client.get_entity_type(formatted_name)
|
433
|
-
|
434
|
-
def get_entity_type \
|
435
|
-
name,
|
436
|
-
language_code: nil,
|
437
|
-
options: nil,
|
438
|
-
&block
|
439
|
-
req = {
|
440
|
-
name: name,
|
441
|
-
language_code: language_code
|
442
|
-
}.delete_if { |_, v| v.nil? }
|
443
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::GetEntityTypeRequest)
|
444
|
-
@get_entity_type.call(req, options, &block)
|
445
|
-
end
|
446
|
-
|
447
|
-
# Creates an entity type in the specified agent.
|
448
|
-
#
|
449
|
-
# @param parent [String]
|
450
|
-
# Required. The agent to create a entity type for.
|
451
|
-
# Format: `projects/<Project ID>/agent`.
|
452
|
-
# @param entity_type [Google::Cloud::Dialogflow::V2::EntityType | Hash]
|
453
|
-
# Required. The entity type to create.
|
454
|
-
# A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityType`
|
455
|
-
# can also be provided.
|
456
|
-
# @param language_code [String]
|
457
|
-
# Optional. The language of entity synonyms defined in `entity_type`. If not
|
458
|
-
# specified, the agent's default language is used.
|
459
|
-
# [Many
|
460
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
461
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
462
|
-
# be used.
|
463
|
-
# @param options [Google::Gax::CallOptions]
|
464
|
-
# Overrides the default settings for this call, e.g, timeout,
|
465
|
-
# retries, etc.
|
466
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
467
|
-
# @yieldparam result [Google::Cloud::Dialogflow::V2::EntityType]
|
468
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
469
|
-
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
470
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
471
|
-
# @example
|
472
|
-
# require "google/cloud/dialogflow"
|
473
|
-
#
|
474
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
475
|
-
# formatted_parent = Google::Cloud::Dialogflow::V2::EntityTypesClient.project_agent_path("[PROJECT]")
|
476
|
-
#
|
477
|
-
# # TODO: Initialize `entity_type`:
|
478
|
-
# entity_type = {}
|
479
|
-
# response = entity_types_client.create_entity_type(formatted_parent, entity_type)
|
480
|
-
|
481
|
-
def create_entity_type \
|
482
|
-
parent,
|
483
|
-
entity_type,
|
484
|
-
language_code: nil,
|
485
|
-
options: nil,
|
486
|
-
&block
|
487
|
-
req = {
|
488
|
-
parent: parent,
|
489
|
-
entity_type: entity_type,
|
490
|
-
language_code: language_code
|
491
|
-
}.delete_if { |_, v| v.nil? }
|
492
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest)
|
493
|
-
@create_entity_type.call(req, options, &block)
|
494
|
-
end
|
495
|
-
|
496
|
-
# Updates the specified entity type.
|
497
|
-
#
|
498
|
-
# @param entity_type [Google::Cloud::Dialogflow::V2::EntityType | Hash]
|
499
|
-
# Required. The entity type to update.
|
500
|
-
# A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityType`
|
501
|
-
# can also be provided.
|
502
|
-
# @param language_code [String]
|
503
|
-
# Optional. The language of entity synonyms defined in `entity_type`. If not
|
504
|
-
# specified, the agent's default language is used.
|
505
|
-
# [Many
|
506
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
507
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
508
|
-
# be used.
|
509
|
-
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
510
|
-
# Optional. The mask to control which fields get updated.
|
511
|
-
# A hash of the same form as `Google::Protobuf::FieldMask`
|
512
|
-
# can also be provided.
|
513
|
-
# @param options [Google::Gax::CallOptions]
|
514
|
-
# Overrides the default settings for this call, e.g, timeout,
|
515
|
-
# retries, etc.
|
516
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
517
|
-
# @yieldparam result [Google::Cloud::Dialogflow::V2::EntityType]
|
518
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
519
|
-
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
520
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
521
|
-
# @example
|
522
|
-
# require "google/cloud/dialogflow"
|
523
|
-
#
|
524
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
525
|
-
#
|
526
|
-
# # TODO: Initialize `entity_type`:
|
527
|
-
# entity_type = {}
|
528
|
-
# response = entity_types_client.update_entity_type(entity_type)
|
529
|
-
|
530
|
-
def update_entity_type \
|
531
|
-
entity_type,
|
532
|
-
language_code: nil,
|
533
|
-
update_mask: nil,
|
534
|
-
options: nil,
|
535
|
-
&block
|
536
|
-
req = {
|
537
|
-
entity_type: entity_type,
|
538
|
-
language_code: language_code,
|
539
|
-
update_mask: update_mask
|
540
|
-
}.delete_if { |_, v| v.nil? }
|
541
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest)
|
542
|
-
@update_entity_type.call(req, options, &block)
|
543
|
-
end
|
544
|
-
|
545
|
-
# Deletes the specified entity type.
|
546
|
-
#
|
547
|
-
# @param name [String]
|
548
|
-
# Required. The name of the entity type to delete.
|
549
|
-
# Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
|
550
|
-
# @param options [Google::Gax::CallOptions]
|
551
|
-
# Overrides the default settings for this call, e.g, timeout,
|
552
|
-
# retries, etc.
|
553
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
554
|
-
# @yieldparam result []
|
555
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
556
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
557
|
-
# @example
|
558
|
-
# require "google/cloud/dialogflow"
|
559
|
-
#
|
560
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
561
|
-
# formatted_name = Google::Cloud::Dialogflow::V2::EntityTypesClient.entity_type_path("[PROJECT]", "[ENTITY_TYPE]")
|
562
|
-
# entity_types_client.delete_entity_type(formatted_name)
|
563
|
-
|
564
|
-
def delete_entity_type \
|
565
|
-
name,
|
566
|
-
options: nil,
|
567
|
-
&block
|
568
|
-
req = {
|
569
|
-
name: name
|
570
|
-
}.delete_if { |_, v| v.nil? }
|
571
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest)
|
572
|
-
@delete_entity_type.call(req, options, &block)
|
573
|
-
nil
|
574
|
-
end
|
575
|
-
|
576
|
-
# Updates/Creates multiple entity types in the specified agent.
|
577
|
-
#
|
578
|
-
# Operation <response: {Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse}>
|
579
|
-
#
|
580
|
-
# @param parent [String]
|
581
|
-
# Required. The name of the agent to update or create entity types in.
|
582
|
-
# Format: `projects/<Project ID>/agent`.
|
583
|
-
# @param entity_type_batch_uri [String]
|
584
|
-
# The URI to a Google Cloud Storage file containing entity types to update
|
585
|
-
# or create. The file format can either be a serialized proto (of
|
586
|
-
# EntityBatch type) or a JSON object. Note: The URI must start with
|
587
|
-
# "gs://".
|
588
|
-
# @param entity_type_batch_inline [Google::Cloud::Dialogflow::V2::EntityTypeBatch | Hash]
|
589
|
-
# The collection of entity types to update or create.
|
590
|
-
# A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityTypeBatch`
|
591
|
-
# can also be provided.
|
592
|
-
# @param language_code [String]
|
593
|
-
# Optional. The language of entity synonyms defined in `entity_types`. If not
|
594
|
-
# specified, the agent's default language is used.
|
595
|
-
# [Many
|
596
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
597
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
598
|
-
# be used.
|
599
|
-
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
600
|
-
# Optional. The mask to control which fields get updated.
|
601
|
-
# A hash of the same form as `Google::Protobuf::FieldMask`
|
602
|
-
# can also be provided.
|
603
|
-
# @param options [Google::Gax::CallOptions]
|
604
|
-
# Overrides the default settings for this call, e.g, timeout,
|
605
|
-
# retries, etc.
|
606
|
-
# @return [Google::Gax::Operation]
|
607
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
608
|
-
# @example
|
609
|
-
# require "google/cloud/dialogflow"
|
610
|
-
#
|
611
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
612
|
-
# formatted_parent = Google::Cloud::Dialogflow::V2::EntityTypesClient.project_agent_path("[PROJECT]")
|
613
|
-
#
|
614
|
-
# # Register a callback during the method call.
|
615
|
-
# operation = entity_types_client.batch_update_entity_types(formatted_parent) do |op|
|
616
|
-
# raise op.results.message if op.error?
|
617
|
-
# op_results = op.results
|
618
|
-
# # Process the results.
|
619
|
-
#
|
620
|
-
# metadata = op.metadata
|
621
|
-
# # Process the metadata.
|
622
|
-
# end
|
623
|
-
#
|
624
|
-
# # Or use the return value to register a callback.
|
625
|
-
# operation.on_done do |op|
|
626
|
-
# raise op.results.message if op.error?
|
627
|
-
# op_results = op.results
|
628
|
-
# # Process the results.
|
629
|
-
#
|
630
|
-
# metadata = op.metadata
|
631
|
-
# # Process the metadata.
|
632
|
-
# end
|
633
|
-
#
|
634
|
-
# # Manually reload the operation.
|
635
|
-
# operation.reload!
|
636
|
-
#
|
637
|
-
# # Or block until the operation completes, triggering callbacks on
|
638
|
-
# # completion.
|
639
|
-
# operation.wait_until_done!
|
640
|
-
|
641
|
-
def batch_update_entity_types \
|
642
|
-
parent,
|
643
|
-
entity_type_batch_uri: nil,
|
644
|
-
entity_type_batch_inline: nil,
|
645
|
-
language_code: nil,
|
646
|
-
update_mask: nil,
|
647
|
-
options: nil
|
648
|
-
req = {
|
649
|
-
parent: parent,
|
650
|
-
entity_type_batch_uri: entity_type_batch_uri,
|
651
|
-
entity_type_batch_inline: entity_type_batch_inline,
|
652
|
-
language_code: language_code,
|
653
|
-
update_mask: update_mask
|
654
|
-
}.delete_if { |_, v| v.nil? }
|
655
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest)
|
656
|
-
operation = Google::Gax::Operation.new(
|
657
|
-
@batch_update_entity_types.call(req, options),
|
658
|
-
@operations_client,
|
659
|
-
Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse,
|
660
|
-
Google::Protobuf::Struct,
|
661
|
-
call_options: options
|
662
|
-
)
|
663
|
-
operation.on_done { |operation| yield(operation) } if block_given?
|
664
|
-
operation
|
665
|
-
end
|
666
|
-
|
667
|
-
# Deletes entity types in the specified agent.
|
668
|
-
#
|
669
|
-
# Operation <response: {Google::Protobuf::Empty}>
|
670
|
-
#
|
671
|
-
# @param parent [String]
|
672
|
-
# Required. The name of the agent to delete all entities types for. Format:
|
673
|
-
# `projects/<Project ID>/agent`.
|
674
|
-
# @param entity_type_names [Array<String>]
|
675
|
-
# Required. The names entity types to delete. All names must point to the
|
676
|
-
# same agent as `parent`.
|
677
|
-
# @param options [Google::Gax::CallOptions]
|
678
|
-
# Overrides the default settings for this call, e.g, timeout,
|
679
|
-
# retries, etc.
|
680
|
-
# @return [Google::Gax::Operation]
|
681
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
682
|
-
# @example
|
683
|
-
# require "google/cloud/dialogflow"
|
684
|
-
#
|
685
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
686
|
-
# formatted_parent = Google::Cloud::Dialogflow::V2::EntityTypesClient.project_agent_path("[PROJECT]")
|
687
|
-
#
|
688
|
-
# # TODO: Initialize `entity_type_names`:
|
689
|
-
# entity_type_names = []
|
690
|
-
#
|
691
|
-
# # Register a callback during the method call.
|
692
|
-
# operation = entity_types_client.batch_delete_entity_types(formatted_parent, entity_type_names) do |op|
|
693
|
-
# raise op.results.message if op.error?
|
694
|
-
# op_results = op.results
|
695
|
-
# # Process the results.
|
696
|
-
#
|
697
|
-
# metadata = op.metadata
|
698
|
-
# # Process the metadata.
|
699
|
-
# end
|
700
|
-
#
|
701
|
-
# # Or use the return value to register a callback.
|
702
|
-
# operation.on_done do |op|
|
703
|
-
# raise op.results.message if op.error?
|
704
|
-
# op_results = op.results
|
705
|
-
# # Process the results.
|
706
|
-
#
|
707
|
-
# metadata = op.metadata
|
708
|
-
# # Process the metadata.
|
709
|
-
# end
|
710
|
-
#
|
711
|
-
# # Manually reload the operation.
|
712
|
-
# operation.reload!
|
713
|
-
#
|
714
|
-
# # Or block until the operation completes, triggering callbacks on
|
715
|
-
# # completion.
|
716
|
-
# operation.wait_until_done!
|
717
|
-
|
718
|
-
def batch_delete_entity_types \
|
719
|
-
parent,
|
720
|
-
entity_type_names,
|
721
|
-
options: nil
|
722
|
-
req = {
|
723
|
-
parent: parent,
|
724
|
-
entity_type_names: entity_type_names
|
725
|
-
}.delete_if { |_, v| v.nil? }
|
726
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest)
|
727
|
-
operation = Google::Gax::Operation.new(
|
728
|
-
@batch_delete_entity_types.call(req, options),
|
729
|
-
@operations_client,
|
730
|
-
Google::Protobuf::Empty,
|
731
|
-
Google::Protobuf::Struct,
|
732
|
-
call_options: options
|
733
|
-
)
|
734
|
-
operation.on_done { |operation| yield(operation) } if block_given?
|
735
|
-
operation
|
736
|
-
end
|
737
|
-
|
738
|
-
# Creates multiple new entities in the specified entity type.
|
739
|
-
#
|
740
|
-
# Operation <response: {Google::Protobuf::Empty}>
|
741
|
-
#
|
742
|
-
# @param parent [String]
|
743
|
-
# Required. The name of the entity type to create entities in. Format:
|
744
|
-
# `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
|
745
|
-
# @param entities [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity | Hash>]
|
746
|
-
# Required. The entities to create.
|
747
|
-
# A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityType::Entity`
|
748
|
-
# can also be provided.
|
749
|
-
# @param language_code [String]
|
750
|
-
# Optional. The language of entity synonyms defined in `entities`. If not
|
751
|
-
# specified, the agent's default language is used.
|
752
|
-
# [Many
|
753
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
754
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
755
|
-
# be used.
|
756
|
-
# @param options [Google::Gax::CallOptions]
|
757
|
-
# Overrides the default settings for this call, e.g, timeout,
|
758
|
-
# retries, etc.
|
759
|
-
# @return [Google::Gax::Operation]
|
760
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
761
|
-
# @example
|
762
|
-
# require "google/cloud/dialogflow"
|
763
|
-
#
|
764
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
765
|
-
# formatted_parent = Google::Cloud::Dialogflow::V2::EntityTypesClient.entity_type_path("[PROJECT]", "[ENTITY_TYPE]")
|
766
|
-
#
|
767
|
-
# # TODO: Initialize `entities`:
|
768
|
-
# entities = []
|
769
|
-
#
|
770
|
-
# # Register a callback during the method call.
|
771
|
-
# operation = entity_types_client.batch_create_entities(formatted_parent, entities) do |op|
|
772
|
-
# raise op.results.message if op.error?
|
773
|
-
# op_results = op.results
|
774
|
-
# # Process the results.
|
775
|
-
#
|
776
|
-
# metadata = op.metadata
|
777
|
-
# # Process the metadata.
|
778
|
-
# end
|
779
|
-
#
|
780
|
-
# # Or use the return value to register a callback.
|
781
|
-
# operation.on_done do |op|
|
782
|
-
# raise op.results.message if op.error?
|
783
|
-
# op_results = op.results
|
784
|
-
# # Process the results.
|
785
|
-
#
|
786
|
-
# metadata = op.metadata
|
787
|
-
# # Process the metadata.
|
788
|
-
# end
|
789
|
-
#
|
790
|
-
# # Manually reload the operation.
|
791
|
-
# operation.reload!
|
792
|
-
#
|
793
|
-
# # Or block until the operation completes, triggering callbacks on
|
794
|
-
# # completion.
|
795
|
-
# operation.wait_until_done!
|
796
|
-
|
797
|
-
def batch_create_entities \
|
798
|
-
parent,
|
799
|
-
entities,
|
800
|
-
language_code: nil,
|
801
|
-
options: nil
|
802
|
-
req = {
|
803
|
-
parent: parent,
|
804
|
-
entities: entities,
|
805
|
-
language_code: language_code
|
806
|
-
}.delete_if { |_, v| v.nil? }
|
807
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest)
|
808
|
-
operation = Google::Gax::Operation.new(
|
809
|
-
@batch_create_entities.call(req, options),
|
810
|
-
@operations_client,
|
811
|
-
Google::Protobuf::Empty,
|
812
|
-
Google::Protobuf::Struct,
|
813
|
-
call_options: options
|
814
|
-
)
|
815
|
-
operation.on_done { |operation| yield(operation) } if block_given?
|
816
|
-
operation
|
817
|
-
end
|
818
|
-
|
819
|
-
# Updates or creates multiple entities in the specified entity type. This
|
820
|
-
# method does not affect entities in the entity type that aren't explicitly
|
821
|
-
# specified in the request.
|
822
|
-
#
|
823
|
-
#
|
824
|
-
# Operation <response: {Google::Protobuf::Empty}>
|
825
|
-
#
|
826
|
-
# @param parent [String]
|
827
|
-
# Required. The name of the entity type to update or create entities in.
|
828
|
-
# Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
|
829
|
-
# @param entities [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity | Hash>]
|
830
|
-
# Required. The entities to update or create.
|
831
|
-
# A hash of the same form as `Google::Cloud::Dialogflow::V2::EntityType::Entity`
|
832
|
-
# can also be provided.
|
833
|
-
# @param language_code [String]
|
834
|
-
# Optional. The language of entity synonyms defined in `entities`. If not
|
835
|
-
# specified, the agent's default language is used.
|
836
|
-
# [Many
|
837
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
838
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
839
|
-
# be used.
|
840
|
-
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
841
|
-
# Optional. The mask to control which fields get updated.
|
842
|
-
# A hash of the same form as `Google::Protobuf::FieldMask`
|
843
|
-
# can also be provided.
|
844
|
-
# @param options [Google::Gax::CallOptions]
|
845
|
-
# Overrides the default settings for this call, e.g, timeout,
|
846
|
-
# retries, etc.
|
847
|
-
# @return [Google::Gax::Operation]
|
848
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
849
|
-
# @example
|
850
|
-
# require "google/cloud/dialogflow"
|
851
|
-
#
|
852
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
853
|
-
# formatted_parent = Google::Cloud::Dialogflow::V2::EntityTypesClient.entity_type_path("[PROJECT]", "[ENTITY_TYPE]")
|
854
|
-
#
|
855
|
-
# # TODO: Initialize `entities`:
|
856
|
-
# entities = []
|
857
|
-
#
|
858
|
-
# # Register a callback during the method call.
|
859
|
-
# operation = entity_types_client.batch_update_entities(formatted_parent, entities) do |op|
|
860
|
-
# raise op.results.message if op.error?
|
861
|
-
# op_results = op.results
|
862
|
-
# # Process the results.
|
863
|
-
#
|
864
|
-
# metadata = op.metadata
|
865
|
-
# # Process the metadata.
|
866
|
-
# end
|
867
|
-
#
|
868
|
-
# # Or use the return value to register a callback.
|
869
|
-
# operation.on_done do |op|
|
870
|
-
# raise op.results.message if op.error?
|
871
|
-
# op_results = op.results
|
872
|
-
# # Process the results.
|
873
|
-
#
|
874
|
-
# metadata = op.metadata
|
875
|
-
# # Process the metadata.
|
876
|
-
# end
|
877
|
-
#
|
878
|
-
# # Manually reload the operation.
|
879
|
-
# operation.reload!
|
880
|
-
#
|
881
|
-
# # Or block until the operation completes, triggering callbacks on
|
882
|
-
# # completion.
|
883
|
-
# operation.wait_until_done!
|
884
|
-
|
885
|
-
def batch_update_entities \
|
886
|
-
parent,
|
887
|
-
entities,
|
888
|
-
language_code: nil,
|
889
|
-
update_mask: nil,
|
890
|
-
options: nil
|
891
|
-
req = {
|
892
|
-
parent: parent,
|
893
|
-
entities: entities,
|
894
|
-
language_code: language_code,
|
895
|
-
update_mask: update_mask
|
896
|
-
}.delete_if { |_, v| v.nil? }
|
897
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest)
|
898
|
-
operation = Google::Gax::Operation.new(
|
899
|
-
@batch_update_entities.call(req, options),
|
900
|
-
@operations_client,
|
901
|
-
Google::Protobuf::Empty,
|
902
|
-
Google::Protobuf::Struct,
|
903
|
-
call_options: options
|
904
|
-
)
|
905
|
-
operation.on_done { |operation| yield(operation) } if block_given?
|
906
|
-
operation
|
907
|
-
end
|
908
|
-
|
909
|
-
# Deletes entities in the specified entity type.
|
910
|
-
#
|
911
|
-
#
|
912
|
-
# Operation <response: {Google::Protobuf::Empty}>
|
913
|
-
#
|
914
|
-
# @param parent [String]
|
915
|
-
# Required. The name of the entity type to delete entries for. Format:
|
916
|
-
# `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
|
917
|
-
# @param entity_values [Array<String>]
|
918
|
-
# Required. The reference `values` of the entities to delete. Note that
|
919
|
-
# these are not fully-qualified names, i.e. they don't start with
|
920
|
-
# `projects/<Project ID>`.
|
921
|
-
# @param language_code [String]
|
922
|
-
# Optional. The language of entity synonyms defined in `entities`. If not
|
923
|
-
# specified, the agent's default language is used.
|
924
|
-
# [Many
|
925
|
-
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
926
|
-
# are supported. Note: languages must be enabled in the agent before they can
|
927
|
-
# be used.
|
928
|
-
# @param options [Google::Gax::CallOptions]
|
929
|
-
# Overrides the default settings for this call, e.g, timeout,
|
930
|
-
# retries, etc.
|
931
|
-
# @return [Google::Gax::Operation]
|
932
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
933
|
-
# @example
|
934
|
-
# require "google/cloud/dialogflow"
|
935
|
-
#
|
936
|
-
# entity_types_client = Google::Cloud::Dialogflow::EntityTypes.new(version: :v2)
|
937
|
-
# formatted_parent = Google::Cloud::Dialogflow::V2::EntityTypesClient.entity_type_path("[PROJECT]", "[ENTITY_TYPE]")
|
938
|
-
#
|
939
|
-
# # TODO: Initialize `entity_values`:
|
940
|
-
# entity_values = []
|
941
|
-
#
|
942
|
-
# # Register a callback during the method call.
|
943
|
-
# operation = entity_types_client.batch_delete_entities(formatted_parent, entity_values) do |op|
|
944
|
-
# raise op.results.message if op.error?
|
945
|
-
# op_results = op.results
|
946
|
-
# # Process the results.
|
947
|
-
#
|
948
|
-
# metadata = op.metadata
|
949
|
-
# # Process the metadata.
|
950
|
-
# end
|
951
|
-
#
|
952
|
-
# # Or use the return value to register a callback.
|
953
|
-
# operation.on_done do |op|
|
954
|
-
# raise op.results.message if op.error?
|
955
|
-
# op_results = op.results
|
956
|
-
# # Process the results.
|
957
|
-
#
|
958
|
-
# metadata = op.metadata
|
959
|
-
# # Process the metadata.
|
960
|
-
# end
|
961
|
-
#
|
962
|
-
# # Manually reload the operation.
|
963
|
-
# operation.reload!
|
964
|
-
#
|
965
|
-
# # Or block until the operation completes, triggering callbacks on
|
966
|
-
# # completion.
|
967
|
-
# operation.wait_until_done!
|
968
|
-
|
969
|
-
def batch_delete_entities \
|
970
|
-
parent,
|
971
|
-
entity_values,
|
972
|
-
language_code: nil,
|
973
|
-
options: nil
|
974
|
-
req = {
|
975
|
-
parent: parent,
|
976
|
-
entity_values: entity_values,
|
977
|
-
language_code: language_code
|
978
|
-
}.delete_if { |_, v| v.nil? }
|
979
|
-
req = Google::Gax::to_proto(req, Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest)
|
980
|
-
operation = Google::Gax::Operation.new(
|
981
|
-
@batch_delete_entities.call(req, options),
|
982
|
-
@operations_client,
|
983
|
-
Google::Protobuf::Empty,
|
984
|
-
Google::Protobuf::Struct,
|
985
|
-
call_options: options
|
986
|
-
)
|
987
|
-
operation.on_done { |operation| yield(operation) } if block_given?
|
988
|
-
operation
|
989
|
-
end
|
990
|
-
end
|
991
|
-
end
|
992
|
-
end
|
993
|
-
end
|
994
|
-
end
|