google-cloud-dialogflow-v2 0.6.4 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) 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 +11 -2
  5. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +9 -9
  6. data/lib/google/cloud/dialogflow/v2/agents/client.rb +24 -18
  7. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +96 -11
  8. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +100 -0
  9. data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +49 -0
  10. data/lib/google/cloud/dialogflow/v2/answer_records.rb +50 -0
  11. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +479 -0
  12. data/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb +52 -0
  13. data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +105 -0
  14. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +7 -0
  15. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +7 -24
  16. data/lib/google/cloud/dialogflow/v2/contexts.rb +1 -18
  17. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +22 -33
  18. data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +2 -2
  19. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +39 -0
  20. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +89 -0
  21. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +182 -0
  22. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +61 -0
  23. data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +49 -0
  24. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +699 -0
  25. data/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb +52 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +205 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +75 -0
  28. data/lib/google/cloud/dialogflow/v2/conversations.rb +49 -0
  29. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +757 -0
  30. data/lib/google/cloud/dialogflow/v2/conversations/credentials.rb +52 -0
  31. data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +146 -0
  32. data/lib/google/cloud/dialogflow/v2/document_pb.rb +99 -0
  33. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +73 -0
  34. data/lib/google/cloud/dialogflow/v2/documents.rb +50 -0
  35. data/lib/google/cloud/dialogflow/v2/documents/client.rb +810 -0
  36. data/lib/google/cloud/dialogflow/v2/documents/credentials.rb +52 -0
  37. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +655 -0
  38. data/lib/google/cloud/dialogflow/v2/documents/paths.rb +119 -0
  39. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +11 -38
  40. data/lib/google/cloud/dialogflow/v2/entity_types.rb +1 -28
  41. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +26 -47
  42. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +96 -11
  43. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +2 -2
  44. data/lib/google/cloud/dialogflow/v2/environments.rb +1 -1
  45. data/lib/google/cloud/dialogflow/v2/environments/client.rb +17 -11
  46. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +20 -0
  47. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +26 -0
  48. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
  49. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +8 -39
  50. data/lib/google/cloud/dialogflow/v2/intents.rb +1 -32
  51. data/lib/google/cloud/dialogflow/v2/intents/client.rb +23 -48
  52. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +96 -11
  53. data/lib/google/cloud/dialogflow/v2/intents/paths.rb +1 -1
  54. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +60 -0
  55. data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +53 -0
  56. data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +49 -0
  57. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +696 -0
  58. data/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb +52 -0
  59. data/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb +105 -0
  60. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +172 -0
  61. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +64 -0
  62. data/lib/google/cloud/dialogflow/v2/participants.rb +49 -0
  63. data/lib/google/cloud/dialogflow/v2/participants/client.rb +894 -0
  64. data/lib/google/cloud/dialogflow/v2/participants/credentials.rb +52 -0
  65. data/lib/google/cloud/dialogflow/v2/participants/paths.rb +258 -0
  66. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +6 -22
  67. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +1 -17
  68. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +21 -31
  69. data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +2 -2
  70. data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -0
  71. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +14 -6
  72. data/lib/google/cloud/dialogflow/v2/sessions.rb +4 -4
  73. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +43 -21
  74. data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +3 -3
  75. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  76. data/proto_docs/google/api/field_behavior.rb +6 -0
  77. data/proto_docs/google/api/resource.rb +50 -14
  78. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +1 -2
  79. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +259 -0
  80. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +25 -0
  81. data/proto_docs/google/cloud/dialogflow/v2/context.rb +17 -2
  82. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +253 -0
  83. data/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb +83 -0
  84. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +510 -0
  85. data/proto_docs/google/cloud/dialogflow/v2/document.rb +267 -0
  86. data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +12 -3
  87. data/proto_docs/google/cloud/dialogflow/v2/environment.rb +18 -1
  88. data/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb +45 -0
  89. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +20 -3
  90. data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +139 -0
  91. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +503 -0
  92. data/proto_docs/google/cloud/dialogflow/v2/session.rb +52 -7
  93. data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +7 -6
  94. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +1 -1
  95. data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +2 -2
  96. data/proto_docs/google/longrunning/operations.rb +17 -3
  97. data/proto_docs/google/protobuf/any.rb +5 -2
  98. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  99. data/proto_docs/google/type/latlng.rb +2 -2
  100. metadata +59 -9
@@ -48,7 +48,7 @@ module Google
48
48
  # @return [::String]
49
49
  def session_path **args
50
50
  resources = {
51
- "project:session" => (proc do |project:, session:|
51
+ "project:session" => (proc do |project:, session:|
52
52
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
53
53
 
54
54
  "projects/#{project}/agent/sessions/#{session}"
@@ -93,7 +93,7 @@ module Google
93
93
  # @return [::String]
94
94
  def session_entity_type_path **args
95
95
  resources = {
96
- "entity_type:project:session" => (proc do |project:, session:, entity_type:|
96
+ "entity_type:project:session" => (proc do |project:, session:, entity_type:|
97
97
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
98
98
  raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
99
99
 
@@ -41,6 +41,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
41
41
  repeated :session_entity_types, :message, 5, "google.cloud.dialogflow.v2.SessionEntityType"
42
42
  optional :payload, :message, 6, "google.protobuf.Struct"
43
43
  optional :sentiment_analysis_request_config, :message, 10, "google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig"
44
+ map :webhook_headers, :string, :string, 14
44
45
  end
45
46
  add_message "google.cloud.dialogflow.v2.QueryInput" do
46
47
  oneof :input do
@@ -24,10 +24,10 @@ module Google
24
24
  module Dialogflow
25
25
  module V2
26
26
  module Sessions
27
- # A session represents an interaction with a user. You retrieve user input
28
- # and pass it to the [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
29
- # [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) method to determine
30
- # user intent and respond.
27
+ # A service used for session interactions.
28
+ #
29
+ # For more information, see the [API interactions
30
+ # guide](https://cloud.google.com/dialogflow/docs/api-overview).
31
31
  class Service
32
32
 
33
33
  include GRPC::GenericService
@@ -40,11 +40,19 @@ module Google
40
40
  # as a result. This method is not idempotent, because it may cause contexts
41
41
  # and session entity types to be updated, which in turn might affect
42
42
  # results of future queries.
43
- rpc :DetectIntent, DetectIntentRequest, DetectIntentResponse
43
+ #
44
+ # Note: Always use agent versions for production traffic.
45
+ # See [Versions and
46
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
47
+ rpc :DetectIntent, ::Google::Cloud::Dialogflow::V2::DetectIntentRequest, ::Google::Cloud::Dialogflow::V2::DetectIntentResponse
44
48
  # Processes a natural language query in audio format in a streaming fashion
45
49
  # and returns structured, actionable data as a result. This method is only
46
50
  # available via the gRPC API (not REST).
47
- rpc :StreamingDetectIntent, stream(StreamingDetectIntentRequest), stream(StreamingDetectIntentResponse)
51
+ #
52
+ # Note: Always use agent versions for production traffic.
53
+ # See [Versions and
54
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
55
+ rpc :StreamingDetectIntent, stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse)
48
56
  end
49
57
 
50
58
  Stub = Service.rpc_stub_class
@@ -31,10 +31,10 @@ module Google
31
31
  module Dialogflow
32
32
  module V2
33
33
  ##
34
- # A session represents an interaction with a user. You retrieve user input
35
- # and pass it to the {::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent DetectIntent} (or
36
- # {::Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent StreamingDetectIntent}) method to determine
37
- # user intent and respond.
34
+ # A service used for session interactions.
35
+ #
36
+ # For more information, see the [API interactions
37
+ # guide](https://cloud.google.com/dialogflow/docs/api-overview).
38
38
  #
39
39
  # To load this service and instantiate a client:
40
40
  #
@@ -27,10 +27,10 @@ module Google
27
27
  ##
28
28
  # Client for the Sessions service.
29
29
  #
30
- # A session represents an interaction with a user. You retrieve user input
31
- # and pass it to the {::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent DetectIntent} (or
32
- # {::Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent StreamingDetectIntent}) method to determine
33
- # user intent and respond.
30
+ # A service used for session interactions.
31
+ #
32
+ # For more information, see the [API interactions
33
+ # guide](https://cloud.google.com/dialogflow/docs/api-overview).
34
34
  #
35
35
  class Client
36
36
  include Paths
@@ -63,7 +63,7 @@ module Google
63
63
  parent_config = while namespace.any?
64
64
  parent_name = namespace.join "::"
65
65
  parent_const = const_get parent_name
66
- break parent_const.configure if parent_const&.respond_to? :configure
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
67
  namespace.pop
68
68
  end
69
69
  default_config = Client::Configuration.new parent_config
@@ -71,17 +71,17 @@ module Google
71
71
  default_config.timeout = 60.0
72
72
  default_config.retry_policy = {
73
73
  initial_delay: 0.1,
74
- max_delay: 60.0,
75
- multiplier: 1.3,
76
- retry_codes: ["UNAVAILABLE"]
74
+ max_delay: 60.0,
75
+ multiplier: 1.3,
76
+ retry_codes: [14]
77
77
  }
78
78
 
79
79
  default_config.rpcs.detect_intent.timeout = 220.0
80
80
  default_config.rpcs.detect_intent.retry_policy = {
81
81
  initial_delay: 0.1,
82
- max_delay: 60.0,
83
- multiplier: 1.3,
84
- retry_codes: ["UNAVAILABLE"]
82
+ max_delay: 60.0,
83
+ multiplier: 1.3,
84
+ retry_codes: [14]
85
85
  }
86
86
 
87
87
  default_config.rpcs.streaming_detect_intent.timeout = 220.0
@@ -147,7 +147,13 @@ module Google
147
147
 
148
148
  # Create credentials
149
149
  credentials = @config.credentials
150
- credentials ||= Credentials.default scope: @config.scope
150
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
151
+ # but only if the default endpoint does not have a region prefix.
152
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
153
+ @config.endpoint == Client.configure.endpoint &&
154
+ !@config.endpoint.split(".").first.include?("-")
155
+ credentials ||= Credentials.default scope: @config.scope,
156
+ enable_self_signed_jwt: enable_self_signed_jwt
151
157
  if credentials.is_a?(String) || credentials.is_a?(Hash)
152
158
  credentials = Credentials.new credentials, scope: @config.scope
153
159
  end
@@ -171,6 +177,10 @@ module Google
171
177
  # and session entity types to be updated, which in turn might affect
172
178
  # results of future queries.
173
179
  #
180
+ # Note: Always use agent versions for production traffic.
181
+ # See [Versions and
182
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
183
+ #
174
184
  # @overload detect_intent(request, options = nil)
175
185
  # Pass arguments to `detect_intent` via a request object, either of type
176
186
  # {::Google::Cloud::Dialogflow::V2::DetectIntentRequest} or an equivalent Hash.
@@ -191,11 +201,19 @@ module Google
191
201
  # `projects/<Project ID>/agent/sessions/<Session ID>`, or
192
202
  # `projects/<Project ID>/agent/environments/<Environment ID>/users/<User
193
203
  # ID>/sessions/<Session ID>`. If `Environment ID` is not specified, we assume
194
- # default 'draft' environment. If `User ID` is not specified, we are using
195
- # "-". It's up to the API caller to choose an appropriate `Session ID` and
196
- # `User Id`. They can be a random number or some type of user and session
204
+ # default 'draft' environment (`Environment ID` might be referred to as
205
+ # environment name at some places). If `User ID` is not specified, we are
206
+ # using "-". It's up to the API caller to choose an appropriate `Session ID`
207
+ # and `User Id`. They can be a random number or some type of user and session
197
208
  # identifiers (preferably hashed). The length of the `Session ID` and
198
209
  # `User ID` must not exceed 36 characters.
210
+ #
211
+ # For more information, see the [API interactions
212
+ # guide](https://cloud.google.com/dialogflow/docs/api-overview).
213
+ #
214
+ # Note: Always use agent versions for production traffic.
215
+ # See [Versions and
216
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
199
217
  # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash]
200
218
  # The parameters of this query.
201
219
  # @param query_input [::Google::Cloud::Dialogflow::V2::QueryInput, ::Hash]
@@ -273,6 +291,10 @@ module Google
273
291
  # and returns structured, actionable data as a result. This method is only
274
292
  # available via the gRPC API (not REST).
275
293
  #
294
+ # Note: Always use agent versions for production traffic.
295
+ # See [Versions and
296
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
297
+ #
276
298
  # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest, ::Hash>]
277
299
  # An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest} instances.
278
300
  # @param options [::Gapic::CallOptions, ::Hash]
@@ -407,14 +429,14 @@ module Google
407
429
 
408
430
  config_attr :endpoint, "dialogflow.googleapis.com", ::String
409
431
  config_attr :credentials, nil do |value|
410
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
432
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
411
433
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
412
434
  allowed.any? { |klass| klass === value }
413
435
  end
414
436
  config_attr :scope, nil, ::String, ::Array, nil
415
437
  config_attr :lib_name, nil, ::String, nil
416
438
  config_attr :lib_version, nil, ::String, nil
417
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
439
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
418
440
  config_attr :interceptors, nil, ::Array, nil
419
441
  config_attr :timeout, nil, ::Numeric, nil
420
442
  config_attr :metadata, nil, ::Hash, nil
@@ -435,7 +457,7 @@ module Google
435
457
  def rpcs
436
458
  @rpcs ||= begin
437
459
  parent_rpcs = nil
438
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
460
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
439
461
  Rpcs.new parent_rpcs
440
462
  end
441
463
  end
@@ -447,7 +469,7 @@ module Google
447
469
  # Each configuration object is of type `Gapic::Config::Method` and includes
448
470
  # the following configuration fields:
449
471
  #
450
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
472
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
451
473
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
452
474
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
453
475
  # include the following keys:
@@ -471,9 +493,9 @@ module Google
471
493
 
472
494
  # @private
473
495
  def initialize parent_rpcs = nil
474
- detect_intent_config = parent_rpcs&.detect_intent if parent_rpcs&.respond_to? :detect_intent
496
+ detect_intent_config = parent_rpcs.detect_intent if parent_rpcs.respond_to? :detect_intent
475
497
  @detect_intent = ::Gapic::Config::Method.new detect_intent_config
476
- streaming_detect_intent_config = parent_rpcs&.streaming_detect_intent if parent_rpcs&.respond_to? :streaming_detect_intent
498
+ streaming_detect_intent_config = parent_rpcs.streaming_detect_intent if parent_rpcs.respond_to? :streaming_detect_intent
477
499
  @streaming_detect_intent = ::Gapic::Config::Method.new streaming_detect_intent_config
478
500
 
479
501
  yield self if block_given?
@@ -50,7 +50,7 @@ module Google
50
50
  # @return [::String]
51
51
  def context_path **args
52
52
  resources = {
53
- "context:project:session" => (proc do |project:, session:, context:|
53
+ "context:project:session" => (proc do |project:, session:, context:|
54
54
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
55
55
  raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
56
56
 
@@ -95,7 +95,7 @@ module Google
95
95
  # @return [::String]
96
96
  def session_path **args
97
97
  resources = {
98
- "project:session" => (proc do |project:, session:|
98
+ "project:session" => (proc do |project:, session:|
99
99
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
100
100
 
101
101
  "projects/#{project}/agent/sessions/#{session}"
@@ -140,7 +140,7 @@ module Google
140
140
  # @return [::String]
141
141
  def session_entity_type_path **args
142
142
  resources = {
143
- "entity_type:project:session" => (proc do |project:, session:, entity_type:|
143
+ "entity_type:project:session" => (proc do |project:, session:, entity_type:|
144
144
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
145
145
  raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
146
146
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Dialogflow
23
23
  module V2
24
- VERSION = "0.6.4"
24
+ VERSION = "0.7.0"
25
25
  end
26
26
  end
27
27
  end
@@ -54,6 +54,12 @@ module Google
54
54
  # This indicates that the field may be set once in a request to create a
55
55
  # resource, but may not be changed thereafter.
56
56
  IMMUTABLE = 5
57
+
58
+ # Denotes that a (repeated) field is an unordered list.
59
+ # This indicates that the service may provide the elements of the list
60
+ # in any arbitrary order, rather than the order the user originally
61
+ # provided. Additionally, the list's order may or may not be stable.
62
+ UNORDERED_LIST = 6
57
63
  end
58
64
  end
59
65
  end
@@ -43,12 +43,12 @@ module Google
43
43
  #
44
44
  # The ResourceDescriptor Yaml config will look like:
45
45
  #
46
- # resources:
47
- # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/\\{project}/topics/\\{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/\\{project}"
46
+ # resources:
47
+ # - type: "pubsub.googleapis.com/Topic"
48
+ # name_descriptor:
49
+ # - pattern: "projects/{project}/topics/{topic}"
50
+ # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
+ # parent_name_extractor: "projects/{project}"
52
52
  #
53
53
  # Sometimes, resources have multiple patterns, typically because they can
54
54
  # live under multiple parents.
@@ -183,15 +183,24 @@ module Google
183
183
  # }
184
184
  # @!attribute [rw] plural
185
185
  # @return [::String]
186
- # The plural name used in the resource name, such as 'projects' for
187
- # the name of 'projects/\\{project}'. It is the same concept of the `plural`
188
- # field in k8s CRD spec
186
+ # The plural name used in the resource name and permission names, such as
187
+ # 'projects' for the resource name of 'projects/\\{project}' and the permission
188
+ # name of 'cloudresourcemanager.googleapis.com/projects.get'. It is the same
189
+ # concept of the `plural` field in k8s CRD spec
189
190
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
191
+ #
192
+ # Note: The plural form is required even for singleton resources. See
193
+ # https://aip.dev/156
190
194
  # @!attribute [rw] singular
191
195
  # @return [::String]
192
196
  # The same concept of the `singular` field in k8s CRD spec
193
197
  # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/
194
198
  # Such as "project" for the `resourcemanager.googleapis.com/Project` type.
199
+ # @!attribute [rw] style
200
+ # @return [::Array<::Google::Api::ResourceDescriptor::Style>]
201
+ # Style flag(s) for this resource.
202
+ # These indicate that a resource is expected to conform to a given
203
+ # style. See the specific style flags for additional information.
195
204
  class ResourceDescriptor
196
205
  include ::Google::Protobuf::MessageExts
197
206
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -211,6 +220,22 @@ module Google
211
220
  # that from being necessary once there are multiple patterns.)
212
221
  FUTURE_MULTI_PATTERN = 2
213
222
  end
223
+
224
+ # A flag representing a specific style that a resource claims to conform to.
225
+ module Style
226
+ # The unspecified value. Do not use.
227
+ STYLE_UNSPECIFIED = 0
228
+
229
+ # This resource is intended to be "declarative-friendly".
230
+ #
231
+ # Declarative-friendly resources must be more strictly consistent, and
232
+ # setting this to true communicates to tools that this resource should
233
+ # adhere to declarative-friendly expectations.
234
+ #
235
+ # Note: This is used by the API linter (linter.aip.dev) to enable
236
+ # additional checks.
237
+ DECLARATIVE_FRIENDLY = 1
238
+ end
214
239
  end
215
240
 
216
241
  # Defines a proto annotation that describes a string field that refers to
@@ -226,6 +251,17 @@ module Google
226
251
  # type: "pubsub.googleapis.com/Topic"
227
252
  # }];
228
253
  # }
254
+ #
255
+ # Occasionally, a field may reference an arbitrary resource. In this case,
256
+ # APIs use the special value * in their resource reference.
257
+ #
258
+ # Example:
259
+ #
260
+ # message GetIamPolicyRequest {
261
+ # string resource = 2 [(google.api.resource_reference) = {
262
+ # type: "*"
263
+ # }];
264
+ # }
229
265
  # @!attribute [rw] child_type
230
266
  # @return [::String]
231
267
  # The resource type of a child collection that the annotated field
@@ -234,11 +270,11 @@ module Google
234
270
  #
235
271
  # Example:
236
272
  #
237
- # message ListLogEntriesRequest {
238
- # string parent = 1 [(google.api.resource_reference) = {
239
- # child_type: "logging.googleapis.com/LogEntry"
240
- # };
241
- # }
273
+ # message ListLogEntriesRequest {
274
+ # string parent = 1 [(google.api.resource_reference) = {
275
+ # child_type: "logging.googleapis.com/LogEntry"
276
+ # };
277
+ # }
242
278
  class ResourceReference
243
279
  include ::Google::Protobuf::MessageExts
244
280
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -29,8 +29,7 @@ module Google
29
29
  # conversations required for your system.
30
30
  #
31
31
  # For more information about agents, see the
32
- # [Agents
33
- # documentation](https://cloud.google.com/dialogflow/docs/agents-overview).
32
+ # [Agent guide](https://cloud.google.com/dialogflow/docs/agents-overview).
34
33
  # @!attribute [rw] parent
35
34
  # @return [::String]
36
35
  # Required. The project of this agent.
@@ -0,0 +1,259 @@
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
+ # Answer records are records to manage answer history and feedbacks for
25
+ # Dialogflow.
26
+ #
27
+ # Currently, answer record includes:
28
+ #
29
+ # - human agent assistant article suggestion
30
+ # - human agent assistant faq article
31
+ #
32
+ # It doesn't include:
33
+ #
34
+ # - `DetectIntent` intent matching
35
+ # - `DetectIntent` knowledge
36
+ #
37
+ # Answer records are not related to the conversation history in the
38
+ # Dialogflow Console. A Record is generated even when the end-user disables
39
+ # conversation history in the console. Records are created when there's a human
40
+ # agent assistant suggestion generated.
41
+ #
42
+ # A typical workflow for customers provide feedback to an answer is:
43
+ #
44
+ # 1. For human agent assistant, customers get suggestion via ListSuggestions
45
+ # API. Together with the answers,
46
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecord#name AnswerRecord.name} are
47
+ # returned to the customers.
48
+ # 2. The customer uses the
49
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecord#name AnswerRecord.name} to call the
50
+ # [UpdateAnswerRecord][] method to send feedback about a specific answer
51
+ # that they believe is wrong.
52
+ # @!attribute [rw] name
53
+ # @return [::String]
54
+ # The unique identifier of this answer record.
55
+ # Format: `projects/<Project ID>/locations/<Location
56
+ # ID>/answerRecords/<Answer Record ID>`.
57
+ # @!attribute [rw] answer_feedback
58
+ # @return [::Google::Cloud::Dialogflow::V2::AnswerFeedback]
59
+ # Required. The AnswerFeedback for this record. You can set this with
60
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord}
61
+ # in order to give us feedback about this answer.
62
+ # @!attribute [r] agent_assistant_record
63
+ # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantRecord]
64
+ # Output only. The record for human agent assistant.
65
+ class AnswerRecord
66
+ include ::Google::Protobuf::MessageExts
67
+ extend ::Google::Protobuf::MessageExts::ClassMethods
68
+ end
69
+
70
+ # Request message for
71
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records AnswerRecords.ListAnswerRecords}.
72
+ # @!attribute [rw] parent
73
+ # @return [::String]
74
+ # Required. The project to list all answer records for in reverse
75
+ # chronological order. Format: `projects/<Project ID>/locations/<Location
76
+ # ID>`.
77
+ # @!attribute [rw] filter
78
+ # @return [::String]
79
+ # Required. Filters to restrict results to specific answer records.
80
+ # Filter on answer record type. Currently predicates on `type` is supported,
81
+ # valid values are `ARTICLE_ANSWER`, `FAQ_ANSWER`.
82
+ #
83
+ # For more information about filtering, see
84
+ # [API Filtering](https://aip.dev/160).
85
+ # @!attribute [rw] page_size
86
+ # @return [::Integer]
87
+ # Optional. The maximum number of records to return in a single page.
88
+ # The server may return fewer records than this. If unspecified, we use 10.
89
+ # The maximum is 100.
90
+ # @!attribute [rw] page_token
91
+ # @return [::String]
92
+ # Optional. The
93
+ # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token}
94
+ # value returned from a previous list request used to continue listing on
95
+ # the next page.
96
+ class ListAnswerRecordsRequest
97
+ include ::Google::Protobuf::MessageExts
98
+ extend ::Google::Protobuf::MessageExts::ClassMethods
99
+ end
100
+
101
+ # Response message for
102
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records AnswerRecords.ListAnswerRecords}.
103
+ # @!attribute [rw] answer_records
104
+ # @return [::Array<::Google::Cloud::Dialogflow::V2::AnswerRecord>]
105
+ # The list of answer records.
106
+ # @!attribute [rw] next_page_token
107
+ # @return [::String]
108
+ # A token to retrieve next page of results. Or empty if there are no more
109
+ # results.
110
+ # Pass this value in the
111
+ # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest#page_token ListAnswerRecordsRequest.page_token}
112
+ # field in the subsequent call to `ListAnswerRecords` method to retrieve the
113
+ # next page of results.
114
+ class ListAnswerRecordsResponse
115
+ include ::Google::Protobuf::MessageExts
116
+ extend ::Google::Protobuf::MessageExts::ClassMethods
117
+ end
118
+
119
+ # Request message for
120
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record AnswerRecords.UpdateAnswerRecord}.
121
+ # @!attribute [rw] answer_record
122
+ # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord]
123
+ # Required. Answer record to update.
124
+ # @!attribute [rw] update_mask
125
+ # @return [::Google::Protobuf::FieldMask]
126
+ # Required. The mask to control which fields get updated.
127
+ class UpdateAnswerRecordRequest
128
+ include ::Google::Protobuf::MessageExts
129
+ extend ::Google::Protobuf::MessageExts::ClassMethods
130
+ end
131
+
132
+ # Represents feedback the customer has about the quality & correctness of a
133
+ # certain answer in a conversation.
134
+ # @!attribute [rw] correctness_level
135
+ # @return [::Google::Cloud::Dialogflow::V2::AnswerFeedback::CorrectnessLevel]
136
+ # The correctness level of the specific answer.
137
+ # @!attribute [rw] agent_assistant_detail_feedback
138
+ # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback]
139
+ # Detail feedback of agent assist suggestions.
140
+ # @!attribute [rw] clicked
141
+ # @return [::Boolean]
142
+ # Indicates whether the answer/item was clicked by the human agent
143
+ # or not. Default to false.
144
+ # @!attribute [rw] click_time
145
+ # @return [::Google::Protobuf::Timestamp]
146
+ # Time when the answer/item was clicked.
147
+ # @!attribute [rw] displayed
148
+ # @return [::Boolean]
149
+ # Indicates whether the answer/item was displayed to the human
150
+ # agent in the agent desktop UI. Default to false.
151
+ # @!attribute [rw] display_time
152
+ # @return [::Google::Protobuf::Timestamp]
153
+ # Time when the answer/item was displayed.
154
+ class AnswerFeedback
155
+ include ::Google::Protobuf::MessageExts
156
+ extend ::Google::Protobuf::MessageExts::ClassMethods
157
+
158
+ # The correctness level of an answer.
159
+ module CorrectnessLevel
160
+ # Correctness level unspecified.
161
+ CORRECTNESS_LEVEL_UNSPECIFIED = 0
162
+
163
+ # Answer is totally wrong.
164
+ NOT_CORRECT = 1
165
+
166
+ # Answer is partially correct.
167
+ PARTIALLY_CORRECT = 2
168
+
169
+ # Answer is fully correct.
170
+ FULLY_CORRECT = 3
171
+ end
172
+ end
173
+
174
+ # Detail feedback of Agent Assist result.
175
+ # @!attribute [rw] answer_relevance
176
+ # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::AnswerRelevance]
177
+ # Optional. Whether or not the suggested answer is relevant.
178
+ #
179
+ # For example:
180
+ #
181
+ # * Query: "Can I change my mailing address?"
182
+ # * Suggested document says: "Items must be returned/exchanged within 60
183
+ # days of the purchase date."
184
+ # * {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#answer_relevance answer_relevance}: {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::AnswerRelevance::IRRELEVANT AnswerRelevance.IRRELEVANT}
185
+ # @!attribute [rw] document_correctness
186
+ # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentCorrectness]
187
+ # Optional. Whether or not the information in the document is correct.
188
+ #
189
+ # For example:
190
+ #
191
+ # * Query: "Can I return the package in 2 days once received?"
192
+ # * Suggested document says: "Items must be returned/exchanged within 60
193
+ # days of the purchase date."
194
+ # * Ground truth: "No return or exchange is allowed."
195
+ # * [document_correctness]: INCORRECT
196
+ # @!attribute [rw] document_efficiency
197
+ # @return [::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentEfficiency]
198
+ # Optional. Whether or not the suggested document is efficient. For example,
199
+ # if the document is poorly written, hard to understand, hard to use or
200
+ # too long to find useful information,
201
+ # {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback#document_efficiency document_efficiency}
202
+ # is
203
+ # {::Google::Cloud::Dialogflow::V2::AgentAssistantFeedback::DocumentEfficiency::INEFFICIENT DocumentEfficiency.INEFFICIENT}.
204
+ class AgentAssistantFeedback
205
+ include ::Google::Protobuf::MessageExts
206
+ extend ::Google::Protobuf::MessageExts::ClassMethods
207
+
208
+ # Relevance of an answer.
209
+ module AnswerRelevance
210
+ # Answer relevance unspecified.
211
+ ANSWER_RELEVANCE_UNSPECIFIED = 0
212
+
213
+ # Answer is irrelevant to query.
214
+ IRRELEVANT = 1
215
+
216
+ # Answer is relevant to query.
217
+ RELEVANT = 2
218
+ end
219
+
220
+ # Correctness of document.
221
+ module DocumentCorrectness
222
+ # Document correctness unspecified.
223
+ DOCUMENT_CORRECTNESS_UNSPECIFIED = 0
224
+
225
+ # Information in document is incorrect.
226
+ INCORRECT = 1
227
+
228
+ # Information in document is correct.
229
+ CORRECT = 2
230
+ end
231
+
232
+ # Efficiency of document.
233
+ module DocumentEfficiency
234
+ # Document efficiency unspecified.
235
+ DOCUMENT_EFFICIENCY_UNSPECIFIED = 0
236
+
237
+ # Document is inefficient.
238
+ INEFFICIENT = 1
239
+
240
+ # Document is efficient.
241
+ EFFICIENT = 2
242
+ end
243
+ end
244
+
245
+ # Represents a record of a human agent assist answer.
246
+ # @!attribute [r] article_suggestion_answer
247
+ # @return [::Google::Cloud::Dialogflow::V2::ArticleAnswer]
248
+ # Output only. The article suggestion answer.
249
+ # @!attribute [r] faq_answer
250
+ # @return [::Google::Cloud::Dialogflow::V2::FaqAnswer]
251
+ # Output only. The FAQ answer.
252
+ class AgentAssistantRecord
253
+ include ::Google::Protobuf::MessageExts
254
+ extend ::Google::Protobuf::MessageExts::ClassMethods
255
+ end
256
+ end
257
+ end
258
+ end
259
+ end