google-cloud-dialogflow-v2 0.6.4 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +188 -190
  3. data/README.md +66 -2
  4. data/lib/google/cloud/dialogflow/v2.rb +13 -2
  5. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +26 -15
  6. data/lib/google/cloud/dialogflow/v2/agents/client.rb +40 -23
  7. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +96 -11
  8. data/lib/google/cloud/dialogflow/v2/agents/paths.rb +42 -3
  9. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +100 -0
  10. data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +48 -0
  11. data/lib/google/cloud/dialogflow/v2/answer_records.rb +49 -0
  12. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +478 -0
  13. data/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb +52 -0
  14. data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +105 -0
  15. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +7 -0
  16. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +8 -25
  17. data/lib/google/cloud/dialogflow/v2/contexts.rb +1 -18
  18. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +22 -33
  19. data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +74 -2
  20. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +39 -0
  21. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +89 -0
  22. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +182 -0
  23. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +61 -0
  24. data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +49 -0
  25. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +699 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb +52 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +246 -0
  28. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +75 -0
  29. data/lib/google/cloud/dialogflow/v2/conversations.rb +49 -0
  30. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +757 -0
  31. data/lib/google/cloud/dialogflow/v2/conversations/credentials.rb +52 -0
  32. data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +146 -0
  33. data/lib/google/cloud/dialogflow/v2/document_pb.rb +99 -0
  34. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +73 -0
  35. data/lib/google/cloud/dialogflow/v2/documents.rb +50 -0
  36. data/lib/google/cloud/dialogflow/v2/documents/client.rb +810 -0
  37. data/lib/google/cloud/dialogflow/v2/documents/credentials.rb +52 -0
  38. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +655 -0
  39. data/lib/google/cloud/dialogflow/v2/documents/paths.rb +119 -0
  40. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +40 -46
  41. data/lib/google/cloud/dialogflow/v2/entity_types.rb +1 -28
  42. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +54 -54
  43. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +96 -11
  44. data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +58 -12
  45. data/lib/google/cloud/dialogflow/v2/environment_pb.rb +50 -1
  46. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +24 -3
  47. data/lib/google/cloud/dialogflow/v2/environments.rb +1 -1
  48. data/lib/google/cloud/dialogflow/v2/environments/client.rb +428 -12
  49. data/lib/google/cloud/dialogflow/v2/environments/paths.rb +145 -5
  50. data/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +59 -0
  51. data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +47 -0
  52. data/lib/google/cloud/dialogflow/v2/fulfillments.rb +49 -0
  53. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +460 -0
  54. data/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb +52 -0
  55. data/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb +69 -0
  56. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +20 -0
  57. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +26 -0
  58. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
  59. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +29 -42
  60. data/lib/google/cloud/dialogflow/v2/intents.rb +1 -32
  61. data/lib/google/cloud/dialogflow/v2/intents/client.rb +52 -51
  62. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +96 -11
  63. data/lib/google/cloud/dialogflow/v2/intents/paths.rb +97 -13
  64. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +60 -0
  65. data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +53 -0
  66. data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +49 -0
  67. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +696 -0
  68. data/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb +52 -0
  69. data/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb +105 -0
  70. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +181 -0
  71. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +64 -0
  72. data/lib/google/cloud/dialogflow/v2/participants.rb +49 -0
  73. data/lib/google/cloud/dialogflow/v2/participants/client.rb +894 -0
  74. data/lib/google/cloud/dialogflow/v2/participants/credentials.rb +52 -0
  75. data/lib/google/cloud/dialogflow/v2/participants/paths.rb +334 -0
  76. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +7 -23
  77. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +1 -17
  78. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +21 -31
  79. data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +74 -2
  80. data/lib/google/cloud/dialogflow/v2/session_pb.rb +2 -0
  81. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +15 -7
  82. data/lib/google/cloud/dialogflow/v2/sessions.rb +4 -4
  83. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +43 -21
  84. data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +113 -3
  85. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  86. data/lib/google/cloud/dialogflow/v2/version_pb.rb +69 -0
  87. data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +59 -0
  88. data/lib/google/cloud/dialogflow/v2/versions.rb +49 -0
  89. data/lib/google/cloud/dialogflow/v2/versions/client.rb +709 -0
  90. data/lib/google/cloud/dialogflow/v2/versions/credentials.rb +52 -0
  91. data/lib/google/cloud/dialogflow/v2/versions/paths.rb +110 -0
  92. data/proto_docs/google/api/field_behavior.rb +6 -0
  93. data/proto_docs/google/api/resource.rb +50 -14
  94. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +1 -2
  95. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +252 -0
  96. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +25 -0
  97. data/proto_docs/google/cloud/dialogflow/v2/context.rb +17 -2
  98. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +253 -0
  99. data/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb +83 -0
  100. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +522 -0
  101. data/proto_docs/google/cloud/dialogflow/v2/document.rb +267 -0
  102. data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +12 -3
  103. data/proto_docs/google/cloud/dialogflow/v2/environment.rb +188 -6
  104. data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +144 -0
  105. data/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb +45 -0
  106. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +29 -4
  107. data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +139 -0
  108. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +525 -0
  109. data/proto_docs/google/cloud/dialogflow/v2/session.rb +56 -7
  110. data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +7 -6
  111. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +1 -1
  112. data/proto_docs/google/cloud/dialogflow/v2/version.rb +176 -0
  113. data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +2 -2
  114. data/proto_docs/google/longrunning/operations.rb +17 -3
  115. data/proto_docs/google/protobuf/any.rb +5 -2
  116. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  117. data/proto_docs/google/type/latlng.rb +2 -2
  118. metadata +81 -11
@@ -0,0 +1,119 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Dialogflow
23
+ module V2
24
+ module Documents
25
+ # Path helper methods for the Documents API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Document resource string.
29
+ #
30
+ # @overload document_path(project:, knowledge_base:, document:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}`
34
+ #
35
+ # @param project [String]
36
+ # @param knowledge_base [String]
37
+ # @param document [String]
38
+ #
39
+ # @overload document_path(project:, location:, knowledge_base:, document:)
40
+ # The resource will be in the following format:
41
+ #
42
+ # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}`
43
+ #
44
+ # @param project [String]
45
+ # @param location [String]
46
+ # @param knowledge_base [String]
47
+ # @param document [String]
48
+ #
49
+ # @return [::String]
50
+ def document_path **args
51
+ resources = {
52
+ "document:knowledge_base:project" => (proc do |project:, knowledge_base:, document:|
53
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
54
+ raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/"
55
+
56
+ "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}"
57
+ end),
58
+ "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:|
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
61
+ raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/"
62
+
63
+ "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/documents/#{document}"
64
+ end)
65
+ }
66
+
67
+ resource = resources[args.keys.sort.join(":")]
68
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
69
+ resource.call(**args)
70
+ end
71
+
72
+ ##
73
+ # Create a fully-qualified KnowledgeBase resource string.
74
+ #
75
+ # @overload knowledge_base_path(project:, knowledge_base:)
76
+ # The resource will be in the following format:
77
+ #
78
+ # `projects/{project}/knowledgeBases/{knowledge_base}`
79
+ #
80
+ # @param project [String]
81
+ # @param knowledge_base [String]
82
+ #
83
+ # @overload knowledge_base_path(project:, location:, knowledge_base:)
84
+ # The resource will be in the following format:
85
+ #
86
+ # `projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}`
87
+ #
88
+ # @param project [String]
89
+ # @param location [String]
90
+ # @param knowledge_base [String]
91
+ #
92
+ # @return [::String]
93
+ def knowledge_base_path **args
94
+ resources = {
95
+ "knowledge_base:project" => (proc do |project:, knowledge_base:|
96
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
97
+
98
+ "projects/#{project}/knowledgeBases/#{knowledge_base}"
99
+ end),
100
+ "knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:|
101
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
102
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
103
+
104
+ "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}"
105
+ end)
106
+ }
107
+
108
+ resource = resources[args.keys.sort.join(":")]
109
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
110
+ resource.call(**args)
111
+ end
112
+
113
+ extend self
114
+ end
115
+ end
116
+ end
117
+ end
118
+ end
119
+ end
@@ -24,76 +24,70 @@ module Google
24
24
  module Dialogflow
25
25
  module V2
26
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).
27
+ # Service for managing [EntityTypes][google.cloud.dialogflow.v2.EntityType].
55
28
  class Service
56
29
 
57
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
58
31
 
59
32
  self.marshal_class_method = :encode
60
33
  self.unmarshal_class_method = :decode
61
34
  self.service_name = 'google.cloud.dialogflow.v2.EntityTypes'
62
35
 
63
36
  # Returns the list of all entity types in the specified agent.
64
- rpc :ListEntityTypes, ListEntityTypesRequest, ListEntityTypesResponse
37
+ rpc :ListEntityTypes, ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Google::Cloud::Dialogflow::V2::ListEntityTypesResponse
65
38
  # Retrieves the specified entity type.
66
- rpc :GetEntityType, GetEntityTypeRequest, EntityType
39
+ rpc :GetEntityType, ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType
67
40
  # Creates an entity type in the specified agent.
68
- rpc :CreateEntityType, CreateEntityTypeRequest, EntityType
41
+ #
42
+ # Note: You should always train an agent prior to sending it queries. See the
43
+ # [training
44
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
45
+ rpc :CreateEntityType, ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType
69
46
  # Updates the specified entity type.
70
- rpc :UpdateEntityType, UpdateEntityTypeRequest, EntityType
47
+ #
48
+ # Note: You should always train an agent prior to sending it queries. See the
49
+ # [training
50
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
51
+ rpc :UpdateEntityType, ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Google::Cloud::Dialogflow::V2::EntityType
71
52
  # Deletes the specified entity type.
72
- rpc :DeleteEntityType, DeleteEntityTypeRequest, Google::Protobuf::Empty
53
+ #
54
+ # Note: You should always train an agent prior to sending it queries. See the
55
+ # [training
56
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
57
+ rpc :DeleteEntityType, ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Google::Protobuf::Empty
73
58
  # Updates/Creates multiple entity types in the specified agent.
74
59
  #
75
- # Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
76
- rpc :BatchUpdateEntityTypes, BatchUpdateEntityTypesRequest, Google::Longrunning::Operation
60
+ #
61
+ # Note: You should always train an agent prior to sending it queries. See the
62
+ # [training
63
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
64
+ rpc :BatchUpdateEntityTypes, ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Google::Longrunning::Operation
77
65
  # Deletes entity types in the specified agent.
78
66
  #
79
- # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
80
- rpc :BatchDeleteEntityTypes, BatchDeleteEntityTypesRequest, Google::Longrunning::Operation
67
+ # Note: You should always train an agent prior to sending it queries. See the
68
+ # [training
69
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
70
+ rpc :BatchDeleteEntityTypes, ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Google::Longrunning::Operation
81
71
  # Creates multiple new entities in the specified entity type.
82
72
  #
83
- # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
84
- rpc :BatchCreateEntities, BatchCreateEntitiesRequest, Google::Longrunning::Operation
73
+ # Note: You should always train an agent prior to sending it queries. See the
74
+ # [training
75
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
76
+ rpc :BatchCreateEntities, ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Google::Longrunning::Operation
85
77
  # Updates or creates multiple entities in the specified entity type. This
86
78
  # method does not affect entities in the entity type that aren't explicitly
87
79
  # specified in the request.
88
80
  #
89
- #
90
- # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
91
- rpc :BatchUpdateEntities, BatchUpdateEntitiesRequest, Google::Longrunning::Operation
81
+ # Note: You should always train an agent prior to sending it queries. See the
82
+ # [training
83
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
84
+ rpc :BatchUpdateEntities, ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Google::Longrunning::Operation
92
85
  # Deletes entities in the specified entity type.
93
86
  #
94
- #
95
- # Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
96
- rpc :BatchDeleteEntities, BatchDeleteEntitiesRequest, Google::Longrunning::Operation
87
+ # Note: You should always train an agent prior to sending it queries. See the
88
+ # [training
89
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
90
+ rpc :BatchDeleteEntities, ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Google::Longrunning::Operation
97
91
  end
98
92
 
99
93
  Stub = Service.rpc_stub_class
@@ -32,34 +32,7 @@ module Google
32
32
  module Dialogflow
33
33
  module V2
34
34
  ##
35
- # Entities are extracted from user input and represent parameters that are
36
- # meaningful to your application. For example, a date range, a proper name
37
- # such as a geographic location or landmark, and so on. Entities represent
38
- # actionable data for your application.
39
- #
40
- # When you define an entity, you can also include synonyms that all map to
41
- # that entity. For example, "soft drink", "soda", "pop", and so on.
42
- #
43
- # There are three types of entities:
44
- #
45
- # * **System** - entities that are defined by the Dialogflow API for common
46
- # data types such as date, time, currency, and so on. A system entity is
47
- # represented by the `EntityType` type.
48
- #
49
- # * **Custom** - entities that are defined by you that represent
50
- # actionable data that is meaningful to your application. For example,
51
- # you could define a `pizza.sauce` entity for red or white pizza sauce,
52
- # a `pizza.cheese` entity for the different types of cheese on a pizza,
53
- # a `pizza.topping` entity for different toppings, and so on. A custom
54
- # entity is represented by the `EntityType` type.
55
- #
56
- # * **User** - entities that are built for an individual user such as
57
- # favorites, preferences, playlists, and so on. A user entity is
58
- # represented by the {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} type.
59
- #
60
- # For more information about entity types, see the
61
- # [Dialogflow
62
- # documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
35
+ # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}.
63
36
  #
64
37
  # To load this service and instantiate a client:
65
38
  #
@@ -27,34 +27,7 @@ module Google
27
27
  ##
28
28
  # Client for the EntityTypes service.
29
29
  #
30
- # Entities are extracted from user input and represent parameters that are
31
- # meaningful to your application. For example, a date range, a proper name
32
- # such as a geographic location or landmark, and so on. Entities represent
33
- # actionable data for your application.
34
- #
35
- # When you define an entity, you can also include synonyms that all map to
36
- # that entity. For example, "soft drink", "soda", "pop", and so on.
37
- #
38
- # There are three types of entities:
39
- #
40
- # * **System** - entities that are defined by the Dialogflow API for common
41
- # data types such as date, time, currency, and so on. A system entity is
42
- # represented by the `EntityType` type.
43
- #
44
- # * **Custom** - entities that are defined by you that represent
45
- # actionable data that is meaningful to your application. For example,
46
- # you could define a `pizza.sauce` entity for red or white pizza sauce,
47
- # a `pizza.cheese` entity for the different types of cheese on a pizza,
48
- # a `pizza.topping` entity for different toppings, and so on. A custom
49
- # entity is represented by the `EntityType` type.
50
- #
51
- # * **User** - entities that are built for an individual user such as
52
- # favorites, preferences, playlists, and so on. A user entity is
53
- # represented by the {::Google::Cloud::Dialogflow::V2::SessionEntityType SessionEntityType} type.
54
- #
55
- # For more information about entity types, see the
56
- # [Dialogflow
57
- # documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
30
+ # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}.
58
31
  #
59
32
  class Client
60
33
  include Paths
@@ -87,7 +60,7 @@ module Google
87
60
  parent_config = while namespace.any?
88
61
  parent_name = namespace.join "::"
89
62
  parent_const = const_get parent_name
90
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
91
64
  namespace.pop
92
65
  end
93
66
  default_config = Client::Configuration.new parent_config
@@ -95,9 +68,9 @@ module Google
95
68
  default_config.timeout = 60.0
96
69
  default_config.retry_policy = {
97
70
  initial_delay: 0.1,
98
- max_delay: 60.0,
99
- multiplier: 1.3,
100
- retry_codes: ["UNAVAILABLE"]
71
+ max_delay: 60.0,
72
+ multiplier: 1.3,
73
+ retry_codes: [14]
101
74
  }
102
75
 
103
76
  default_config
@@ -161,7 +134,13 @@ module Google
161
134
 
162
135
  # Create credentials
163
136
  credentials = @config.credentials
164
- credentials ||= Credentials.default scope: @config.scope
137
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
+ @config.endpoint == Client.configure.endpoint &&
141
+ !@config.endpoint.split(".").first.include?("-")
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
165
144
  if credentials.is_a?(String) || credentials.is_a?(Hash)
166
145
  credentials = Credentials.new credentials, scope: @config.scope
167
146
  end
@@ -346,6 +325,10 @@ module Google
346
325
  ##
347
326
  # Creates an entity type in the specified agent.
348
327
  #
328
+ # Note: You should always train an agent prior to sending it queries. See the
329
+ # [training
330
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
331
+ #
349
332
  # @overload create_entity_type(request, options = nil)
350
333
  # Pass arguments to `create_entity_type` via a request object, either of type
351
334
  # {::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest} or an equivalent Hash.
@@ -421,6 +404,10 @@ module Google
421
404
  ##
422
405
  # Updates the specified entity type.
423
406
  #
407
+ # Note: You should always train an agent prior to sending it queries. See the
408
+ # [training
409
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
410
+ #
424
411
  # @overload update_entity_type(request, options = nil)
425
412
  # Pass arguments to `update_entity_type` via a request object, either of type
426
413
  # {::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest} or an equivalent Hash.
@@ -495,6 +482,10 @@ module Google
495
482
  ##
496
483
  # Deletes the specified entity type.
497
484
  #
485
+ # Note: You should always train an agent prior to sending it queries. See the
486
+ # [training
487
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
488
+ #
498
489
  # @overload delete_entity_type(request, options = nil)
499
490
  # Pass arguments to `delete_entity_type` via a request object, either of type
500
491
  # {::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest} or an equivalent Hash.
@@ -562,7 +553,10 @@ module Google
562
553
  ##
563
554
  # Updates/Creates multiple entity types in the specified agent.
564
555
  #
565
- # Operation <response: {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse}>
556
+ #
557
+ # Note: You should always train an agent prior to sending it queries. See the
558
+ # [training
559
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
566
560
  #
567
561
  # @overload batch_update_entity_types(request, options = nil)
568
562
  # Pass arguments to `batch_update_entity_types` via a request object, either of type
@@ -647,7 +641,9 @@ module Google
647
641
  ##
648
642
  # Deletes entity types in the specified agent.
649
643
  #
650
- # Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
644
+ # Note: You should always train an agent prior to sending it queries. See the
645
+ # [training
646
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
651
647
  #
652
648
  # @overload batch_delete_entity_types(request, options = nil)
653
649
  # Pass arguments to `batch_delete_entity_types` via a request object, either of type
@@ -720,7 +716,9 @@ module Google
720
716
  ##
721
717
  # Creates multiple new entities in the specified entity type.
722
718
  #
723
- # Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
719
+ # Note: You should always train an agent prior to sending it queries. See the
720
+ # [training
721
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
724
722
  #
725
723
  # @overload batch_create_entities(request, options = nil)
726
724
  # Pass arguments to `batch_create_entities` via a request object, either of type
@@ -800,8 +798,9 @@ module Google
800
798
  # method does not affect entities in the entity type that aren't explicitly
801
799
  # specified in the request.
802
800
  #
803
- #
804
- # Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
801
+ # Note: You should always train an agent prior to sending it queries. See the
802
+ # [training
803
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
805
804
  #
806
805
  # @overload batch_update_entities(request, options = nil)
807
806
  # Pass arguments to `batch_update_entities` via a request object, either of type
@@ -881,8 +880,9 @@ module Google
881
880
  ##
882
881
  # Deletes entities in the specified entity type.
883
882
  #
884
- #
885
- # Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
883
+ # Note: You should always train an agent prior to sending it queries. See the
884
+ # [training
885
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
886
886
  #
887
887
  # @overload batch_delete_entities(request, options = nil)
888
888
  # Pass arguments to `batch_delete_entities` via a request object, either of type
@@ -1044,14 +1044,14 @@ module Google
1044
1044
 
1045
1045
  config_attr :endpoint, "dialogflow.googleapis.com", ::String
1046
1046
  config_attr :credentials, nil do |value|
1047
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1047
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1048
1048
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1049
1049
  allowed.any? { |klass| klass === value }
1050
1050
  end
1051
1051
  config_attr :scope, nil, ::String, ::Array, nil
1052
1052
  config_attr :lib_name, nil, ::String, nil
1053
1053
  config_attr :lib_version, nil, ::String, nil
1054
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1054
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1055
1055
  config_attr :interceptors, nil, ::Array, nil
1056
1056
  config_attr :timeout, nil, ::Numeric, nil
1057
1057
  config_attr :metadata, nil, ::Hash, nil
@@ -1072,7 +1072,7 @@ module Google
1072
1072
  def rpcs
1073
1073
  @rpcs ||= begin
1074
1074
  parent_rpcs = nil
1075
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1075
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1076
1076
  Rpcs.new parent_rpcs
1077
1077
  end
1078
1078
  end
@@ -1084,7 +1084,7 @@ module Google
1084
1084
  # Each configuration object is of type `Gapic::Config::Method` and includes
1085
1085
  # the following configuration fields:
1086
1086
  #
1087
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1087
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1088
1088
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1089
1089
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1090
1090
  # include the following keys:
@@ -1148,25 +1148,25 @@ module Google
1148
1148
 
1149
1149
  # @private
1150
1150
  def initialize parent_rpcs = nil
1151
- list_entity_types_config = parent_rpcs&.list_entity_types if parent_rpcs&.respond_to? :list_entity_types
1151
+ list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types
1152
1152
  @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config
1153
- get_entity_type_config = parent_rpcs&.get_entity_type if parent_rpcs&.respond_to? :get_entity_type
1153
+ get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type
1154
1154
  @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config
1155
- create_entity_type_config = parent_rpcs&.create_entity_type if parent_rpcs&.respond_to? :create_entity_type
1155
+ create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type
1156
1156
  @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config
1157
- update_entity_type_config = parent_rpcs&.update_entity_type if parent_rpcs&.respond_to? :update_entity_type
1157
+ update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type
1158
1158
  @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config
1159
- delete_entity_type_config = parent_rpcs&.delete_entity_type if parent_rpcs&.respond_to? :delete_entity_type
1159
+ delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type
1160
1160
  @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config
1161
- batch_update_entity_types_config = parent_rpcs&.batch_update_entity_types if parent_rpcs&.respond_to? :batch_update_entity_types
1161
+ batch_update_entity_types_config = parent_rpcs.batch_update_entity_types if parent_rpcs.respond_to? :batch_update_entity_types
1162
1162
  @batch_update_entity_types = ::Gapic::Config::Method.new batch_update_entity_types_config
1163
- batch_delete_entity_types_config = parent_rpcs&.batch_delete_entity_types if parent_rpcs&.respond_to? :batch_delete_entity_types
1163
+ batch_delete_entity_types_config = parent_rpcs.batch_delete_entity_types if parent_rpcs.respond_to? :batch_delete_entity_types
1164
1164
  @batch_delete_entity_types = ::Gapic::Config::Method.new batch_delete_entity_types_config
1165
- batch_create_entities_config = parent_rpcs&.batch_create_entities if parent_rpcs&.respond_to? :batch_create_entities
1165
+ batch_create_entities_config = parent_rpcs.batch_create_entities if parent_rpcs.respond_to? :batch_create_entities
1166
1166
  @batch_create_entities = ::Gapic::Config::Method.new batch_create_entities_config
1167
- batch_update_entities_config = parent_rpcs&.batch_update_entities if parent_rpcs&.respond_to? :batch_update_entities
1167
+ batch_update_entities_config = parent_rpcs.batch_update_entities if parent_rpcs.respond_to? :batch_update_entities
1168
1168
  @batch_update_entities = ::Gapic::Config::Method.new batch_update_entities_config
1169
- batch_delete_entities_config = parent_rpcs&.batch_delete_entities if parent_rpcs&.respond_to? :batch_delete_entities
1169
+ batch_delete_entities_config = parent_rpcs.batch_delete_entities if parent_rpcs.respond_to? :batch_delete_entities
1170
1170
  @batch_delete_entities = ::Gapic::Config::Method.new batch_delete_entities_config
1171
1171
 
1172
1172
  yield self if block_given?