google-cloud-dialogflow-cx-v3 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +201 -0
  5. data/README.md +139 -0
  6. data/lib/google/cloud/dialogflow/cx/v3/advanced_settings_pb.rb +32 -0
  7. data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +122 -0
  8. data/lib/google/cloud/dialogflow/cx/v3/agent_services_pb.rb +82 -0
  9. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +1051 -0
  10. data/lib/google/cloud/dialogflow/cx/v3/agents/credentials.rb +54 -0
  11. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +666 -0
  12. data/lib/google/cloud/dialogflow/cx/v3/agents/paths.rb +151 -0
  13. data/lib/google/cloud/dialogflow/cx/v3/agents.rb +52 -0
  14. data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +94 -0
  15. data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +92 -0
  16. data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +67 -0
  17. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +766 -0
  18. data/lib/google/cloud/dialogflow/cx/v3/entity_types/credentials.rb +54 -0
  19. data/lib/google/cloud/dialogflow/cx/v3/entity_types/paths.rb +75 -0
  20. data/lib/google/cloud/dialogflow/cx/v3/entity_types.rb +51 -0
  21. data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +117 -0
  22. data/lib/google/cloud/dialogflow/cx/v3/environment_services_pb.rb +61 -0
  23. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +950 -0
  24. data/lib/google/cloud/dialogflow/cx/v3/environments/credentials.rb +54 -0
  25. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +666 -0
  26. data/lib/google/cloud/dialogflow/cx/v3/environments/paths.rb +98 -0
  27. data/lib/google/cloud/dialogflow/cx/v3/environments.rb +52 -0
  28. data/lib/google/cloud/dialogflow/cx/v3/experiment_pb.rb +177 -0
  29. data/lib/google/cloud/dialogflow/cx/v3/experiment_services_pb.rb +61 -0
  30. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +851 -0
  31. data/lib/google/cloud/dialogflow/cx/v3/experiments/credentials.rb +54 -0
  32. data/lib/google/cloud/dialogflow/cx/v3/experiments/paths.rb +102 -0
  33. data/lib/google/cloud/dialogflow/cx/v3/experiments.rb +51 -0
  34. data/lib/google/cloud/dialogflow/cx/v3/flow_pb.rb +145 -0
  35. data/lib/google/cloud/dialogflow/cx/v3/flow_services_pb.rb +88 -0
  36. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +1200 -0
  37. data/lib/google/cloud/dialogflow/cx/v3/flows/credentials.rb +54 -0
  38. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +666 -0
  39. data/lib/google/cloud/dialogflow/cx/v3/flows/paths.rb +184 -0
  40. data/lib/google/cloud/dialogflow/cx/v3/flows.rb +52 -0
  41. data/lib/google/cloud/dialogflow/cx/v3/fulfillment_pb.rb +55 -0
  42. data/lib/google/cloud/dialogflow/cx/v3/intent_pb.rb +97 -0
  43. data/lib/google/cloud/dialogflow/cx/v3/intent_services_pb.rb +67 -0
  44. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +750 -0
  45. data/lib/google/cloud/dialogflow/cx/v3/intents/credentials.rb +54 -0
  46. data/lib/google/cloud/dialogflow/cx/v3/intents/paths.rb +96 -0
  47. data/lib/google/cloud/dialogflow/cx/v3/intents.rb +51 -0
  48. data/lib/google/cloud/dialogflow/cx/v3/page_pb.rb +113 -0
  49. data/lib/google/cloud/dialogflow/cx/v3/page_services_pb.rb +67 -0
  50. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +805 -0
  51. data/lib/google/cloud/dialogflow/cx/v3/pages/credentials.rb +54 -0
  52. data/lib/google/cloud/dialogflow/cx/v3/pages/paths.rb +165 -0
  53. data/lib/google/cloud/dialogflow/cx/v3/pages.rb +51 -0
  54. data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +77 -0
  55. data/lib/google/cloud/dialogflow/cx/v3/security_settings_pb.rb +89 -0
  56. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +696 -0
  57. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/credentials.rb +54 -0
  58. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/paths.rb +157 -0
  59. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb +51 -0
  60. data/lib/google/cloud/dialogflow/cx/v3/security_settings_services_pb.rb +56 -0
  61. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_pb.rb +68 -0
  62. data/lib/google/cloud/dialogflow/cx/v3/session_entity_type_services_pb.rb +55 -0
  63. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +715 -0
  64. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/credentials.rb +54 -0
  65. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/paths.rb +137 -0
  66. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb +51 -0
  67. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +209 -0
  68. data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +71 -0
  69. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +654 -0
  70. data/lib/google/cloud/dialogflow/cx/v3/sessions/credentials.rb +54 -0
  71. data/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb +225 -0
  72. data/lib/google/cloud/dialogflow/cx/v3/sessions.rb +53 -0
  73. data/lib/google/cloud/dialogflow/cx/v3/test_case_pb.rb +302 -0
  74. data/lib/google/cloud/dialogflow/cx/v3/test_case_services_pb.rb +73 -0
  75. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +1324 -0
  76. data/lib/google/cloud/dialogflow/cx/v3/test_cases/credentials.rb +54 -0
  77. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +666 -0
  78. data/lib/google/cloud/dialogflow/cx/v3/test_cases/paths.rb +249 -0
  79. data/lib/google/cloud/dialogflow/cx/v3/test_cases.rb +53 -0
  80. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_pb.rb +67 -0
  81. data/lib/google/cloud/dialogflow/cx/v3/transition_route_group_services_pb.rb +67 -0
  82. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +766 -0
  83. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/credentials.rb +54 -0
  84. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/paths.rb +144 -0
  85. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb +51 -0
  86. data/lib/google/cloud/dialogflow/cx/v3/validation_message_pb.rb +59 -0
  87. data/lib/google/cloud/dialogflow/cx/v3/version.rb +30 -0
  88. data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +88 -0
  89. data/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb +57 -0
  90. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +792 -0
  91. data/lib/google/cloud/dialogflow/cx/v3/versions/credentials.rb +54 -0
  92. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +666 -0
  93. data/lib/google/cloud/dialogflow/cx/v3/versions/paths.rb +79 -0
  94. data/lib/google/cloud/dialogflow/cx/v3/versions.rb +52 -0
  95. data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +172 -0
  96. data/lib/google/cloud/dialogflow/cx/v3/webhook_services_pb.rb +55 -0
  97. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +704 -0
  98. data/lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb +54 -0
  99. data/lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb +96 -0
  100. data/lib/google/cloud/dialogflow/cx/v3/webhooks.rb +51 -0
  101. data/lib/google/cloud/dialogflow/cx/v3.rb +53 -0
  102. data/lib/google-cloud-dialogflow-cx-v3.rb +21 -0
  103. data/proto_docs/README.md +4 -0
  104. data/proto_docs/google/api/field_behavior.rb +71 -0
  105. data/proto_docs/google/api/resource.rb +283 -0
  106. data/proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb +57 -0
  107. data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +301 -0
  108. data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +322 -0
  109. data/proto_docs/google/cloud/dialogflow/cx/v3/entity_type.rb +306 -0
  110. data/proto_docs/google/cloud/dialogflow/cx/v3/environment.rb +279 -0
  111. data/proto_docs/google/cloud/dialogflow/cx/v3/experiment.rb +438 -0
  112. data/proto_docs/google/cloud/dialogflow/cx/v3/flow.rb +438 -0
  113. data/proto_docs/google/cloud/dialogflow/cx/v3/fulfillment.rb +126 -0
  114. data/proto_docs/google/cloud/dialogflow/cx/v3/intent.rb +318 -0
  115. data/proto_docs/google/cloud/dialogflow/cx/v3/page.rb +478 -0
  116. data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +220 -0
  117. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +222 -0
  118. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +798 -0
  119. data/proto_docs/google/cloud/dialogflow/cx/v3/session_entity_type.rb +184 -0
  120. data/proto_docs/google/cloud/dialogflow/cx/v3/test_case.rb +757 -0
  121. data/proto_docs/google/cloud/dialogflow/cx/v3/transition_route_group.rb +195 -0
  122. data/proto_docs/google/cloud/dialogflow/cx/v3/validation_message.rb +121 -0
  123. data/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +182 -0
  124. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +496 -0
  125. data/proto_docs/google/longrunning/operations.rb +164 -0
  126. data/proto_docs/google/protobuf/any.rb +141 -0
  127. data/proto_docs/google/protobuf/duration.rb +98 -0
  128. data/proto_docs/google/protobuf/empty.rb +36 -0
  129. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  130. data/proto_docs/google/protobuf/struct.rb +96 -0
  131. data/proto_docs/google/protobuf/timestamp.rb +129 -0
  132. data/proto_docs/google/rpc/status.rb +46 -0
  133. data/proto_docs/google/type/latlng.rb +38 -0
  134. metadata +326 -0
@@ -0,0 +1,79 @@
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 CX
24
+ module V3
25
+ module Versions
26
+ # Path helper methods for the Versions API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified Flow resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param agent [String]
38
+ # @param flow [String]
39
+ #
40
+ # @return [::String]
41
+ def flow_path project:, location:, agent:, flow:
42
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
43
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
44
+ raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
45
+
46
+ "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}"
47
+ end
48
+
49
+ ##
50
+ # Create a fully-qualified Version resource string.
51
+ #
52
+ # The resource will be in the following format:
53
+ #
54
+ # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}`
55
+ #
56
+ # @param project [String]
57
+ # @param location [String]
58
+ # @param agent [String]
59
+ # @param flow [String]
60
+ # @param version [String]
61
+ #
62
+ # @return [::String]
63
+ def version_path project:, location:, agent:, flow:, version:
64
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
65
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
66
+ raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
67
+ raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/"
68
+
69
+ "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}"
70
+ end
71
+
72
+ extend self
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/dialogflow/cx/v3/version"
24
+
25
+ require "google/cloud/dialogflow/cx/v3/versions/credentials"
26
+ require "google/cloud/dialogflow/cx/v3/versions/paths"
27
+ require "google/cloud/dialogflow/cx/v3/versions/operations"
28
+ require "google/cloud/dialogflow/cx/v3/versions/client"
29
+
30
+ module Google
31
+ module Cloud
32
+ module Dialogflow
33
+ module CX
34
+ module V3
35
+ ##
36
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Version Versions}.
37
+ #
38
+ # To load this service and instantiate a client:
39
+ #
40
+ # require "google/cloud/dialogflow/cx/v3/versions"
41
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
42
+ #
43
+ module Versions
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+
51
+ helper_path = ::File.join __dir__, "versions", "helpers.rb"
52
+ require "google/cloud/dialogflow/cx/v3/versions/helpers" if ::File.file? helper_path
@@ -0,0 +1,172 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/dialogflow/cx/v3/webhook.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ require 'google/cloud/dialogflow/cx/v3/response_message_pb'
11
+ require 'google/protobuf/duration_pb'
12
+ require 'google/protobuf/empty_pb'
13
+ require 'google/protobuf/field_mask_pb'
14
+ require 'google/protobuf/struct_pb'
15
+ Google::Protobuf::DescriptorPool.generated_pool.build do
16
+ add_file("google/cloud/dialogflow/cx/v3/webhook.proto", :syntax => :proto3) do
17
+ add_message "google.cloud.dialogflow.cx.v3.Webhook" do
18
+ optional :name, :string, 1
19
+ optional :display_name, :string, 2
20
+ optional :timeout, :message, 6, "google.protobuf.Duration"
21
+ optional :disabled, :bool, 5
22
+ oneof :webhook do
23
+ optional :generic_web_service, :message, 4, "google.cloud.dialogflow.cx.v3.Webhook.GenericWebService"
24
+ optional :service_directory, :message, 7, "google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig"
25
+ end
26
+ end
27
+ add_message "google.cloud.dialogflow.cx.v3.Webhook.GenericWebService" do
28
+ optional :uri, :string, 1
29
+ optional :username, :string, 2
30
+ optional :password, :string, 3
31
+ map :request_headers, :string, :string, 4
32
+ end
33
+ add_message "google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig" do
34
+ optional :service, :string, 1
35
+ optional :generic_web_service, :message, 2, "google.cloud.dialogflow.cx.v3.Webhook.GenericWebService"
36
+ end
37
+ add_message "google.cloud.dialogflow.cx.v3.ListWebhooksRequest" do
38
+ optional :parent, :string, 1
39
+ optional :page_size, :int32, 2
40
+ optional :page_token, :string, 3
41
+ end
42
+ add_message "google.cloud.dialogflow.cx.v3.ListWebhooksResponse" do
43
+ repeated :webhooks, :message, 1, "google.cloud.dialogflow.cx.v3.Webhook"
44
+ optional :next_page_token, :string, 2
45
+ end
46
+ add_message "google.cloud.dialogflow.cx.v3.GetWebhookRequest" do
47
+ optional :name, :string, 1
48
+ end
49
+ add_message "google.cloud.dialogflow.cx.v3.CreateWebhookRequest" do
50
+ optional :parent, :string, 1
51
+ optional :webhook, :message, 2, "google.cloud.dialogflow.cx.v3.Webhook"
52
+ end
53
+ add_message "google.cloud.dialogflow.cx.v3.UpdateWebhookRequest" do
54
+ optional :webhook, :message, 1, "google.cloud.dialogflow.cx.v3.Webhook"
55
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
56
+ end
57
+ add_message "google.cloud.dialogflow.cx.v3.DeleteWebhookRequest" do
58
+ optional :name, :string, 1
59
+ optional :force, :bool, 2
60
+ end
61
+ add_message "google.cloud.dialogflow.cx.v3.WebhookRequest" do
62
+ optional :detect_intent_response_id, :string, 1
63
+ optional :language_code, :string, 15
64
+ optional :fulfillment_info, :message, 6, "google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo"
65
+ optional :intent_info, :message, 3, "google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo"
66
+ optional :page_info, :message, 4, "google.cloud.dialogflow.cx.v3.PageInfo"
67
+ optional :session_info, :message, 5, "google.cloud.dialogflow.cx.v3.SessionInfo"
68
+ repeated :messages, :message, 7, "google.cloud.dialogflow.cx.v3.ResponseMessage"
69
+ optional :payload, :message, 8, "google.protobuf.Struct"
70
+ optional :sentiment_analysis_result, :message, 9, "google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult"
71
+ oneof :query do
72
+ optional :text, :string, 10
73
+ optional :trigger_intent, :string, 11
74
+ optional :transcript, :string, 12
75
+ optional :trigger_event, :string, 14
76
+ end
77
+ end
78
+ add_message "google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo" do
79
+ optional :tag, :string, 1
80
+ end
81
+ add_message "google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo" do
82
+ optional :last_matched_intent, :string, 1
83
+ optional :display_name, :string, 3
84
+ map :parameters, :string, :message, 2, "google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue"
85
+ optional :confidence, :float, 4
86
+ end
87
+ add_message "google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue" do
88
+ optional :original_value, :string, 1
89
+ optional :resolved_value, :message, 2, "google.protobuf.Value"
90
+ end
91
+ add_message "google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult" do
92
+ optional :score, :float, 1
93
+ optional :magnitude, :float, 2
94
+ end
95
+ add_message "google.cloud.dialogflow.cx.v3.WebhookResponse" do
96
+ optional :fulfillment_response, :message, 1, "google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse"
97
+ optional :page_info, :message, 2, "google.cloud.dialogflow.cx.v3.PageInfo"
98
+ optional :session_info, :message, 3, "google.cloud.dialogflow.cx.v3.SessionInfo"
99
+ optional :payload, :message, 4, "google.protobuf.Struct"
100
+ oneof :transition do
101
+ optional :target_page, :string, 5
102
+ optional :target_flow, :string, 6
103
+ end
104
+ end
105
+ add_message "google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse" do
106
+ repeated :messages, :message, 1, "google.cloud.dialogflow.cx.v3.ResponseMessage"
107
+ optional :merge_behavior, :enum, 2, "google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior"
108
+ end
109
+ add_enum "google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior" do
110
+ value :MERGE_BEHAVIOR_UNSPECIFIED, 0
111
+ value :APPEND, 1
112
+ value :REPLACE, 2
113
+ end
114
+ add_message "google.cloud.dialogflow.cx.v3.PageInfo" do
115
+ optional :current_page, :string, 1
116
+ optional :form_info, :message, 3, "google.cloud.dialogflow.cx.v3.PageInfo.FormInfo"
117
+ end
118
+ add_message "google.cloud.dialogflow.cx.v3.PageInfo.FormInfo" do
119
+ repeated :parameter_info, :message, 2, "google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo"
120
+ end
121
+ add_message "google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo" do
122
+ optional :display_name, :string, 1
123
+ optional :required, :bool, 2
124
+ optional :state, :enum, 3, "google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState"
125
+ optional :value, :message, 4, "google.protobuf.Value"
126
+ optional :just_collected, :bool, 5
127
+ end
128
+ add_enum "google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState" do
129
+ value :PARAMETER_STATE_UNSPECIFIED, 0
130
+ value :EMPTY, 1
131
+ value :INVALID, 2
132
+ value :FILLED, 3
133
+ end
134
+ add_message "google.cloud.dialogflow.cx.v3.SessionInfo" do
135
+ optional :session, :string, 1
136
+ map :parameters, :string, :message, 2, "google.protobuf.Value"
137
+ end
138
+ end
139
+ end
140
+
141
+ module Google
142
+ module Cloud
143
+ module Dialogflow
144
+ module CX
145
+ module V3
146
+ Webhook = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook").msgclass
147
+ Webhook::GenericWebService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.GenericWebService").msgclass
148
+ Webhook::ServiceDirectoryConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Webhook.ServiceDirectoryConfig").msgclass
149
+ ListWebhooksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListWebhooksRequest").msgclass
150
+ ListWebhooksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListWebhooksResponse").msgclass
151
+ GetWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetWebhookRequest").msgclass
152
+ CreateWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateWebhookRequest").msgclass
153
+ UpdateWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateWebhookRequest").msgclass
154
+ DeleteWebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteWebhookRequest").msgclass
155
+ WebhookRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest").msgclass
156
+ WebhookRequest::FulfillmentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.FulfillmentInfo").msgclass
157
+ WebhookRequest::IntentInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo").msgclass
158
+ WebhookRequest::IntentInfo::IntentParameterValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.IntentInfo.IntentParameterValue").msgclass
159
+ WebhookRequest::SentimentAnalysisResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookRequest.SentimentAnalysisResult").msgclass
160
+ WebhookResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse").msgclass
161
+ WebhookResponse::FulfillmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse").msgclass
162
+ WebhookResponse::FulfillmentResponse::MergeBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.WebhookResponse.FulfillmentResponse.MergeBehavior").enummodule
163
+ PageInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo").msgclass
164
+ PageInfo::FormInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo").msgclass
165
+ PageInfo::FormInfo::ParameterInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo").msgclass
166
+ PageInfo::FormInfo::ParameterInfo::ParameterState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.PageInfo.FormInfo.ParameterInfo.ParameterState").enummodule
167
+ SessionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.SessionInfo").msgclass
168
+ end
169
+ end
170
+ end
171
+ end
172
+ end
@@ -0,0 +1,55 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/dialogflow/cx/v3/webhook.proto for package 'Google.Cloud.Dialogflow.CX.V3'
3
+ # Original file comments:
4
+ # Copyright 2021 Google LLC
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+
19
+ require 'grpc'
20
+ require 'google/cloud/dialogflow/cx/v3/webhook_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module Webhooks
28
+ # Service for managing [Webhooks][google.cloud.dialogflow.cx.v3.Webhook].
29
+ class Service
30
+
31
+ include GRPC::GenericService
32
+
33
+ self.marshal_class_method = :encode
34
+ self.unmarshal_class_method = :decode
35
+ self.service_name = 'google.cloud.dialogflow.cx.v3.Webhooks'
36
+
37
+ # Returns the list of all webhooks in the specified agent.
38
+ rpc :ListWebhooks, ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksResponse
39
+ # Retrieves the specified webhook.
40
+ rpc :GetWebhook, ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook
41
+ # Creates a webhook in the specified agent.
42
+ rpc :CreateWebhook, ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook
43
+ # Updates the specified webhook.
44
+ rpc :UpdateWebhook, ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Google::Cloud::Dialogflow::CX::V3::Webhook
45
+ # Deletes the specified webhook.
46
+ rpc :DeleteWebhook, ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Google::Protobuf::Empty
47
+ end
48
+
49
+ Stub = Service.rpc_stub_class
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,704 @@
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 "google/cloud/errors"
20
+ require "google/cloud/dialogflow/cx/v3/webhook_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module Webhooks
28
+ ##
29
+ # Client for the Webhooks service.
30
+ #
31
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Webhook Webhooks}.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :webhooks_stub
38
+
39
+ ##
40
+ # Configure the Webhooks Client class.
41
+ #
42
+ # See {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all Webhooks clients
48
+ # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Dialogflow", "CX", "V3"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.timeout = 60.0
69
+ default_config.retry_policy = {
70
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
71
+ }
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the Webhooks Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # Create a new Webhooks client object.
101
+ #
102
+ # @example
103
+ #
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new
106
+ #
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the Webhooks client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ def initialize
116
+ # These require statements are intentionally placed here to initialize
117
+ # the gRPC module only when it's required.
118
+ # See https://github.com/googleapis/toolkit/issues/446
119
+ require "gapic/grpc"
120
+ require "google/cloud/dialogflow/cx/v3/webhook_services_pb"
121
+
122
+ # Create the configuration object
123
+ @config = Configuration.new Client.configure
124
+
125
+ # Yield the configuration if needed
126
+ yield @config if block_given?
127
+
128
+ # Create credentials
129
+ credentials = @config.credentials
130
+ # Use self-signed JWT if the endpoint is unchanged from default,
131
+ # but only if the default endpoint does not have a region prefix.
132
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
133
+ !@config.endpoint.split(".").first.include?("-")
134
+ credentials ||= Credentials.default scope: @config.scope,
135
+ enable_self_signed_jwt: enable_self_signed_jwt
136
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
137
+ credentials = Credentials.new credentials, scope: @config.scope
138
+ end
139
+ @quota_project_id = @config.quota_project
140
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
141
+
142
+ @webhooks_stub = ::Gapic::ServiceStub.new(
143
+ ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Stub,
144
+ credentials: credentials,
145
+ endpoint: @config.endpoint,
146
+ channel_args: @config.channel_args,
147
+ interceptors: @config.interceptors
148
+ )
149
+ end
150
+
151
+ # Service calls
152
+
153
+ ##
154
+ # Returns the list of all webhooks in the specified agent.
155
+ #
156
+ # @overload list_webhooks(request, options = nil)
157
+ # Pass arguments to `list_webhooks` via a request object, either of type
158
+ # {::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest} or an equivalent Hash.
159
+ #
160
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest, ::Hash]
161
+ # A request object representing the call parameters. Required. To specify no
162
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
163
+ # @param options [::Gapic::CallOptions, ::Hash]
164
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
165
+ #
166
+ # @overload list_webhooks(parent: nil, page_size: nil, page_token: nil)
167
+ # Pass arguments to `list_webhooks` via keyword arguments. Note that at
168
+ # least one keyword argument is required. To specify no parameters, or to keep all
169
+ # the default parameter values, pass an empty Hash as a request object (see above).
170
+ #
171
+ # @param parent [::String]
172
+ # Required. The agent to list all webhooks for.
173
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
174
+ # @param page_size [::Integer]
175
+ # The maximum number of items to return in a single page. By default 100 and
176
+ # at most 1000.
177
+ # @param page_token [::String]
178
+ # The next_page_token value returned from a previous list request.
179
+ #
180
+ # @yield [response, operation] Access the result along with the RPC operation
181
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>]
182
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
183
+ #
184
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Webhook>]
185
+ #
186
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
187
+ #
188
+ def list_webhooks request, options = nil
189
+ raise ::ArgumentError, "request must be provided" if request.nil?
190
+
191
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest
192
+
193
+ # Converts hash and nil to an options object
194
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
195
+
196
+ # Customize the options with defaults
197
+ metadata = @config.rpcs.list_webhooks.metadata.to_h
198
+
199
+ # Set x-goog-api-client and x-goog-user-project headers
200
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
201
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
202
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
203
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
204
+
205
+ header_params = {
206
+ "parent" => request.parent
207
+ }
208
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
209
+ metadata[:"x-goog-request-params"] ||= request_params_header
210
+
211
+ options.apply_defaults timeout: @config.rpcs.list_webhooks.timeout,
212
+ metadata: metadata,
213
+ retry_policy: @config.rpcs.list_webhooks.retry_policy
214
+
215
+ options.apply_defaults timeout: @config.timeout,
216
+ metadata: @config.metadata,
217
+ retry_policy: @config.retry_policy
218
+
219
+ @webhooks_stub.call_rpc :list_webhooks, request, options: options do |response, operation|
220
+ response = ::Gapic::PagedEnumerable.new @webhooks_stub, :list_webhooks, request, response, operation, options
221
+ yield response, operation if block_given?
222
+ return response
223
+ end
224
+ rescue ::GRPC::BadStatus => e
225
+ raise ::Google::Cloud::Error.from_error(e)
226
+ end
227
+
228
+ ##
229
+ # Retrieves the specified webhook.
230
+ #
231
+ # @overload get_webhook(request, options = nil)
232
+ # Pass arguments to `get_webhook` via a request object, either of type
233
+ # {::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest} or an equivalent Hash.
234
+ #
235
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest, ::Hash]
236
+ # A request object representing the call parameters. Required. To specify no
237
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
238
+ # @param options [::Gapic::CallOptions, ::Hash]
239
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
240
+ #
241
+ # @overload get_webhook(name: nil)
242
+ # Pass arguments to `get_webhook` via keyword arguments. Note that at
243
+ # least one keyword argument is required. To specify no parameters, or to keep all
244
+ # the default parameter values, pass an empty Hash as a request object (see above).
245
+ #
246
+ # @param name [::String]
247
+ # Required. The name of the webhook.
248
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
249
+ # ID>/webhooks/<Webhook ID>`.
250
+ #
251
+ # @yield [response, operation] Access the result along with the RPC operation
252
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Webhook]
253
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
254
+ #
255
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook]
256
+ #
257
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
258
+ #
259
+ def get_webhook request, options = nil
260
+ raise ::ArgumentError, "request must be provided" if request.nil?
261
+
262
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest
263
+
264
+ # Converts hash and nil to an options object
265
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
266
+
267
+ # Customize the options with defaults
268
+ metadata = @config.rpcs.get_webhook.metadata.to_h
269
+
270
+ # Set x-goog-api-client and x-goog-user-project headers
271
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
272
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
273
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
274
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
275
+
276
+ header_params = {
277
+ "name" => request.name
278
+ }
279
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
280
+ metadata[:"x-goog-request-params"] ||= request_params_header
281
+
282
+ options.apply_defaults timeout: @config.rpcs.get_webhook.timeout,
283
+ metadata: metadata,
284
+ retry_policy: @config.rpcs.get_webhook.retry_policy
285
+
286
+ options.apply_defaults timeout: @config.timeout,
287
+ metadata: @config.metadata,
288
+ retry_policy: @config.retry_policy
289
+
290
+ @webhooks_stub.call_rpc :get_webhook, request, options: options do |response, operation|
291
+ yield response, operation if block_given?
292
+ return response
293
+ end
294
+ rescue ::GRPC::BadStatus => e
295
+ raise ::Google::Cloud::Error.from_error(e)
296
+ end
297
+
298
+ ##
299
+ # Creates a webhook in the specified agent.
300
+ #
301
+ # @overload create_webhook(request, options = nil)
302
+ # Pass arguments to `create_webhook` via a request object, either of type
303
+ # {::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest} or an equivalent Hash.
304
+ #
305
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest, ::Hash]
306
+ # A request object representing the call parameters. Required. To specify no
307
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
308
+ # @param options [::Gapic::CallOptions, ::Hash]
309
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
310
+ #
311
+ # @overload create_webhook(parent: nil, webhook: nil)
312
+ # Pass arguments to `create_webhook` via keyword arguments. Note that at
313
+ # least one keyword argument is required. To specify no parameters, or to keep all
314
+ # the default parameter values, pass an empty Hash as a request object (see above).
315
+ #
316
+ # @param parent [::String]
317
+ # Required. The agent to create a webhook for.
318
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
319
+ # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash]
320
+ # Required. The webhook to create.
321
+ #
322
+ # @yield [response, operation] Access the result along with the RPC operation
323
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Webhook]
324
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
325
+ #
326
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook]
327
+ #
328
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
329
+ #
330
+ def create_webhook request, options = nil
331
+ raise ::ArgumentError, "request must be provided" if request.nil?
332
+
333
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest
334
+
335
+ # Converts hash and nil to an options object
336
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
337
+
338
+ # Customize the options with defaults
339
+ metadata = @config.rpcs.create_webhook.metadata.to_h
340
+
341
+ # Set x-goog-api-client and x-goog-user-project headers
342
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
343
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
344
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
345
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
346
+
347
+ header_params = {
348
+ "parent" => request.parent
349
+ }
350
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
351
+ metadata[:"x-goog-request-params"] ||= request_params_header
352
+
353
+ options.apply_defaults timeout: @config.rpcs.create_webhook.timeout,
354
+ metadata: metadata,
355
+ retry_policy: @config.rpcs.create_webhook.retry_policy
356
+
357
+ options.apply_defaults timeout: @config.timeout,
358
+ metadata: @config.metadata,
359
+ retry_policy: @config.retry_policy
360
+
361
+ @webhooks_stub.call_rpc :create_webhook, request, options: options do |response, operation|
362
+ yield response, operation if block_given?
363
+ return response
364
+ end
365
+ rescue ::GRPC::BadStatus => e
366
+ raise ::Google::Cloud::Error.from_error(e)
367
+ end
368
+
369
+ ##
370
+ # Updates the specified webhook.
371
+ #
372
+ # @overload update_webhook(request, options = nil)
373
+ # Pass arguments to `update_webhook` via a request object, either of type
374
+ # {::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest, ::Hash]
377
+ # A request object representing the call parameters. Required. To specify no
378
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
379
+ # @param options [::Gapic::CallOptions, ::Hash]
380
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
381
+ #
382
+ # @overload update_webhook(webhook: nil, update_mask: nil)
383
+ # Pass arguments to `update_webhook` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param webhook [::Google::Cloud::Dialogflow::CX::V3::Webhook, ::Hash]
388
+ # Required. The webhook to update.
389
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
390
+ # The mask to control which fields get updated. If the mask is not present,
391
+ # all fields will be updated.
392
+ #
393
+ # @yield [response, operation] Access the result along with the RPC operation
394
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Webhook]
395
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
396
+ #
397
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Webhook]
398
+ #
399
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
400
+ #
401
+ def update_webhook request, options = nil
402
+ raise ::ArgumentError, "request must be provided" if request.nil?
403
+
404
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest
405
+
406
+ # Converts hash and nil to an options object
407
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
408
+
409
+ # Customize the options with defaults
410
+ metadata = @config.rpcs.update_webhook.metadata.to_h
411
+
412
+ # Set x-goog-api-client and x-goog-user-project headers
413
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
414
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
415
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
416
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
417
+
418
+ header_params = {
419
+ "webhook.name" => request.webhook.name
420
+ }
421
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
422
+ metadata[:"x-goog-request-params"] ||= request_params_header
423
+
424
+ options.apply_defaults timeout: @config.rpcs.update_webhook.timeout,
425
+ metadata: metadata,
426
+ retry_policy: @config.rpcs.update_webhook.retry_policy
427
+
428
+ options.apply_defaults timeout: @config.timeout,
429
+ metadata: @config.metadata,
430
+ retry_policy: @config.retry_policy
431
+
432
+ @webhooks_stub.call_rpc :update_webhook, request, options: options do |response, operation|
433
+ yield response, operation if block_given?
434
+ return response
435
+ end
436
+ rescue ::GRPC::BadStatus => e
437
+ raise ::Google::Cloud::Error.from_error(e)
438
+ end
439
+
440
+ ##
441
+ # Deletes the specified webhook.
442
+ #
443
+ # @overload delete_webhook(request, options = nil)
444
+ # Pass arguments to `delete_webhook` via a request object, either of type
445
+ # {::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest} or an equivalent Hash.
446
+ #
447
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest, ::Hash]
448
+ # A request object representing the call parameters. Required. To specify no
449
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
450
+ # @param options [::Gapic::CallOptions, ::Hash]
451
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
452
+ #
453
+ # @overload delete_webhook(name: nil, force: nil)
454
+ # Pass arguments to `delete_webhook` via keyword arguments. Note that at
455
+ # least one keyword argument is required. To specify no parameters, or to keep all
456
+ # the default parameter values, pass an empty Hash as a request object (see above).
457
+ #
458
+ # @param name [::String]
459
+ # Required. The name of the webhook to delete.
460
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
461
+ # ID>/webhooks/<Webhook ID>`.
462
+ # @param force [::Boolean]
463
+ # This field has no effect for webhook not being used.
464
+ # For webhooks that are used by pages/flows/transition route groups:
465
+ #
466
+ # * If `force` is set to false, an error will be returned with message
467
+ # indicating the referenced resources.
468
+ # * If `force` is set to true, Dialogflow will remove the webhook, as well
469
+ # as any references to the webhook (i.e. {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#webhook Webhook}
470
+ # and {::Google::Cloud::Dialogflow::CX::V3::Fulfillment#tag tag}in fulfillments that point to this webhook
471
+ # will be removed).
472
+ #
473
+ # @yield [response, operation] Access the result along with the RPC operation
474
+ # @yieldparam response [::Google::Protobuf::Empty]
475
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
476
+ #
477
+ # @return [::Google::Protobuf::Empty]
478
+ #
479
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
480
+ #
481
+ def delete_webhook request, options = nil
482
+ raise ::ArgumentError, "request must be provided" if request.nil?
483
+
484
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest
485
+
486
+ # Converts hash and nil to an options object
487
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
488
+
489
+ # Customize the options with defaults
490
+ metadata = @config.rpcs.delete_webhook.metadata.to_h
491
+
492
+ # Set x-goog-api-client and x-goog-user-project headers
493
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
494
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
495
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
496
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
497
+
498
+ header_params = {
499
+ "name" => request.name
500
+ }
501
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
502
+ metadata[:"x-goog-request-params"] ||= request_params_header
503
+
504
+ options.apply_defaults timeout: @config.rpcs.delete_webhook.timeout,
505
+ metadata: metadata,
506
+ retry_policy: @config.rpcs.delete_webhook.retry_policy
507
+
508
+ options.apply_defaults timeout: @config.timeout,
509
+ metadata: @config.metadata,
510
+ retry_policy: @config.retry_policy
511
+
512
+ @webhooks_stub.call_rpc :delete_webhook, request, options: options do |response, operation|
513
+ yield response, operation if block_given?
514
+ return response
515
+ end
516
+ rescue ::GRPC::BadStatus => e
517
+ raise ::Google::Cloud::Error.from_error(e)
518
+ end
519
+
520
+ ##
521
+ # Configuration class for the Webhooks API.
522
+ #
523
+ # This class represents the configuration for Webhooks,
524
+ # providing control over timeouts, retry behavior, logging, transport
525
+ # parameters, and other low-level controls. Certain parameters can also be
526
+ # applied individually to specific RPCs. See
527
+ # {::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client::Configuration::Rpcs}
528
+ # for a list of RPCs that can be configured independently.
529
+ #
530
+ # Configuration can be applied globally to all clients, or to a single client
531
+ # on construction.
532
+ #
533
+ # @example
534
+ #
535
+ # # Modify the global config, setting the timeout for
536
+ # # list_webhooks to 20 seconds,
537
+ # # and all remaining timeouts to 10 seconds.
538
+ # ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.configure do |config|
539
+ # config.timeout = 10.0
540
+ # config.rpcs.list_webhooks.timeout = 20.0
541
+ # end
542
+ #
543
+ # # Apply the above configuration only to a new client.
544
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new do |config|
545
+ # config.timeout = 10.0
546
+ # config.rpcs.list_webhooks.timeout = 20.0
547
+ # end
548
+ #
549
+ # @!attribute [rw] endpoint
550
+ # The hostname or hostname:port of the service endpoint.
551
+ # Defaults to `"dialogflow.googleapis.com"`.
552
+ # @return [::String]
553
+ # @!attribute [rw] credentials
554
+ # Credentials to send with calls. You may provide any of the following types:
555
+ # * (`String`) The path to a service account key file in JSON format
556
+ # * (`Hash`) A service account key as a Hash
557
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
558
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
559
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
560
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
561
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
562
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
563
+ # * (`nil`) indicating no credentials
564
+ # @return [::Object]
565
+ # @!attribute [rw] scope
566
+ # The OAuth scopes
567
+ # @return [::Array<::String>]
568
+ # @!attribute [rw] lib_name
569
+ # The library name as recorded in instrumentation and logging
570
+ # @return [::String]
571
+ # @!attribute [rw] lib_version
572
+ # The library version as recorded in instrumentation and logging
573
+ # @return [::String]
574
+ # @!attribute [rw] channel_args
575
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
576
+ # `GRPC::Core::Channel` object is provided as the credential.
577
+ # @return [::Hash]
578
+ # @!attribute [rw] interceptors
579
+ # An array of interceptors that are run before calls are executed.
580
+ # @return [::Array<::GRPC::ClientInterceptor>]
581
+ # @!attribute [rw] timeout
582
+ # The call timeout in seconds.
583
+ # @return [::Numeric]
584
+ # @!attribute [rw] metadata
585
+ # Additional gRPC headers to be sent with the call.
586
+ # @return [::Hash{::Symbol=>::String}]
587
+ # @!attribute [rw] retry_policy
588
+ # The retry policy. The value is a hash with the following keys:
589
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
590
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
591
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
592
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
593
+ # trigger a retry.
594
+ # @return [::Hash]
595
+ # @!attribute [rw] quota_project
596
+ # A separate project against which to charge quota.
597
+ # @return [::String]
598
+ #
599
+ class Configuration
600
+ extend ::Gapic::Config
601
+
602
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
603
+ config_attr :credentials, nil do |value|
604
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
605
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
606
+ allowed.any? { |klass| klass === value }
607
+ end
608
+ config_attr :scope, nil, ::String, ::Array, nil
609
+ config_attr :lib_name, nil, ::String, nil
610
+ config_attr :lib_version, nil, ::String, nil
611
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
612
+ config_attr :interceptors, nil, ::Array, nil
613
+ config_attr :timeout, nil, ::Numeric, nil
614
+ config_attr :metadata, nil, ::Hash, nil
615
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
616
+ config_attr :quota_project, nil, ::String, nil
617
+
618
+ # @private
619
+ def initialize parent_config = nil
620
+ @parent_config = parent_config unless parent_config.nil?
621
+
622
+ yield self if block_given?
623
+ end
624
+
625
+ ##
626
+ # Configurations for individual RPCs
627
+ # @return [Rpcs]
628
+ #
629
+ def rpcs
630
+ @rpcs ||= begin
631
+ parent_rpcs = nil
632
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
633
+ Rpcs.new parent_rpcs
634
+ end
635
+ end
636
+
637
+ ##
638
+ # Configuration RPC class for the Webhooks API.
639
+ #
640
+ # Includes fields providing the configuration for each RPC in this service.
641
+ # Each configuration object is of type `Gapic::Config::Method` and includes
642
+ # the following configuration fields:
643
+ #
644
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
645
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
646
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
647
+ # include the following keys:
648
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
649
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
650
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
651
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
652
+ # trigger a retry.
653
+ #
654
+ class Rpcs
655
+ ##
656
+ # RPC-specific configuration for `list_webhooks`
657
+ # @return [::Gapic::Config::Method]
658
+ #
659
+ attr_reader :list_webhooks
660
+ ##
661
+ # RPC-specific configuration for `get_webhook`
662
+ # @return [::Gapic::Config::Method]
663
+ #
664
+ attr_reader :get_webhook
665
+ ##
666
+ # RPC-specific configuration for `create_webhook`
667
+ # @return [::Gapic::Config::Method]
668
+ #
669
+ attr_reader :create_webhook
670
+ ##
671
+ # RPC-specific configuration for `update_webhook`
672
+ # @return [::Gapic::Config::Method]
673
+ #
674
+ attr_reader :update_webhook
675
+ ##
676
+ # RPC-specific configuration for `delete_webhook`
677
+ # @return [::Gapic::Config::Method]
678
+ #
679
+ attr_reader :delete_webhook
680
+
681
+ # @private
682
+ def initialize parent_rpcs = nil
683
+ list_webhooks_config = parent_rpcs.list_webhooks if parent_rpcs.respond_to? :list_webhooks
684
+ @list_webhooks = ::Gapic::Config::Method.new list_webhooks_config
685
+ get_webhook_config = parent_rpcs.get_webhook if parent_rpcs.respond_to? :get_webhook
686
+ @get_webhook = ::Gapic::Config::Method.new get_webhook_config
687
+ create_webhook_config = parent_rpcs.create_webhook if parent_rpcs.respond_to? :create_webhook
688
+ @create_webhook = ::Gapic::Config::Method.new create_webhook_config
689
+ update_webhook_config = parent_rpcs.update_webhook if parent_rpcs.respond_to? :update_webhook
690
+ @update_webhook = ::Gapic::Config::Method.new update_webhook_config
691
+ delete_webhook_config = parent_rpcs.delete_webhook if parent_rpcs.respond_to? :delete_webhook
692
+ @delete_webhook = ::Gapic::Config::Method.new delete_webhook_config
693
+
694
+ yield self if block_given?
695
+ end
696
+ end
697
+ end
698
+ end
699
+ end
700
+ end
701
+ end
702
+ end
703
+ end
704
+ end