google-cloud-dialogflow-v2 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +201 -0
- data/README.md +24 -0
- data/lib/google-cloud-dialogflow-v2.rb +1 -0
- data/lib/google/cloud/common_resources_pb.rb +15 -0
- data/lib/google/cloud/dialogflow/v2.rb +24 -0
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +122 -0
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +110 -0
- data/lib/google/cloud/dialogflow/v2/agents.rb +21 -0
- data/lib/google/cloud/dialogflow/v2/agents/client.rb +1047 -0
- data/lib/google/cloud/dialogflow/v2/agents/credentials.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/agents/operations.rb +559 -0
- data/lib/google/cloud/dialogflow/v2/agents/paths.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +97 -0
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +64 -0
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +74 -0
- data/lib/google/cloud/dialogflow/v2/contexts.rb +20 -0
- data/lib/google/cloud/dialogflow/v2/contexts/client.rb +756 -0
- data/lib/google/cloud/dialogflow/v2/contexts/credentials.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +50 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +126 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +104 -0
- data/lib/google/cloud/dialogflow/v2/entity_types.rb +21 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +1150 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +559 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +62 -0
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +368 -0
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +92 -0
- data/lib/google/cloud/dialogflow/v2/intents.rb +21 -0
- data/lib/google/cloud/dialogflow/v2/intents/client.rb +893 -0
- data/lib/google/cloud/dialogflow/v2/intents/credentials.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/intents/operations.rb +559 -0
- data/lib/google/cloud/dialogflow/v2/intents/paths.rb +81 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +66 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +92 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +20 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +727 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +69 -0
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +142 -0
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +55 -0
- data/lib/google/cloud/dialogflow/v2/sessions.rb +20 -0
- data/lib/google/cloud/dialogflow/v2/sessions/client.rb +472 -0
- data/lib/google/cloud/dialogflow/v2/sessions/credentials.rb +53 -0
- data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +110 -0
- data/lib/google/cloud/dialogflow/v2/validation_result_pb.rb +37 -0
- data/lib/google/cloud/dialogflow/v2/version.rb +28 -0
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +47 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +247 -0
- data/proto_docs/google/cloud/dialogflow/v2/agent.rb +287 -0
- data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +363 -0
- data/proto_docs/google/cloud/dialogflow/v2/context.rb +144 -0
- data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +354 -0
- data/proto_docs/google/cloud/dialogflow/v2/intent.rb +1070 -0
- data/proto_docs/google/cloud/dialogflow/v2/session.rb +541 -0
- data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +155 -0
- data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +81 -0
- data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +153 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +137 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +237 -0
- data/proto_docs/google/protobuf/struct.rb +96 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- metadata +225 -0
@@ -0,0 +1,53 @@
|
|
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
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dialogflow
|
25
|
+
module V2
|
26
|
+
module Contexts
|
27
|
+
# Credentials for the Contexts API.
|
28
|
+
class Credentials < Google::Auth::Credentials
|
29
|
+
self.scope = [
|
30
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
31
|
+
"https://www.googleapis.com/auth/dialogflow"
|
32
|
+
]
|
33
|
+
self.env_vars = [
|
34
|
+
"DIALOGFLOW_CREDENTIALS",
|
35
|
+
"DIALOGFLOW_KEYFILE",
|
36
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
37
|
+
"GOOGLE_CLOUD_KEYFILE",
|
38
|
+
"GCLOUD_KEYFILE",
|
39
|
+
"DIALOGFLOW_CREDENTIALS_JSON",
|
40
|
+
"DIALOGFLOW_KEYFILE_JSON",
|
41
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
42
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
43
|
+
"GCLOUD_KEYFILE_JSON"
|
44
|
+
]
|
45
|
+
self.paths = [
|
46
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
47
|
+
]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,50 @@
|
|
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 Contexts
|
25
|
+
# Path helper methods for the Contexts API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Context resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/agent/sessions/{session}/contexts/{context}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param session [String]
|
36
|
+
# @param context [String]
|
37
|
+
#
|
38
|
+
# @return [String]
|
39
|
+
def context_path project:, session:, context:
|
40
|
+
raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
41
|
+
raise ArgumentError, "session cannot contain /" if session.to_s.include? "/"
|
42
|
+
|
43
|
+
"projects/#{project}/agent/sessions/#{session}/contexts/#{context}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/dialogflow/v2/entity_type.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/client_pb'
|
8
|
+
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/resource_pb'
|
10
|
+
require 'google/longrunning/operations_pb'
|
11
|
+
require 'google/protobuf/empty_pb'
|
12
|
+
require 'google/protobuf/field_mask_pb'
|
13
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
|
+
add_file("google/cloud/dialogflow/v2/entity_type.proto", :syntax => :proto3) 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
|
+
end
|
101
|
+
|
102
|
+
module Google
|
103
|
+
module Cloud
|
104
|
+
module Dialogflow
|
105
|
+
module V2
|
106
|
+
EntityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType").msgclass
|
107
|
+
EntityType::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Entity").msgclass
|
108
|
+
EntityType::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.Kind").enummodule
|
109
|
+
EntityType::AutoExpansionMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityType.AutoExpansionMode").enummodule
|
110
|
+
ListEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesRequest").msgclass
|
111
|
+
ListEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListEntityTypesResponse").msgclass
|
112
|
+
GetEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetEntityTypeRequest").msgclass
|
113
|
+
CreateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateEntityTypeRequest").msgclass
|
114
|
+
UpdateEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateEntityTypeRequest").msgclass
|
115
|
+
DeleteEntityTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteEntityTypeRequest").msgclass
|
116
|
+
BatchUpdateEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest").msgclass
|
117
|
+
BatchUpdateEntityTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse").msgclass
|
118
|
+
BatchDeleteEntityTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest").msgclass
|
119
|
+
BatchCreateEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchCreateEntitiesRequest").msgclass
|
120
|
+
BatchUpdateEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest").msgclass
|
121
|
+
BatchDeleteEntitiesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest").msgclass
|
122
|
+
EntityTypeBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.EntityTypeBatch").msgclass
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
@@ -0,0 +1,104 @@
|
|
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 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/entity_type_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dialogflow
|
25
|
+
module V2
|
26
|
+
module EntityTypes
|
27
|
+
# Entities are extracted from user input and represent parameters that are
|
28
|
+
# meaningful to your application. For example, a date range, a proper name
|
29
|
+
# such as a geographic location or landmark, and so on. Entities represent
|
30
|
+
# actionable data for your application.
|
31
|
+
#
|
32
|
+
# When you define an entity, you can also include synonyms that all map to
|
33
|
+
# that entity. For example, "soft drink", "soda", "pop", and so on.
|
34
|
+
#
|
35
|
+
# There are three types of entities:
|
36
|
+
#
|
37
|
+
# * **System** - entities that are defined by the Dialogflow API for common
|
38
|
+
# data types such as date, time, currency, and so on. A system entity is
|
39
|
+
# represented by the `EntityType` type.
|
40
|
+
#
|
41
|
+
# * **Custom** - entities that are defined by you that represent
|
42
|
+
# actionable data that is meaningful to your application. For example,
|
43
|
+
# you could define a `pizza.sauce` entity for red or white pizza sauce,
|
44
|
+
# a `pizza.cheese` entity for the different types of cheese on a pizza,
|
45
|
+
# a `pizza.topping` entity for different toppings, and so on. A custom
|
46
|
+
# entity is represented by the `EntityType` type.
|
47
|
+
#
|
48
|
+
# * **User** - entities that are built for an individual user such as
|
49
|
+
# favorites, preferences, playlists, and so on. A user entity is
|
50
|
+
# represented by the [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type.
|
51
|
+
#
|
52
|
+
# For more information about entity types, see the
|
53
|
+
# [Dialogflow
|
54
|
+
# documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
|
55
|
+
class Service
|
56
|
+
|
57
|
+
include GRPC::GenericService
|
58
|
+
|
59
|
+
self.marshal_class_method = :encode
|
60
|
+
self.unmarshal_class_method = :decode
|
61
|
+
self.service_name = 'google.cloud.dialogflow.v2.EntityTypes'
|
62
|
+
|
63
|
+
# Returns the list of all entity types in the specified agent.
|
64
|
+
rpc :ListEntityTypes, ListEntityTypesRequest, ListEntityTypesResponse
|
65
|
+
# Retrieves the specified entity type.
|
66
|
+
rpc :GetEntityType, GetEntityTypeRequest, EntityType
|
67
|
+
# Creates an entity type in the specified agent.
|
68
|
+
rpc :CreateEntityType, CreateEntityTypeRequest, EntityType
|
69
|
+
# Updates the specified entity type.
|
70
|
+
rpc :UpdateEntityType, UpdateEntityTypeRequest, EntityType
|
71
|
+
# Deletes the specified entity type.
|
72
|
+
rpc :DeleteEntityType, DeleteEntityTypeRequest, Google::Protobuf::Empty
|
73
|
+
# Updates/Creates multiple entity types in the specified agent.
|
74
|
+
#
|
75
|
+
# Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
|
76
|
+
rpc :BatchUpdateEntityTypes, BatchUpdateEntityTypesRequest, Google::Longrunning::Operation
|
77
|
+
# Deletes entity types in the specified agent.
|
78
|
+
#
|
79
|
+
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
80
|
+
rpc :BatchDeleteEntityTypes, BatchDeleteEntityTypesRequest, Google::Longrunning::Operation
|
81
|
+
# Creates multiple new entities in the specified entity type.
|
82
|
+
#
|
83
|
+
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
84
|
+
rpc :BatchCreateEntities, BatchCreateEntitiesRequest, Google::Longrunning::Operation
|
85
|
+
# Updates or creates multiple entities in the specified entity type. This
|
86
|
+
# method does not affect entities in the entity type that aren't explicitly
|
87
|
+
# specified in the request.
|
88
|
+
#
|
89
|
+
#
|
90
|
+
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
91
|
+
rpc :BatchUpdateEntities, BatchUpdateEntitiesRequest, Google::Longrunning::Operation
|
92
|
+
# Deletes entities in the specified entity type.
|
93
|
+
#
|
94
|
+
#
|
95
|
+
# Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
|
96
|
+
rpc :BatchDeleteEntities, BatchDeleteEntitiesRequest, Google::Longrunning::Operation
|
97
|
+
end
|
98
|
+
|
99
|
+
Stub = Service.rpc_stub_class
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,21 @@
|
|
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/dialogflow/v2/entity_types/client"
|
20
|
+
require "google/cloud/dialogflow/v2/entity_types/operations"
|
21
|
+
require "google/cloud/dialogflow/v2/entity_types/credentials"
|
@@ -0,0 +1,1150 @@
|
|
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/errors"
|
24
|
+
require "google/cloud/dialogflow/v2/version"
|
25
|
+
require "google/cloud/dialogflow/v2/entity_type_pb"
|
26
|
+
require "google/cloud/dialogflow/v2/entity_types/credentials"
|
27
|
+
require "google/cloud/dialogflow/v2/entity_types/paths"
|
28
|
+
require "google/cloud/dialogflow/v2/entity_types/operations"
|
29
|
+
|
30
|
+
|
31
|
+
module Google
|
32
|
+
module Cloud
|
33
|
+
module Dialogflow
|
34
|
+
module V2
|
35
|
+
module EntityTypes
|
36
|
+
# Service that implements EntityTypes API.
|
37
|
+
class Client
|
38
|
+
include Paths
|
39
|
+
|
40
|
+
# @private
|
41
|
+
attr_reader :entity_types_stub
|
42
|
+
|
43
|
+
##
|
44
|
+
# Configure the EntityTypes Client class.
|
45
|
+
#
|
46
|
+
# See {Google::Cloud::Dialogflow::V2::EntityTypes::Client::Configuration}
|
47
|
+
# for a description of the configuration fields.
|
48
|
+
#
|
49
|
+
# ## Example
|
50
|
+
#
|
51
|
+
# To modify the configuration for all EntityTypes clients:
|
52
|
+
#
|
53
|
+
# Google::Cloud::Dialogflow::V2::EntityTypes::Client.configure do |config|
|
54
|
+
# config.timeout = 10_000
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# @yield [config] Configure the Client client.
|
58
|
+
# @yieldparam config [Client::Configuration]
|
59
|
+
#
|
60
|
+
# @return [Client::Configuration]
|
61
|
+
#
|
62
|
+
def self.configure
|
63
|
+
@configure ||= begin
|
64
|
+
namespace = ["Google", "Cloud", "Dialogflow", "V2"]
|
65
|
+
parent_config = while namespace.any?
|
66
|
+
parent_name = namespace.join "::"
|
67
|
+
parent_const = const_get parent_name
|
68
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
69
|
+
namespace.pop
|
70
|
+
end
|
71
|
+
default_config = Client::Configuration.new parent_config
|
72
|
+
|
73
|
+
default_config.rpcs.list_entity_types.timeout = 60.0
|
74
|
+
default_config.rpcs.list_entity_types.retry_policy = {
|
75
|
+
initial_delay: 0.1,
|
76
|
+
max_delay: 60.0,
|
77
|
+
multiplier: 1.3,
|
78
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
79
|
+
}
|
80
|
+
|
81
|
+
default_config.rpcs.get_entity_type.timeout = 60.0
|
82
|
+
default_config.rpcs.get_entity_type.retry_policy = {
|
83
|
+
initial_delay: 0.1,
|
84
|
+
max_delay: 60.0,
|
85
|
+
multiplier: 1.3,
|
86
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
87
|
+
}
|
88
|
+
|
89
|
+
default_config.rpcs.create_entity_type.timeout = 60.0
|
90
|
+
|
91
|
+
default_config.rpcs.update_entity_type.timeout = 60.0
|
92
|
+
|
93
|
+
default_config.rpcs.delete_entity_type.timeout = 60.0
|
94
|
+
default_config.rpcs.delete_entity_type.retry_policy = {
|
95
|
+
initial_delay: 0.1,
|
96
|
+
max_delay: 60.0,
|
97
|
+
multiplier: 1.3,
|
98
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
99
|
+
}
|
100
|
+
|
101
|
+
default_config.rpcs.batch_update_entity_types.timeout = 60.0
|
102
|
+
|
103
|
+
default_config.rpcs.batch_delete_entity_types.timeout = 60.0
|
104
|
+
default_config.rpcs.batch_delete_entity_types.retry_policy = {
|
105
|
+
initial_delay: 0.1,
|
106
|
+
max_delay: 60.0,
|
107
|
+
multiplier: 1.3,
|
108
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
109
|
+
}
|
110
|
+
|
111
|
+
default_config.rpcs.batch_create_entities.timeout = 60.0
|
112
|
+
|
113
|
+
default_config.rpcs.batch_update_entities.timeout = 60.0
|
114
|
+
|
115
|
+
default_config.rpcs.batch_delete_entities.timeout = 60.0
|
116
|
+
default_config.rpcs.batch_delete_entities.retry_policy = {
|
117
|
+
initial_delay: 0.1,
|
118
|
+
max_delay: 60.0,
|
119
|
+
multiplier: 1.3,
|
120
|
+
retry_codes: ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
|
121
|
+
}
|
122
|
+
|
123
|
+
default_config
|
124
|
+
end
|
125
|
+
yield @configure if block_given?
|
126
|
+
@configure
|
127
|
+
end
|
128
|
+
|
129
|
+
##
|
130
|
+
# Configure the EntityTypes Client instance.
|
131
|
+
#
|
132
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
133
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
134
|
+
# should be made on {Client.configure}.
|
135
|
+
#
|
136
|
+
# See {Google::Cloud::Dialogflow::V2::EntityTypes::Client::Configuration}
|
137
|
+
# for a description of the configuration fields.
|
138
|
+
#
|
139
|
+
# @yield [config] Configure the Client client.
|
140
|
+
# @yieldparam config [Client::Configuration]
|
141
|
+
#
|
142
|
+
# @return [Client::Configuration]
|
143
|
+
#
|
144
|
+
def configure
|
145
|
+
yield @config if block_given?
|
146
|
+
@config
|
147
|
+
end
|
148
|
+
|
149
|
+
##
|
150
|
+
# Create a new EntityTypes client object.
|
151
|
+
#
|
152
|
+
# ## Examples
|
153
|
+
#
|
154
|
+
# To create a new EntityTypes client with the default
|
155
|
+
# configuration:
|
156
|
+
#
|
157
|
+
# client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
|
158
|
+
#
|
159
|
+
# To create a new EntityTypes client with a custom
|
160
|
+
# configuration:
|
161
|
+
#
|
162
|
+
# client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config|
|
163
|
+
# config.timeout = 10_000
|
164
|
+
# end
|
165
|
+
#
|
166
|
+
# @yield [config] Configure the EntityTypes client.
|
167
|
+
# @yieldparam config [Client::Configuration]
|
168
|
+
#
|
169
|
+
def initialize
|
170
|
+
# These require statements are intentionally placed here to initialize
|
171
|
+
# the gRPC module only when it's required.
|
172
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
173
|
+
require "gapic/grpc"
|
174
|
+
require "google/cloud/dialogflow/v2/entity_type_services_pb"
|
175
|
+
|
176
|
+
# Create the configuration object
|
177
|
+
@config = Configuration.new Client.configure
|
178
|
+
|
179
|
+
# Yield the configuration if needed
|
180
|
+
yield @config if block_given?
|
181
|
+
|
182
|
+
# Create credentials
|
183
|
+
credentials = @config.credentials
|
184
|
+
credentials ||= Credentials.default scope: @config.scope
|
185
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
186
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
187
|
+
end
|
188
|
+
@quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
|
189
|
+
|
190
|
+
@operations_client = Operations.new do |config|
|
191
|
+
config.credentials = credentials
|
192
|
+
end
|
193
|
+
|
194
|
+
@entity_types_stub = Gapic::ServiceStub.new(
|
195
|
+
Google::Cloud::Dialogflow::V2::EntityTypes::Stub,
|
196
|
+
credentials: credentials,
|
197
|
+
endpoint: @config.endpoint,
|
198
|
+
channel_args: @config.channel_args,
|
199
|
+
interceptors: @config.interceptors
|
200
|
+
)
|
201
|
+
end
|
202
|
+
|
203
|
+
# Service calls
|
204
|
+
|
205
|
+
##
|
206
|
+
# Returns the list of all entity types in the specified agent.
|
207
|
+
#
|
208
|
+
# @overload list_entity_types(request, options = nil)
|
209
|
+
# @param request [Google::Cloud::Dialogflow::V2::ListEntityTypesRequest | Hash]
|
210
|
+
# Returns the list of all entity types in the specified agent.
|
211
|
+
# @param options [Gapic::CallOptions, Hash]
|
212
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
213
|
+
#
|
214
|
+
# @overload list_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil)
|
215
|
+
# @param parent [String]
|
216
|
+
# Required. The agent to list all entity types from.
|
217
|
+
# Format: `projects/<Project ID>/agent`.
|
218
|
+
# @param language_code [String]
|
219
|
+
# Optional. The language to list entity synonyms for. If not specified,
|
220
|
+
# the agent's default language is used.
|
221
|
+
# [Many
|
222
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
223
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
224
|
+
# be used.
|
225
|
+
# @param page_size [Integer]
|
226
|
+
# Optional. The maximum number of items to return in a single page. By
|
227
|
+
# default 100 and at most 1000.
|
228
|
+
# @param page_token [String]
|
229
|
+
# Optional. The next_page_token value returned from a previous list request.
|
230
|
+
#
|
231
|
+
#
|
232
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
233
|
+
# @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Dialogflow::V2::EntityType>]
|
234
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
235
|
+
#
|
236
|
+
# @return [Gapic::PagedEnumerable<Google::Cloud::Dialogflow::V2::EntityType>]
|
237
|
+
#
|
238
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
239
|
+
#
|
240
|
+
def list_entity_types request, options = nil
|
241
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
242
|
+
|
243
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::ListEntityTypesRequest
|
244
|
+
|
245
|
+
# Converts hash and nil to an options object
|
246
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
247
|
+
|
248
|
+
# Customize the options with defaults
|
249
|
+
metadata = @config.rpcs.list_entity_types.metadata.to_h
|
250
|
+
|
251
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
252
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
253
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
254
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
255
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
256
|
+
|
257
|
+
header_params = {
|
258
|
+
"parent" => request.parent
|
259
|
+
}
|
260
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
261
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
262
|
+
|
263
|
+
options.apply_defaults timeout: @config.rpcs.list_entity_types.timeout,
|
264
|
+
metadata: metadata,
|
265
|
+
retry_policy: @config.rpcs.list_entity_types.retry_policy
|
266
|
+
options.apply_defaults metadata: @config.metadata,
|
267
|
+
retry_policy: @config.retry_policy
|
268
|
+
|
269
|
+
@entity_types_stub.call_rpc :list_entity_types, request, options: options do |response, operation|
|
270
|
+
response = Gapic::PagedEnumerable.new @entity_types_stub, :list_entity_types, request, response, operation, options
|
271
|
+
yield response, operation if block_given?
|
272
|
+
return response
|
273
|
+
end
|
274
|
+
rescue GRPC::BadStatus => e
|
275
|
+
raise Google::Cloud::Error.from_error(e)
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# Retrieves the specified entity type.
|
280
|
+
#
|
281
|
+
# @overload get_entity_type(request, options = nil)
|
282
|
+
# @param request [Google::Cloud::Dialogflow::V2::GetEntityTypeRequest | Hash]
|
283
|
+
# Retrieves the specified entity type.
|
284
|
+
# @param options [Gapic::CallOptions, Hash]
|
285
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
286
|
+
#
|
287
|
+
# @overload get_entity_type(name: nil, language_code: nil)
|
288
|
+
# @param name [String]
|
289
|
+
# Required. The name of the entity type.
|
290
|
+
# Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
|
291
|
+
# @param language_code [String]
|
292
|
+
# Optional. The language to retrieve entity synonyms for. If not specified,
|
293
|
+
# the agent's default language is used.
|
294
|
+
# [Many
|
295
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
296
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
297
|
+
# be used.
|
298
|
+
#
|
299
|
+
#
|
300
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
301
|
+
# @yieldparam response [Google::Cloud::Dialogflow::V2::EntityType]
|
302
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
303
|
+
#
|
304
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
305
|
+
#
|
306
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
307
|
+
#
|
308
|
+
def get_entity_type request, options = nil
|
309
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
310
|
+
|
311
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::GetEntityTypeRequest
|
312
|
+
|
313
|
+
# Converts hash and nil to an options object
|
314
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
315
|
+
|
316
|
+
# Customize the options with defaults
|
317
|
+
metadata = @config.rpcs.get_entity_type.metadata.to_h
|
318
|
+
|
319
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
320
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
321
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
322
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
323
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
324
|
+
|
325
|
+
header_params = {
|
326
|
+
"name" => request.name
|
327
|
+
}
|
328
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
329
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
330
|
+
|
331
|
+
options.apply_defaults timeout: @config.rpcs.get_entity_type.timeout,
|
332
|
+
metadata: metadata,
|
333
|
+
retry_policy: @config.rpcs.get_entity_type.retry_policy
|
334
|
+
options.apply_defaults metadata: @config.metadata,
|
335
|
+
retry_policy: @config.retry_policy
|
336
|
+
|
337
|
+
@entity_types_stub.call_rpc :get_entity_type, request, options: options do |response, operation|
|
338
|
+
yield response, operation if block_given?
|
339
|
+
return response
|
340
|
+
end
|
341
|
+
rescue GRPC::BadStatus => e
|
342
|
+
raise Google::Cloud::Error.from_error(e)
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Creates an entity type in the specified agent.
|
347
|
+
#
|
348
|
+
# @overload create_entity_type(request, options = nil)
|
349
|
+
# @param request [Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest | Hash]
|
350
|
+
# Creates an entity type in the specified agent.
|
351
|
+
# @param options [Gapic::CallOptions, Hash]
|
352
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
353
|
+
#
|
354
|
+
# @overload create_entity_type(parent: nil, entity_type: nil, language_code: nil)
|
355
|
+
# @param parent [String]
|
356
|
+
# Required. The agent to create a entity type for.
|
357
|
+
# Format: `projects/<Project ID>/agent`.
|
358
|
+
# @param entity_type [Google::Cloud::Dialogflow::V2::EntityType | Hash]
|
359
|
+
# Required. The entity type to create.
|
360
|
+
# @param language_code [String]
|
361
|
+
# Optional. The language of entity synonyms defined in `entity_type`. If not
|
362
|
+
# specified, the agent's default language is used.
|
363
|
+
# [Many
|
364
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
365
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
366
|
+
# be used.
|
367
|
+
#
|
368
|
+
#
|
369
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
370
|
+
# @yieldparam response [Google::Cloud::Dialogflow::V2::EntityType]
|
371
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
372
|
+
#
|
373
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
374
|
+
#
|
375
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
376
|
+
#
|
377
|
+
def create_entity_type request, options = nil
|
378
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
379
|
+
|
380
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest
|
381
|
+
|
382
|
+
# Converts hash and nil to an options object
|
383
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
384
|
+
|
385
|
+
# Customize the options with defaults
|
386
|
+
metadata = @config.rpcs.create_entity_type.metadata.to_h
|
387
|
+
|
388
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
389
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
390
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
391
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
392
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
393
|
+
|
394
|
+
header_params = {
|
395
|
+
"parent" => request.parent
|
396
|
+
}
|
397
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
398
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
399
|
+
|
400
|
+
options.apply_defaults timeout: @config.rpcs.create_entity_type.timeout,
|
401
|
+
metadata: metadata,
|
402
|
+
retry_policy: @config.rpcs.create_entity_type.retry_policy
|
403
|
+
options.apply_defaults metadata: @config.metadata,
|
404
|
+
retry_policy: @config.retry_policy
|
405
|
+
|
406
|
+
@entity_types_stub.call_rpc :create_entity_type, request, options: options do |response, operation|
|
407
|
+
yield response, operation if block_given?
|
408
|
+
return response
|
409
|
+
end
|
410
|
+
rescue GRPC::BadStatus => e
|
411
|
+
raise Google::Cloud::Error.from_error(e)
|
412
|
+
end
|
413
|
+
|
414
|
+
##
|
415
|
+
# Updates the specified entity type.
|
416
|
+
#
|
417
|
+
# @overload update_entity_type(request, options = nil)
|
418
|
+
# @param request [Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest | Hash]
|
419
|
+
# Updates the specified entity type.
|
420
|
+
# @param options [Gapic::CallOptions, Hash]
|
421
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
422
|
+
#
|
423
|
+
# @overload update_entity_type(entity_type: nil, language_code: nil, update_mask: nil)
|
424
|
+
# @param entity_type [Google::Cloud::Dialogflow::V2::EntityType | Hash]
|
425
|
+
# Required. The entity type to update.
|
426
|
+
# @param language_code [String]
|
427
|
+
# Optional. The language of entity synonyms defined in `entity_type`. If not
|
428
|
+
# specified, the agent's default language is used.
|
429
|
+
# [Many
|
430
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
431
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
432
|
+
# be used.
|
433
|
+
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
434
|
+
# Optional. The mask to control which fields get updated.
|
435
|
+
#
|
436
|
+
#
|
437
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
438
|
+
# @yieldparam response [Google::Cloud::Dialogflow::V2::EntityType]
|
439
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
440
|
+
#
|
441
|
+
# @return [Google::Cloud::Dialogflow::V2::EntityType]
|
442
|
+
#
|
443
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
444
|
+
#
|
445
|
+
def update_entity_type request, options = nil
|
446
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
447
|
+
|
448
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest
|
449
|
+
|
450
|
+
# Converts hash and nil to an options object
|
451
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
452
|
+
|
453
|
+
# Customize the options with defaults
|
454
|
+
metadata = @config.rpcs.update_entity_type.metadata.to_h
|
455
|
+
|
456
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
457
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
458
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
459
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
460
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
461
|
+
|
462
|
+
header_params = {
|
463
|
+
"entity_type.name" => request.entity_type.name
|
464
|
+
}
|
465
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
466
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
467
|
+
|
468
|
+
options.apply_defaults timeout: @config.rpcs.update_entity_type.timeout,
|
469
|
+
metadata: metadata,
|
470
|
+
retry_policy: @config.rpcs.update_entity_type.retry_policy
|
471
|
+
options.apply_defaults metadata: @config.metadata,
|
472
|
+
retry_policy: @config.retry_policy
|
473
|
+
|
474
|
+
@entity_types_stub.call_rpc :update_entity_type, request, options: options do |response, operation|
|
475
|
+
yield response, operation if block_given?
|
476
|
+
return response
|
477
|
+
end
|
478
|
+
rescue GRPC::BadStatus => e
|
479
|
+
raise Google::Cloud::Error.from_error(e)
|
480
|
+
end
|
481
|
+
|
482
|
+
##
|
483
|
+
# Deletes the specified entity type.
|
484
|
+
#
|
485
|
+
# @overload delete_entity_type(request, options = nil)
|
486
|
+
# @param request [Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest | Hash]
|
487
|
+
# Deletes the specified entity type.
|
488
|
+
# @param options [Gapic::CallOptions, Hash]
|
489
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
490
|
+
#
|
491
|
+
# @overload delete_entity_type(name: nil)
|
492
|
+
# @param name [String]
|
493
|
+
# Required. The name of the entity type to delete.
|
494
|
+
# Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
|
495
|
+
#
|
496
|
+
#
|
497
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
498
|
+
# @yieldparam response [Google::Protobuf::Empty]
|
499
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
500
|
+
#
|
501
|
+
# @return [Google::Protobuf::Empty]
|
502
|
+
#
|
503
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
504
|
+
#
|
505
|
+
def delete_entity_type request, options = nil
|
506
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
507
|
+
|
508
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest
|
509
|
+
|
510
|
+
# Converts hash and nil to an options object
|
511
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
512
|
+
|
513
|
+
# Customize the options with defaults
|
514
|
+
metadata = @config.rpcs.delete_entity_type.metadata.to_h
|
515
|
+
|
516
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
517
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
518
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
519
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
520
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
521
|
+
|
522
|
+
header_params = {
|
523
|
+
"name" => request.name
|
524
|
+
}
|
525
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
526
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
527
|
+
|
528
|
+
options.apply_defaults timeout: @config.rpcs.delete_entity_type.timeout,
|
529
|
+
metadata: metadata,
|
530
|
+
retry_policy: @config.rpcs.delete_entity_type.retry_policy
|
531
|
+
options.apply_defaults metadata: @config.metadata,
|
532
|
+
retry_policy: @config.retry_policy
|
533
|
+
|
534
|
+
@entity_types_stub.call_rpc :delete_entity_type, request, options: options do |response, operation|
|
535
|
+
yield response, operation if block_given?
|
536
|
+
return response
|
537
|
+
end
|
538
|
+
rescue GRPC::BadStatus => e
|
539
|
+
raise Google::Cloud::Error.from_error(e)
|
540
|
+
end
|
541
|
+
|
542
|
+
##
|
543
|
+
# Updates/Creates multiple entity types in the specified agent.
|
544
|
+
#
|
545
|
+
# Operation <response: {Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse}>
|
546
|
+
#
|
547
|
+
# @overload batch_update_entity_types(request, options = nil)
|
548
|
+
# @param request [Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest | Hash]
|
549
|
+
# Updates/Creates multiple entity types in the specified agent.
|
550
|
+
#
|
551
|
+
# Operation <response: {Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse}>
|
552
|
+
# @param options [Gapic::CallOptions, Hash]
|
553
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
554
|
+
#
|
555
|
+
# @overload batch_update_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil)
|
556
|
+
# @param parent [String]
|
557
|
+
# Required. The name of the agent to update or create entity types in.
|
558
|
+
# Format: `projects/<Project ID>/agent`.
|
559
|
+
# @param entity_type_batch_uri [String]
|
560
|
+
# The URI to a Google Cloud Storage file containing entity types to update
|
561
|
+
# or create. The file format can either be a serialized proto (of
|
562
|
+
# EntityBatch type) or a JSON object. Note: The URI must start with
|
563
|
+
# "gs://".
|
564
|
+
# @param entity_type_batch_inline [Google::Cloud::Dialogflow::V2::EntityTypeBatch | Hash]
|
565
|
+
# The collection of entity types to update or create.
|
566
|
+
# @param language_code [String]
|
567
|
+
# Optional. The language of entity synonyms defined in `entity_types`. If not
|
568
|
+
# specified, the agent's default language is used.
|
569
|
+
# [Many
|
570
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
571
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
572
|
+
# be used.
|
573
|
+
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
574
|
+
# Optional. The mask to control which fields get updated.
|
575
|
+
#
|
576
|
+
#
|
577
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
578
|
+
# @yieldparam response [Gapic::Operation]
|
579
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
580
|
+
#
|
581
|
+
# @return [Gapic::Operation]
|
582
|
+
#
|
583
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
584
|
+
#
|
585
|
+
def batch_update_entity_types request, options = nil
|
586
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
587
|
+
|
588
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest
|
589
|
+
|
590
|
+
# Converts hash and nil to an options object
|
591
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
592
|
+
|
593
|
+
# Customize the options with defaults
|
594
|
+
metadata = @config.rpcs.batch_update_entity_types.metadata.to_h
|
595
|
+
|
596
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
597
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
598
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
599
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
600
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
601
|
+
|
602
|
+
header_params = {
|
603
|
+
"parent" => request.parent
|
604
|
+
}
|
605
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
606
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
607
|
+
|
608
|
+
options.apply_defaults timeout: @config.rpcs.batch_update_entity_types.timeout,
|
609
|
+
metadata: metadata,
|
610
|
+
retry_policy: @config.rpcs.batch_update_entity_types.retry_policy
|
611
|
+
options.apply_defaults metadata: @config.metadata,
|
612
|
+
retry_policy: @config.retry_policy
|
613
|
+
|
614
|
+
@entity_types_stub.call_rpc :batch_update_entity_types, request, options: options do |response, operation|
|
615
|
+
response = Gapic::Operation.new response, @operations_client, options: options
|
616
|
+
yield response, operation if block_given?
|
617
|
+
return response
|
618
|
+
end
|
619
|
+
rescue GRPC::BadStatus => e
|
620
|
+
raise Google::Cloud::Error.from_error(e)
|
621
|
+
end
|
622
|
+
|
623
|
+
##
|
624
|
+
# Deletes entity types in the specified agent.
|
625
|
+
#
|
626
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
627
|
+
#
|
628
|
+
# @overload batch_delete_entity_types(request, options = nil)
|
629
|
+
# @param request [Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest | Hash]
|
630
|
+
# Deletes entity types in the specified agent.
|
631
|
+
#
|
632
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
633
|
+
# @param options [Gapic::CallOptions, Hash]
|
634
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
635
|
+
#
|
636
|
+
# @overload batch_delete_entity_types(parent: nil, entity_type_names: nil)
|
637
|
+
# @param parent [String]
|
638
|
+
# Required. The name of the agent to delete all entities types for. Format:
|
639
|
+
# `projects/<Project ID>/agent`.
|
640
|
+
# @param entity_type_names [Array<String>]
|
641
|
+
# Required. The names entity types to delete. All names must point to the
|
642
|
+
# same agent as `parent`.
|
643
|
+
#
|
644
|
+
#
|
645
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
646
|
+
# @yieldparam response [Gapic::Operation]
|
647
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
648
|
+
#
|
649
|
+
# @return [Gapic::Operation]
|
650
|
+
#
|
651
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
652
|
+
#
|
653
|
+
def batch_delete_entity_types request, options = nil
|
654
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
655
|
+
|
656
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest
|
657
|
+
|
658
|
+
# Converts hash and nil to an options object
|
659
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
660
|
+
|
661
|
+
# Customize the options with defaults
|
662
|
+
metadata = @config.rpcs.batch_delete_entity_types.metadata.to_h
|
663
|
+
|
664
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
665
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
666
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
667
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
668
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
669
|
+
|
670
|
+
header_params = {
|
671
|
+
"parent" => request.parent
|
672
|
+
}
|
673
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
674
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
675
|
+
|
676
|
+
options.apply_defaults timeout: @config.rpcs.batch_delete_entity_types.timeout,
|
677
|
+
metadata: metadata,
|
678
|
+
retry_policy: @config.rpcs.batch_delete_entity_types.retry_policy
|
679
|
+
options.apply_defaults metadata: @config.metadata,
|
680
|
+
retry_policy: @config.retry_policy
|
681
|
+
|
682
|
+
@entity_types_stub.call_rpc :batch_delete_entity_types, request, options: options do |response, operation|
|
683
|
+
response = Gapic::Operation.new response, @operations_client, options: options
|
684
|
+
yield response, operation if block_given?
|
685
|
+
return response
|
686
|
+
end
|
687
|
+
rescue GRPC::BadStatus => e
|
688
|
+
raise Google::Cloud::Error.from_error(e)
|
689
|
+
end
|
690
|
+
|
691
|
+
##
|
692
|
+
# Creates multiple new entities in the specified entity type.
|
693
|
+
#
|
694
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
695
|
+
#
|
696
|
+
# @overload batch_create_entities(request, options = nil)
|
697
|
+
# @param request [Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest | Hash]
|
698
|
+
# Creates multiple new entities in the specified entity type.
|
699
|
+
#
|
700
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
701
|
+
# @param options [Gapic::CallOptions, Hash]
|
702
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
703
|
+
#
|
704
|
+
# @overload batch_create_entities(parent: nil, entities: nil, language_code: nil)
|
705
|
+
# @param parent [String]
|
706
|
+
# Required. The name of the entity type to create entities in. Format:
|
707
|
+
# `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
|
708
|
+
# @param entities [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity | Hash>]
|
709
|
+
# Required. The entities to create.
|
710
|
+
# @param language_code [String]
|
711
|
+
# Optional. The language of entity synonyms defined in `entities`. If not
|
712
|
+
# specified, the agent's default language is used.
|
713
|
+
# [Many
|
714
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
715
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
716
|
+
# be used.
|
717
|
+
#
|
718
|
+
#
|
719
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
720
|
+
# @yieldparam response [Gapic::Operation]
|
721
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
722
|
+
#
|
723
|
+
# @return [Gapic::Operation]
|
724
|
+
#
|
725
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
726
|
+
#
|
727
|
+
def batch_create_entities request, options = nil
|
728
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
729
|
+
|
730
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest
|
731
|
+
|
732
|
+
# Converts hash and nil to an options object
|
733
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
734
|
+
|
735
|
+
# Customize the options with defaults
|
736
|
+
metadata = @config.rpcs.batch_create_entities.metadata.to_h
|
737
|
+
|
738
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
739
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
740
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
741
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
742
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
743
|
+
|
744
|
+
header_params = {
|
745
|
+
"parent" => request.parent
|
746
|
+
}
|
747
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
748
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
749
|
+
|
750
|
+
options.apply_defaults timeout: @config.rpcs.batch_create_entities.timeout,
|
751
|
+
metadata: metadata,
|
752
|
+
retry_policy: @config.rpcs.batch_create_entities.retry_policy
|
753
|
+
options.apply_defaults metadata: @config.metadata,
|
754
|
+
retry_policy: @config.retry_policy
|
755
|
+
|
756
|
+
@entity_types_stub.call_rpc :batch_create_entities, request, options: options do |response, operation|
|
757
|
+
response = Gapic::Operation.new response, @operations_client, options: options
|
758
|
+
yield response, operation if block_given?
|
759
|
+
return response
|
760
|
+
end
|
761
|
+
rescue GRPC::BadStatus => e
|
762
|
+
raise Google::Cloud::Error.from_error(e)
|
763
|
+
end
|
764
|
+
|
765
|
+
##
|
766
|
+
# Updates or creates multiple entities in the specified entity type. This
|
767
|
+
# method does not affect entities in the entity type that aren't explicitly
|
768
|
+
# specified in the request.
|
769
|
+
#
|
770
|
+
#
|
771
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
772
|
+
#
|
773
|
+
# @overload batch_update_entities(request, options = nil)
|
774
|
+
# @param request [Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest | Hash]
|
775
|
+
# Updates or creates multiple entities in the specified entity type. This
|
776
|
+
# method does not affect entities in the entity type that aren't explicitly
|
777
|
+
# specified in the request.
|
778
|
+
#
|
779
|
+
#
|
780
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
781
|
+
# @param options [Gapic::CallOptions, Hash]
|
782
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
783
|
+
#
|
784
|
+
# @overload batch_update_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil)
|
785
|
+
# @param parent [String]
|
786
|
+
# Required. The name of the entity type to update or create entities in.
|
787
|
+
# Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
|
788
|
+
# @param entities [Array<Google::Cloud::Dialogflow::V2::EntityType::Entity | Hash>]
|
789
|
+
# Required. The entities to update or create.
|
790
|
+
# @param language_code [String]
|
791
|
+
# Optional. The language of entity synonyms defined in `entities`. If not
|
792
|
+
# specified, the agent's default language is used.
|
793
|
+
# [Many
|
794
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
795
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
796
|
+
# be used.
|
797
|
+
# @param update_mask [Google::Protobuf::FieldMask | Hash]
|
798
|
+
# Optional. The mask to control which fields get updated.
|
799
|
+
#
|
800
|
+
#
|
801
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
802
|
+
# @yieldparam response [Gapic::Operation]
|
803
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
804
|
+
#
|
805
|
+
# @return [Gapic::Operation]
|
806
|
+
#
|
807
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
808
|
+
#
|
809
|
+
def batch_update_entities request, options = nil
|
810
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
811
|
+
|
812
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest
|
813
|
+
|
814
|
+
# Converts hash and nil to an options object
|
815
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
816
|
+
|
817
|
+
# Customize the options with defaults
|
818
|
+
metadata = @config.rpcs.batch_update_entities.metadata.to_h
|
819
|
+
|
820
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
821
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
822
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
823
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
824
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
825
|
+
|
826
|
+
header_params = {
|
827
|
+
"parent" => request.parent
|
828
|
+
}
|
829
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
830
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
831
|
+
|
832
|
+
options.apply_defaults timeout: @config.rpcs.batch_update_entities.timeout,
|
833
|
+
metadata: metadata,
|
834
|
+
retry_policy: @config.rpcs.batch_update_entities.retry_policy
|
835
|
+
options.apply_defaults metadata: @config.metadata,
|
836
|
+
retry_policy: @config.retry_policy
|
837
|
+
|
838
|
+
@entity_types_stub.call_rpc :batch_update_entities, request, options: options do |response, operation|
|
839
|
+
response = Gapic::Operation.new response, @operations_client, options: options
|
840
|
+
yield response, operation if block_given?
|
841
|
+
return response
|
842
|
+
end
|
843
|
+
rescue GRPC::BadStatus => e
|
844
|
+
raise Google::Cloud::Error.from_error(e)
|
845
|
+
end
|
846
|
+
|
847
|
+
##
|
848
|
+
# Deletes entities in the specified entity type.
|
849
|
+
#
|
850
|
+
#
|
851
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
852
|
+
#
|
853
|
+
# @overload batch_delete_entities(request, options = nil)
|
854
|
+
# @param request [Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest | Hash]
|
855
|
+
# Deletes entities in the specified entity type.
|
856
|
+
#
|
857
|
+
#
|
858
|
+
# Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
|
859
|
+
# @param options [Gapic::CallOptions, Hash]
|
860
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
861
|
+
#
|
862
|
+
# @overload batch_delete_entities(parent: nil, entity_values: nil, language_code: nil)
|
863
|
+
# @param parent [String]
|
864
|
+
# Required. The name of the entity type to delete entries for. Format:
|
865
|
+
# `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
|
866
|
+
# @param entity_values [Array<String>]
|
867
|
+
# Required. The reference `values` of the entities to delete. Note that
|
868
|
+
# these are not fully-qualified names, i.e. they don't start with
|
869
|
+
# `projects/<Project ID>`.
|
870
|
+
# @param language_code [String]
|
871
|
+
# Optional. The language of entity synonyms defined in `entities`. If not
|
872
|
+
# specified, the agent's default language is used.
|
873
|
+
# [Many
|
874
|
+
# languages](https://cloud.google.com/dialogflow/docs/reference/language)
|
875
|
+
# are supported. Note: languages must be enabled in the agent before they can
|
876
|
+
# be used.
|
877
|
+
#
|
878
|
+
#
|
879
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
880
|
+
# @yieldparam response [Gapic::Operation]
|
881
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
882
|
+
#
|
883
|
+
# @return [Gapic::Operation]
|
884
|
+
#
|
885
|
+
# @raise [Google::Cloud::Error] if the RPC is aborted.
|
886
|
+
#
|
887
|
+
def batch_delete_entities request, options = nil
|
888
|
+
raise ArgumentError, "request must be provided" if request.nil?
|
889
|
+
|
890
|
+
request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest
|
891
|
+
|
892
|
+
# Converts hash and nil to an options object
|
893
|
+
options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
894
|
+
|
895
|
+
# Customize the options with defaults
|
896
|
+
metadata = @config.rpcs.batch_delete_entities.metadata.to_h
|
897
|
+
|
898
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
899
|
+
metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
|
900
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
901
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
902
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
903
|
+
|
904
|
+
header_params = {
|
905
|
+
"parent" => request.parent
|
906
|
+
}
|
907
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
908
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
909
|
+
|
910
|
+
options.apply_defaults timeout: @config.rpcs.batch_delete_entities.timeout,
|
911
|
+
metadata: metadata,
|
912
|
+
retry_policy: @config.rpcs.batch_delete_entities.retry_policy
|
913
|
+
options.apply_defaults metadata: @config.metadata,
|
914
|
+
retry_policy: @config.retry_policy
|
915
|
+
|
916
|
+
@entity_types_stub.call_rpc :batch_delete_entities, request, options: options do |response, operation|
|
917
|
+
response = Gapic::Operation.new response, @operations_client, options: options
|
918
|
+
yield response, operation if block_given?
|
919
|
+
return response
|
920
|
+
end
|
921
|
+
rescue GRPC::BadStatus => e
|
922
|
+
raise Google::Cloud::Error.from_error(e)
|
923
|
+
end
|
924
|
+
|
925
|
+
##
|
926
|
+
# Configuration class for the EntityTypes API.
|
927
|
+
#
|
928
|
+
# This class represents the configuration for EntityTypes,
|
929
|
+
# providing control over timeouts, retry behavior, logging, transport
|
930
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
931
|
+
# applied individually to specific RPCs. See
|
932
|
+
# {Google::Cloud::Dialogflow::V2::EntityTypes::Client::Configuration::Rpcs}
|
933
|
+
# for a list of RPCs that can be configured independently.
|
934
|
+
#
|
935
|
+
# Configuration can be applied globally to all clients, or to a single client
|
936
|
+
# on construction.
|
937
|
+
#
|
938
|
+
# # Examples
|
939
|
+
#
|
940
|
+
# To modify the global config, setting the timeout for list_entity_types
|
941
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
942
|
+
#
|
943
|
+
# Google::Cloud::Dialogflow::V2::EntityTypes::Client.configure do |config|
|
944
|
+
# config.timeout = 10_000
|
945
|
+
# config.rpcs.list_entity_types.timeout = 20_000
|
946
|
+
# end
|
947
|
+
#
|
948
|
+
# To apply the above configuration only to a new client:
|
949
|
+
#
|
950
|
+
# client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new do |config|
|
951
|
+
# config.timeout = 10_000
|
952
|
+
# config.rpcs.list_entity_types.timeout = 20_000
|
953
|
+
# end
|
954
|
+
#
|
955
|
+
# @!attribute [rw] endpoint
|
956
|
+
# The hostname or hostname:port of the service endpoint.
|
957
|
+
# Defaults to `"dialogflow.googleapis.com"`.
|
958
|
+
# @return [String]
|
959
|
+
# @!attribute [rw] credentials
|
960
|
+
# Credentials to send with calls. You may provide any of the following types:
|
961
|
+
# * (`String`) The path to a service account key file in JSON format
|
962
|
+
# * (`Hash`) A service account key as a Hash
|
963
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
964
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
965
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
966
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
967
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
968
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
969
|
+
# * (`nil`) indicating no credentials
|
970
|
+
# @return [Object]
|
971
|
+
# @!attribute [rw] scope
|
972
|
+
# The OAuth scopes
|
973
|
+
# @return [Array<String>]
|
974
|
+
# @!attribute [rw] lib_name
|
975
|
+
# The library name as recorded in instrumentation and logging
|
976
|
+
# @return [String]
|
977
|
+
# @!attribute [rw] lib_version
|
978
|
+
# The library version as recorded in instrumentation and logging
|
979
|
+
# @return [String]
|
980
|
+
# @!attribute [rw] channel_args
|
981
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
982
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
983
|
+
# @return [Hash]
|
984
|
+
# @!attribute [rw] interceptors
|
985
|
+
# An array of interceptors that are run before calls are executed.
|
986
|
+
# @return [Array<GRPC::ClientInterceptor>]
|
987
|
+
# @!attribute [rw] timeout
|
988
|
+
# The call timeout in milliseconds.
|
989
|
+
# @return [Numeric]
|
990
|
+
# @!attribute [rw] metadata
|
991
|
+
# Additional gRPC headers to be sent with the call.
|
992
|
+
# @return [Hash{Symbol=>String}]
|
993
|
+
# @!attribute [rw] retry_policy
|
994
|
+
# The retry policy. The value is a hash with the following keys:
|
995
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
996
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
997
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
998
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
999
|
+
# trigger a retry.
|
1000
|
+
# @return [Hash]
|
1001
|
+
#
|
1002
|
+
class Configuration
|
1003
|
+
extend Gapic::Config
|
1004
|
+
|
1005
|
+
config_attr :endpoint, "dialogflow.googleapis.com", String
|
1006
|
+
config_attr :credentials, nil do |value|
|
1007
|
+
allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1008
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
1009
|
+
allowed.any? { |klass| klass === value }
|
1010
|
+
end
|
1011
|
+
config_attr :scope, nil, String, Array, nil
|
1012
|
+
config_attr :lib_name, nil, String, nil
|
1013
|
+
config_attr :lib_version, nil, String, nil
|
1014
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
|
1015
|
+
config_attr :interceptors, nil, Array, nil
|
1016
|
+
config_attr :timeout, nil, Numeric, nil
|
1017
|
+
config_attr :metadata, nil, Hash, nil
|
1018
|
+
config_attr :retry_policy, nil, Hash, Proc, nil
|
1019
|
+
|
1020
|
+
# @private
|
1021
|
+
def initialize parent_config = nil
|
1022
|
+
@parent_config = parent_config unless parent_config.nil?
|
1023
|
+
|
1024
|
+
yield self if block_given?
|
1025
|
+
end
|
1026
|
+
|
1027
|
+
##
|
1028
|
+
# Configurations for individual RPCs
|
1029
|
+
# @return [Rpcs]
|
1030
|
+
#
|
1031
|
+
def rpcs
|
1032
|
+
@rpcs ||= begin
|
1033
|
+
parent_rpcs = nil
|
1034
|
+
parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
|
1035
|
+
Rpcs.new parent_rpcs
|
1036
|
+
end
|
1037
|
+
end
|
1038
|
+
|
1039
|
+
##
|
1040
|
+
# Configuration RPC class for the EntityTypes API.
|
1041
|
+
#
|
1042
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1043
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1044
|
+
# the following configuration fields:
|
1045
|
+
#
|
1046
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
1047
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
1048
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1049
|
+
# include the following keys:
|
1050
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1051
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1052
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1053
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1054
|
+
# trigger a retry.
|
1055
|
+
#
|
1056
|
+
class Rpcs
|
1057
|
+
##
|
1058
|
+
# RPC-specific configuration for `list_entity_types`
|
1059
|
+
# @return [Gapic::Config::Method]
|
1060
|
+
#
|
1061
|
+
attr_reader :list_entity_types
|
1062
|
+
##
|
1063
|
+
# RPC-specific configuration for `get_entity_type`
|
1064
|
+
# @return [Gapic::Config::Method]
|
1065
|
+
#
|
1066
|
+
attr_reader :get_entity_type
|
1067
|
+
##
|
1068
|
+
# RPC-specific configuration for `create_entity_type`
|
1069
|
+
# @return [Gapic::Config::Method]
|
1070
|
+
#
|
1071
|
+
attr_reader :create_entity_type
|
1072
|
+
##
|
1073
|
+
# RPC-specific configuration for `update_entity_type`
|
1074
|
+
# @return [Gapic::Config::Method]
|
1075
|
+
#
|
1076
|
+
attr_reader :update_entity_type
|
1077
|
+
##
|
1078
|
+
# RPC-specific configuration for `delete_entity_type`
|
1079
|
+
# @return [Gapic::Config::Method]
|
1080
|
+
#
|
1081
|
+
attr_reader :delete_entity_type
|
1082
|
+
##
|
1083
|
+
# RPC-specific configuration for `batch_update_entity_types`
|
1084
|
+
# @return [Gapic::Config::Method]
|
1085
|
+
#
|
1086
|
+
attr_reader :batch_update_entity_types
|
1087
|
+
##
|
1088
|
+
# RPC-specific configuration for `batch_delete_entity_types`
|
1089
|
+
# @return [Gapic::Config::Method]
|
1090
|
+
#
|
1091
|
+
attr_reader :batch_delete_entity_types
|
1092
|
+
##
|
1093
|
+
# RPC-specific configuration for `batch_create_entities`
|
1094
|
+
# @return [Gapic::Config::Method]
|
1095
|
+
#
|
1096
|
+
attr_reader :batch_create_entities
|
1097
|
+
##
|
1098
|
+
# RPC-specific configuration for `batch_update_entities`
|
1099
|
+
# @return [Gapic::Config::Method]
|
1100
|
+
#
|
1101
|
+
attr_reader :batch_update_entities
|
1102
|
+
##
|
1103
|
+
# RPC-specific configuration for `batch_delete_entities`
|
1104
|
+
# @return [Gapic::Config::Method]
|
1105
|
+
#
|
1106
|
+
attr_reader :batch_delete_entities
|
1107
|
+
|
1108
|
+
# @private
|
1109
|
+
def initialize parent_rpcs = nil
|
1110
|
+
list_entity_types_config = parent_rpcs&.list_entity_types if parent_rpcs&.respond_to? :list_entity_types
|
1111
|
+
@list_entity_types = Gapic::Config::Method.new list_entity_types_config
|
1112
|
+
get_entity_type_config = parent_rpcs&.get_entity_type if parent_rpcs&.respond_to? :get_entity_type
|
1113
|
+
@get_entity_type = Gapic::Config::Method.new get_entity_type_config
|
1114
|
+
create_entity_type_config = parent_rpcs&.create_entity_type if parent_rpcs&.respond_to? :create_entity_type
|
1115
|
+
@create_entity_type = Gapic::Config::Method.new create_entity_type_config
|
1116
|
+
update_entity_type_config = parent_rpcs&.update_entity_type if parent_rpcs&.respond_to? :update_entity_type
|
1117
|
+
@update_entity_type = Gapic::Config::Method.new update_entity_type_config
|
1118
|
+
delete_entity_type_config = parent_rpcs&.delete_entity_type if parent_rpcs&.respond_to? :delete_entity_type
|
1119
|
+
@delete_entity_type = Gapic::Config::Method.new delete_entity_type_config
|
1120
|
+
batch_update_entity_types_config = parent_rpcs&.batch_update_entity_types if parent_rpcs&.respond_to? :batch_update_entity_types
|
1121
|
+
@batch_update_entity_types = Gapic::Config::Method.new batch_update_entity_types_config
|
1122
|
+
batch_delete_entity_types_config = parent_rpcs&.batch_delete_entity_types if parent_rpcs&.respond_to? :batch_delete_entity_types
|
1123
|
+
@batch_delete_entity_types = Gapic::Config::Method.new batch_delete_entity_types_config
|
1124
|
+
batch_create_entities_config = parent_rpcs&.batch_create_entities if parent_rpcs&.respond_to? :batch_create_entities
|
1125
|
+
@batch_create_entities = Gapic::Config::Method.new batch_create_entities_config
|
1126
|
+
batch_update_entities_config = parent_rpcs&.batch_update_entities if parent_rpcs&.respond_to? :batch_update_entities
|
1127
|
+
@batch_update_entities = Gapic::Config::Method.new batch_update_entities_config
|
1128
|
+
batch_delete_entities_config = parent_rpcs&.batch_delete_entities if parent_rpcs&.respond_to? :batch_delete_entities
|
1129
|
+
@batch_delete_entities = Gapic::Config::Method.new batch_delete_entities_config
|
1130
|
+
|
1131
|
+
yield self if block_given?
|
1132
|
+
end
|
1133
|
+
end
|
1134
|
+
end
|
1135
|
+
end
|
1136
|
+
end
|
1137
|
+
end
|
1138
|
+
end
|
1139
|
+
end
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
# rubocop:disable Lint/HandleExceptions
|
1143
|
+
|
1144
|
+
# Once client is loaded, load helpers.rb if it exists.
|
1145
|
+
begin
|
1146
|
+
require "google/cloud/dialogflow/v2/entity_types/helpers"
|
1147
|
+
rescue LoadError
|
1148
|
+
end
|
1149
|
+
|
1150
|
+
# rubocop:enable Lint/HandleExceptions
|