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
@@ -0,0 +1,52 @@
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
+ require "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Dialogflow
24
+ module V2
25
+ module AnswerRecords
26
+ # Credentials for the AnswerRecords API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/dialogflow"
31
+ ]
32
+ self.env_vars = [
33
+ "DIALOGFLOW_CREDENTIALS",
34
+ "DIALOGFLOW_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "DIALOGFLOW_CREDENTIALS_JSON",
39
+ "DIALOGFLOW_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,105 @@
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 AnswerRecords
25
+ # Path helper methods for the AnswerRecords API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified AnswerRecord resource string.
29
+ #
30
+ # @overload answer_record_path(project:, answer_record:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/answerRecords/{answer_record}`
34
+ #
35
+ # @param project [String]
36
+ # @param answer_record [String]
37
+ #
38
+ # @overload answer_record_path(project:, location:, answer_record:)
39
+ # The resource will be in the following format:
40
+ #
41
+ # `projects/{project}/locations/{location}/answerRecords/{answer_record}`
42
+ #
43
+ # @param project [String]
44
+ # @param location [String]
45
+ # @param answer_record [String]
46
+ #
47
+ # @return [::String]
48
+ def answer_record_path **args
49
+ resources = {
50
+ "answer_record:project" => (proc do |project:, answer_record:|
51
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
52
+
53
+ "projects/#{project}/answerRecords/#{answer_record}"
54
+ end),
55
+ "answer_record:location:project" => (proc do |project:, location:, answer_record:|
56
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
57
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
58
+
59
+ "projects/#{project}/locations/#{location}/answerRecords/#{answer_record}"
60
+ end)
61
+ }
62
+
63
+ resource = resources[args.keys.sort.join(":")]
64
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
65
+ resource.call(**args)
66
+ end
67
+
68
+ ##
69
+ # Create a fully-qualified Location resource string.
70
+ #
71
+ # The resource will be in the following format:
72
+ #
73
+ # `projects/{project}/locations/{location}`
74
+ #
75
+ # @param project [String]
76
+ # @param location [String]
77
+ #
78
+ # @return [::String]
79
+ def location_path project:, location:
80
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
81
+
82
+ "projects/#{project}/locations/#{location}"
83
+ end
84
+
85
+ ##
86
+ # Create a fully-qualified Project resource string.
87
+ #
88
+ # The resource will be in the following format:
89
+ #
90
+ # `projects/{project}`
91
+ #
92
+ # @param project [String]
93
+ #
94
+ # @return [::String]
95
+ def project_path project:
96
+ "projects/#{project}"
97
+ end
98
+
99
+ extend self
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -29,6 +29,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
29
29
  optional :model, :string, 7
30
30
  optional :model_variant, :enum, 10, "google.cloud.dialogflow.v2.SpeechModelVariant"
31
31
  optional :single_utterance, :bool, 8
32
+ optional :disable_no_speech_recognized_event, :bool, 14
32
33
  end
33
34
  add_message "google.cloud.dialogflow.v2.VoiceSelectionParams" do
34
35
  optional :name, :string, 1
@@ -46,6 +47,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
46
47
  optional :sample_rate_hertz, :int32, 2
47
48
  optional :synthesize_speech_config, :message, 3, "google.cloud.dialogflow.v2.SynthesizeSpeechConfig"
48
49
  end
50
+ add_message "google.cloud.dialogflow.v2.SpeechToTextConfig" do
51
+ optional :speech_model_variant, :enum, 1, "google.cloud.dialogflow.v2.SpeechModelVariant"
52
+ end
49
53
  add_enum "google.cloud.dialogflow.v2.AudioEncoding" do
50
54
  value :AUDIO_ENCODING_UNSPECIFIED, 0
51
55
  value :AUDIO_ENCODING_LINEAR_16, 1
@@ -72,7 +76,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
72
76
  value :OUTPUT_AUDIO_ENCODING_UNSPECIFIED, 0
73
77
  value :OUTPUT_AUDIO_ENCODING_LINEAR_16, 1
74
78
  value :OUTPUT_AUDIO_ENCODING_MP3, 2
79
+ value :OUTPUT_AUDIO_ENCODING_MP3_64_KBPS, 4
75
80
  value :OUTPUT_AUDIO_ENCODING_OGG_OPUS, 3
81
+ value :OUTPUT_AUDIO_ENCODING_MULAW, 5
76
82
  end
77
83
  end
78
84
  end
@@ -87,6 +93,7 @@ module Google
87
93
  VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.VoiceSelectionParams").msgclass
88
94
  SynthesizeSpeechConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SynthesizeSpeechConfig").msgclass
89
95
  OutputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioConfig").msgclass
96
+ SpeechToTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechToTextConfig").msgclass
90
97
  AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AudioEncoding").enummodule
91
98
  SpeechModelVariant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechModelVariant").enummodule
92
99
  SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SsmlVoiceGender").enummodule
@@ -24,24 +24,7 @@ module Google
24
24
  module Dialogflow
25
25
  module V2
26
26
  module Contexts
27
- # A context represents additional information included with user input or with
28
- # an intent returned by the Dialogflow API. Contexts are helpful for
29
- # differentiating user input which may be vague or have a different meaning
30
- # depending on additional details from your application such as user setting
31
- # and preferences, previous user input, where the user is in your application,
32
- # geographic location, and so on.
33
- #
34
- # You can include contexts as input parameters of a
35
- # [DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] (or
36
- # [StreamingDetectIntent][google.cloud.dialogflow.v2.Sessions.StreamingDetectIntent]) request,
37
- # or as output contexts included in the returned intent.
38
- # Contexts expire when an intent is matched, after the number of `DetectIntent`
39
- # requests specified by the `lifespan_count` parameter, or after 20 minutes
40
- # if no intents are matched for a `DetectIntent` request.
41
- #
42
- # For more information about contexts, see the
43
- # [Dialogflow
44
- # documentation](https://cloud.google.com/dialogflow/docs/contexts-overview).
27
+ # Service for managing [Contexts][google.cloud.dialogflow.v2.Context].
45
28
  class Service
46
29
 
47
30
  include GRPC::GenericService
@@ -51,19 +34,19 @@ module Google
51
34
  self.service_name = 'google.cloud.dialogflow.v2.Contexts'
52
35
 
53
36
  # Returns the list of all contexts in the specified session.
54
- rpc :ListContexts, ListContextsRequest, ListContextsResponse
37
+ rpc :ListContexts, ::Google::Cloud::Dialogflow::V2::ListContextsRequest, ::Google::Cloud::Dialogflow::V2::ListContextsResponse
55
38
  # Retrieves the specified context.
56
- rpc :GetContext, GetContextRequest, Context
39
+ rpc :GetContext, ::Google::Cloud::Dialogflow::V2::GetContextRequest, ::Google::Cloud::Dialogflow::V2::Context
57
40
  # Creates a context.
58
41
  #
59
42
  # If the specified context already exists, overrides the context.
60
- rpc :CreateContext, CreateContextRequest, Context
43
+ rpc :CreateContext, ::Google::Cloud::Dialogflow::V2::CreateContextRequest, ::Google::Cloud::Dialogflow::V2::Context
61
44
  # Updates the specified context.
62
- rpc :UpdateContext, UpdateContextRequest, Context
45
+ rpc :UpdateContext, ::Google::Cloud::Dialogflow::V2::UpdateContextRequest, ::Google::Cloud::Dialogflow::V2::Context
63
46
  # Deletes the specified context.
64
- rpc :DeleteContext, DeleteContextRequest, Google::Protobuf::Empty
47
+ rpc :DeleteContext, ::Google::Cloud::Dialogflow::V2::DeleteContextRequest, ::Google::Protobuf::Empty
65
48
  # Deletes all active contexts in the specified session.
66
- rpc :DeleteAllContexts, DeleteAllContextsRequest, Google::Protobuf::Empty
49
+ rpc :DeleteAllContexts, ::Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest, ::Google::Protobuf::Empty
67
50
  end
68
51
 
69
52
  Stub = Service.rpc_stub_class
@@ -31,24 +31,7 @@ module Google
31
31
  module Dialogflow
32
32
  module V2
33
33
  ##
34
- # A context represents additional information included with user input or with
35
- # an intent returned by the Dialogflow API. Contexts are helpful for
36
- # differentiating user input which may be vague or have a different meaning
37
- # depending on additional details from your application such as user setting
38
- # and preferences, previous user input, where the user is in your application,
39
- # geographic location, and so on.
40
- #
41
- # You can include contexts as input parameters of a
42
- # {::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent DetectIntent} (or
43
- # {::Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent StreamingDetectIntent}) request,
44
- # or as output contexts included in the returned intent.
45
- # Contexts expire when an intent is matched, after the number of `DetectIntent`
46
- # requests specified by the `lifespan_count` parameter, or after 20 minutes
47
- # if no intents are matched for a `DetectIntent` request.
48
- #
49
- # For more information about contexts, see the
50
- # [Dialogflow
51
- # documentation](https://cloud.google.com/dialogflow/docs/contexts-overview).
34
+ # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}.
52
35
  #
53
36
  # To load this service and instantiate a client:
54
37
  #
@@ -27,24 +27,7 @@ module Google
27
27
  ##
28
28
  # Client for the Contexts service.
29
29
  #
30
- # A context represents additional information included with user input or with
31
- # an intent returned by the Dialogflow API. Contexts are helpful for
32
- # differentiating user input which may be vague or have a different meaning
33
- # depending on additional details from your application such as user setting
34
- # and preferences, previous user input, where the user is in your application,
35
- # geographic location, and so on.
36
- #
37
- # You can include contexts as input parameters of a
38
- # {::Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent DetectIntent} (or
39
- # {::Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent StreamingDetectIntent}) request,
40
- # or as output contexts included in the returned intent.
41
- # Contexts expire when an intent is matched, after the number of `DetectIntent`
42
- # requests specified by the `lifespan_count` parameter, or after 20 minutes
43
- # if no intents are matched for a `DetectIntent` request.
44
- #
45
- # For more information about contexts, see the
46
- # [Dialogflow
47
- # documentation](https://cloud.google.com/dialogflow/docs/contexts-overview).
30
+ # Service for managing {::Google::Cloud::Dialogflow::V2::Context Contexts}.
48
31
  #
49
32
  class Client
50
33
  include Paths
@@ -77,7 +60,7 @@ module Google
77
60
  parent_config = while namespace.any?
78
61
  parent_name = namespace.join "::"
79
62
  parent_const = const_get parent_name
80
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
81
64
  namespace.pop
82
65
  end
83
66
  default_config = Client::Configuration.new parent_config
@@ -85,9 +68,9 @@ module Google
85
68
  default_config.timeout = 60.0
86
69
  default_config.retry_policy = {
87
70
  initial_delay: 0.1,
88
- max_delay: 60.0,
89
- multiplier: 1.3,
90
- retry_codes: ["UNAVAILABLE"]
71
+ max_delay: 60.0,
72
+ multiplier: 1.3,
73
+ retry_codes: [14]
91
74
  }
92
75
 
93
76
  default_config
@@ -151,7 +134,13 @@ module Google
151
134
 
152
135
  # Create credentials
153
136
  credentials = @config.credentials
154
- 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
155
144
  if credentials.is_a?(String) || credentials.is_a?(Hash)
156
145
  credentials = Credentials.new credentials, scope: @config.scope
157
146
  end
@@ -687,14 +676,14 @@ module Google
687
676
 
688
677
  config_attr :endpoint, "dialogflow.googleapis.com", ::String
689
678
  config_attr :credentials, nil do |value|
690
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
679
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
691
680
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
692
681
  allowed.any? { |klass| klass === value }
693
682
  end
694
683
  config_attr :scope, nil, ::String, ::Array, nil
695
684
  config_attr :lib_name, nil, ::String, nil
696
685
  config_attr :lib_version, nil, ::String, nil
697
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
686
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
698
687
  config_attr :interceptors, nil, ::Array, nil
699
688
  config_attr :timeout, nil, ::Numeric, nil
700
689
  config_attr :metadata, nil, ::Hash, nil
@@ -715,7 +704,7 @@ module Google
715
704
  def rpcs
716
705
  @rpcs ||= begin
717
706
  parent_rpcs = nil
718
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
707
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
719
708
  Rpcs.new parent_rpcs
720
709
  end
721
710
  end
@@ -727,7 +716,7 @@ module Google
727
716
  # Each configuration object is of type `Gapic::Config::Method` and includes
728
717
  # the following configuration fields:
729
718
  #
730
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
719
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
731
720
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
732
721
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
733
722
  # include the following keys:
@@ -771,17 +760,17 @@ module Google
771
760
 
772
761
  # @private
773
762
  def initialize parent_rpcs = nil
774
- list_contexts_config = parent_rpcs&.list_contexts if parent_rpcs&.respond_to? :list_contexts
763
+ list_contexts_config = parent_rpcs.list_contexts if parent_rpcs.respond_to? :list_contexts
775
764
  @list_contexts = ::Gapic::Config::Method.new list_contexts_config
776
- get_context_config = parent_rpcs&.get_context if parent_rpcs&.respond_to? :get_context
765
+ get_context_config = parent_rpcs.get_context if parent_rpcs.respond_to? :get_context
777
766
  @get_context = ::Gapic::Config::Method.new get_context_config
778
- create_context_config = parent_rpcs&.create_context if parent_rpcs&.respond_to? :create_context
767
+ create_context_config = parent_rpcs.create_context if parent_rpcs.respond_to? :create_context
779
768
  @create_context = ::Gapic::Config::Method.new create_context_config
780
- update_context_config = parent_rpcs&.update_context if parent_rpcs&.respond_to? :update_context
769
+ update_context_config = parent_rpcs.update_context if parent_rpcs.respond_to? :update_context
781
770
  @update_context = ::Gapic::Config::Method.new update_context_config
782
- delete_context_config = parent_rpcs&.delete_context if parent_rpcs&.respond_to? :delete_context
771
+ delete_context_config = parent_rpcs.delete_context if parent_rpcs.respond_to? :delete_context
783
772
  @delete_context = ::Gapic::Config::Method.new delete_context_config
784
- delete_all_contexts_config = parent_rpcs&.delete_all_contexts if parent_rpcs&.respond_to? :delete_all_contexts
773
+ delete_all_contexts_config = parent_rpcs.delete_all_contexts if parent_rpcs.respond_to? :delete_all_contexts
785
774
  @delete_all_contexts = ::Gapic::Config::Method.new delete_all_contexts_config
786
775
 
787
776
  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}"
@@ -0,0 +1,39 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/dialogflow/v2/conversation_event.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/cloud/dialogflow/v2/participant_pb'
7
+ require 'google/rpc/status_pb'
8
+ require 'google/api/annotations_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_file("google/cloud/dialogflow/v2/conversation_event.proto", :syntax => :proto3) do
11
+ add_message "google.cloud.dialogflow.v2.ConversationEvent" do
12
+ optional :conversation, :string, 1
13
+ optional :type, :enum, 2, "google.cloud.dialogflow.v2.ConversationEvent.Type"
14
+ optional :error_status, :message, 3, "google.rpc.Status"
15
+ oneof :payload do
16
+ optional :new_message_payload, :message, 4, "google.cloud.dialogflow.v2.Message"
17
+ end
18
+ end
19
+ add_enum "google.cloud.dialogflow.v2.ConversationEvent.Type" do
20
+ value :TYPE_UNSPECIFIED, 0
21
+ value :CONVERSATION_STARTED, 1
22
+ value :CONVERSATION_FINISHED, 2
23
+ value :HUMAN_INTERVENTION_NEEDED, 3
24
+ value :NEW_MESSAGE, 5
25
+ value :UNRECOVERABLE_ERROR, 4
26
+ end
27
+ end
28
+ end
29
+
30
+ module Google
31
+ module Cloud
32
+ module Dialogflow
33
+ module V2
34
+ ConversationEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationEvent").msgclass
35
+ ConversationEvent::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ConversationEvent.Type").enummodule
36
+ end
37
+ end
38
+ end
39
+ end