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,54 @@
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 CX
25
+ module V3
26
+ module Experiments
27
+ # Credentials for the Experiments API.
28
+ class Credentials < ::Google::Auth::Credentials
29
+ self.scope = [
30
+ "https://www.googleapis.com/auth/cloud-platform",
31
+ "https://www.googleapis.com/auth/dialogflow"
32
+ ]
33
+ self.env_vars = [
34
+ "DIALOGFLOW_CREDENTIALS",
35
+ "DIALOGFLOW_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS",
37
+ "GOOGLE_CLOUD_KEYFILE",
38
+ "GCLOUD_KEYFILE",
39
+ "DIALOGFLOW_CREDENTIALS_JSON",
40
+ "DIALOGFLOW_KEYFILE_JSON",
41
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
42
+ "GOOGLE_CLOUD_KEYFILE_JSON",
43
+ "GCLOUD_KEYFILE_JSON"
44
+ ]
45
+ self.paths = [
46
+ "~/.config/google_cloud/application_default_credentials.json"
47
+ ]
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,102 @@
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 Experiments
26
+ # Path helper methods for the Experiments API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified Environment resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param agent [String]
38
+ # @param environment [String]
39
+ #
40
+ # @return [::String]
41
+ def environment_path project:, location:, agent:, environment:
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}/environments/#{environment}"
47
+ end
48
+
49
+ ##
50
+ # Create a fully-qualified Experiment resource string.
51
+ #
52
+ # The resource will be in the following format:
53
+ #
54
+ # `projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/experiments/{experiment}`
55
+ #
56
+ # @param project [String]
57
+ # @param location [String]
58
+ # @param agent [String]
59
+ # @param environment [String]
60
+ # @param experiment [String]
61
+ #
62
+ # @return [::String]
63
+ def experiment_path project:, location:, agent:, environment:, experiment:
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, "environment cannot contain /" if environment.to_s.include? "/"
68
+
69
+ "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/experiments/#{experiment}"
70
+ end
71
+
72
+ ##
73
+ # Create a fully-qualified Version resource string.
74
+ #
75
+ # The resource will be in the following format:
76
+ #
77
+ # `projects/{project}/locations/{location}/agents/{agent}/flows/{flow}/versions/{version}`
78
+ #
79
+ # @param project [String]
80
+ # @param location [String]
81
+ # @param agent [String]
82
+ # @param flow [String]
83
+ # @param version [String]
84
+ #
85
+ # @return [::String]
86
+ def version_path project:, location:, agent:, flow:, version:
87
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
88
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
89
+ raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
90
+ raise ::ArgumentError, "flow cannot contain /" if flow.to_s.include? "/"
91
+
92
+ "projects/#{project}/locations/#{location}/agents/#{agent}/flows/#{flow}/versions/#{version}"
93
+ end
94
+
95
+ extend self
96
+ end
97
+ end
98
+ end
99
+ end
100
+ end
101
+ end
102
+ end
@@ -0,0 +1,51 @@
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/experiments/credentials"
26
+ require "google/cloud/dialogflow/cx/v3/experiments/paths"
27
+ require "google/cloud/dialogflow/cx/v3/experiments/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Dialogflow
32
+ module CX
33
+ module V3
34
+ ##
35
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/dialogflow/cx/v3/experiments"
40
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new
41
+ #
42
+ module Experiments
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "experiments", "helpers.rb"
51
+ require "google/cloud/dialogflow/cx/v3/experiments/helpers" if ::File.file? helper_path
@@ -0,0 +1,145 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/dialogflow/cx/v3/flow.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/advanced_settings_pb'
11
+ require 'google/cloud/dialogflow/cx/v3/page_pb'
12
+ require 'google/cloud/dialogflow/cx/v3/validation_message_pb'
13
+ require 'google/longrunning/operations_pb'
14
+ require 'google/protobuf/empty_pb'
15
+ require 'google/protobuf/field_mask_pb'
16
+ require 'google/protobuf/timestamp_pb'
17
+ Google::Protobuf::DescriptorPool.generated_pool.build do
18
+ add_file("google/cloud/dialogflow/cx/v3/flow.proto", :syntax => :proto3) do
19
+ add_message "google.cloud.dialogflow.cx.v3.NluSettings" do
20
+ optional :model_type, :enum, 1, "google.cloud.dialogflow.cx.v3.NluSettings.ModelType"
21
+ optional :classification_threshold, :float, 3
22
+ optional :model_training_mode, :enum, 4, "google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode"
23
+ end
24
+ add_enum "google.cloud.dialogflow.cx.v3.NluSettings.ModelType" do
25
+ value :MODEL_TYPE_UNSPECIFIED, 0
26
+ value :MODEL_TYPE_STANDARD, 1
27
+ value :MODEL_TYPE_ADVANCED, 3
28
+ end
29
+ add_enum "google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode" do
30
+ value :MODEL_TRAINING_MODE_UNSPECIFIED, 0
31
+ value :MODEL_TRAINING_MODE_AUTOMATIC, 1
32
+ value :MODEL_TRAINING_MODE_MANUAL, 2
33
+ end
34
+ add_message "google.cloud.dialogflow.cx.v3.Flow" do
35
+ optional :name, :string, 1
36
+ optional :display_name, :string, 2
37
+ optional :description, :string, 3
38
+ repeated :transition_routes, :message, 4, "google.cloud.dialogflow.cx.v3.TransitionRoute"
39
+ repeated :event_handlers, :message, 10, "google.cloud.dialogflow.cx.v3.EventHandler"
40
+ repeated :transition_route_groups, :string, 15
41
+ optional :nlu_settings, :message, 11, "google.cloud.dialogflow.cx.v3.NluSettings"
42
+ end
43
+ add_message "google.cloud.dialogflow.cx.v3.CreateFlowRequest" do
44
+ optional :parent, :string, 1
45
+ optional :flow, :message, 2, "google.cloud.dialogflow.cx.v3.Flow"
46
+ optional :language_code, :string, 3
47
+ end
48
+ add_message "google.cloud.dialogflow.cx.v3.DeleteFlowRequest" do
49
+ optional :name, :string, 1
50
+ optional :force, :bool, 2
51
+ end
52
+ add_message "google.cloud.dialogflow.cx.v3.ListFlowsRequest" do
53
+ optional :parent, :string, 1
54
+ optional :page_size, :int32, 2
55
+ optional :page_token, :string, 3
56
+ optional :language_code, :string, 4
57
+ end
58
+ add_message "google.cloud.dialogflow.cx.v3.ListFlowsResponse" do
59
+ repeated :flows, :message, 1, "google.cloud.dialogflow.cx.v3.Flow"
60
+ optional :next_page_token, :string, 2
61
+ end
62
+ add_message "google.cloud.dialogflow.cx.v3.GetFlowRequest" do
63
+ optional :name, :string, 1
64
+ optional :language_code, :string, 2
65
+ end
66
+ add_message "google.cloud.dialogflow.cx.v3.UpdateFlowRequest" do
67
+ optional :flow, :message, 1, "google.cloud.dialogflow.cx.v3.Flow"
68
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
69
+ optional :language_code, :string, 3
70
+ end
71
+ add_message "google.cloud.dialogflow.cx.v3.TrainFlowRequest" do
72
+ optional :name, :string, 1
73
+ end
74
+ add_message "google.cloud.dialogflow.cx.v3.ValidateFlowRequest" do
75
+ optional :name, :string, 1
76
+ optional :language_code, :string, 2
77
+ end
78
+ add_message "google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest" do
79
+ optional :name, :string, 1
80
+ optional :language_code, :string, 2
81
+ end
82
+ add_message "google.cloud.dialogflow.cx.v3.FlowValidationResult" do
83
+ optional :name, :string, 1
84
+ repeated :validation_messages, :message, 2, "google.cloud.dialogflow.cx.v3.ValidationMessage"
85
+ optional :update_time, :message, 3, "google.protobuf.Timestamp"
86
+ end
87
+ add_message "google.cloud.dialogflow.cx.v3.ImportFlowRequest" do
88
+ optional :parent, :string, 1
89
+ optional :import_option, :enum, 4, "google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption"
90
+ oneof :flow do
91
+ optional :flow_uri, :string, 2
92
+ optional :flow_content, :bytes, 3
93
+ end
94
+ end
95
+ add_enum "google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption" do
96
+ value :IMPORT_OPTION_UNSPECIFIED, 0
97
+ value :KEEP, 1
98
+ value :FALLBACK, 2
99
+ end
100
+ add_message "google.cloud.dialogflow.cx.v3.ImportFlowResponse" do
101
+ optional :flow, :string, 1
102
+ end
103
+ add_message "google.cloud.dialogflow.cx.v3.ExportFlowRequest" do
104
+ optional :name, :string, 1
105
+ optional :flow_uri, :string, 2
106
+ optional :include_referenced_flows, :bool, 4
107
+ end
108
+ add_message "google.cloud.dialogflow.cx.v3.ExportFlowResponse" do
109
+ oneof :flow do
110
+ optional :flow_uri, :string, 1
111
+ optional :flow_content, :bytes, 2
112
+ end
113
+ end
114
+ end
115
+ end
116
+
117
+ module Google
118
+ module Cloud
119
+ module Dialogflow
120
+ module CX
121
+ module V3
122
+ NluSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings").msgclass
123
+ NluSettings::ModelType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings.ModelType").enummodule
124
+ NluSettings::ModelTrainingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.NluSettings.ModelTrainingMode").enummodule
125
+ Flow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Flow").msgclass
126
+ CreateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateFlowRequest").msgclass
127
+ DeleteFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteFlowRequest").msgclass
128
+ ListFlowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListFlowsRequest").msgclass
129
+ ListFlowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListFlowsResponse").msgclass
130
+ GetFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetFlowRequest").msgclass
131
+ UpdateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateFlowRequest").msgclass
132
+ TrainFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TrainFlowRequest").msgclass
133
+ ValidateFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ValidateFlowRequest").msgclass
134
+ GetFlowValidationResultRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest").msgclass
135
+ FlowValidationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.FlowValidationResult").msgclass
136
+ ImportFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowRequest").msgclass
137
+ ImportFlowRequest::ImportOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowRequest.ImportOption").enummodule
138
+ ImportFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ImportFlowResponse").msgclass
139
+ ExportFlowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportFlowRequest").msgclass
140
+ ExportFlowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ExportFlowResponse").msgclass
141
+ end
142
+ end
143
+ end
144
+ end
145
+ end
@@ -0,0 +1,88 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/dialogflow/cx/v3/flow.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/flow_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module Flows
28
+ # Service for managing [Flows][google.cloud.dialogflow.cx.v3.Flow].
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.Flows'
36
+
37
+ # Creates a flow in the specified agent.
38
+ #
39
+ # Note: You should always train a flow prior to sending it queries. See the
40
+ # [training
41
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
42
+ rpc :CreateFlow, ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow
43
+ # Deletes a specified flow.
44
+ rpc :DeleteFlow, ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Google::Protobuf::Empty
45
+ # Returns the list of all flows in the specified agent.
46
+ rpc :ListFlows, ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListFlowsResponse
47
+ # Retrieves the specified flow.
48
+ rpc :GetFlow, ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow
49
+ # Updates the specified flow.
50
+ #
51
+ # Note: You should always train a flow prior to sending it queries. See the
52
+ # [training
53
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
54
+ rpc :UpdateFlow, ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::Flow
55
+ # Trains the specified flow. Note that only the flow in 'draft' environment
56
+ # is trained.
57
+ #
58
+ # Note: You should always train a flow prior to sending it queries. See the
59
+ # [training
60
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
61
+ rpc :TrainFlow, ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Google::Longrunning::Operation
62
+ # Validates the specified flow and creates or updates validation results.
63
+ # Please call this API after the training is completed to get the complete
64
+ # validation results.
65
+ rpc :ValidateFlow, ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
66
+ # Gets the latest flow validation result. Flow validation is performed
67
+ # when ValidateFlow is called.
68
+ rpc :GetFlowValidationResult, ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult
69
+ # Imports the specified flow to the specified agent from a binary file.
70
+ #
71
+ # Note: You should always train a flow prior to sending it queries. See the
72
+ # [training
73
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
74
+ rpc :ImportFlow, ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Google::Longrunning::Operation
75
+ # Exports the specified flow to a binary file.
76
+ #
77
+ # Note that resources (e.g. intents, entities, webhooks) that the flow
78
+ # references will also be exported.
79
+ rpc :ExportFlow, ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Google::Longrunning::Operation
80
+ end
81
+
82
+ Stub = Service.rpc_stub_class
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,1200 @@
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/flow_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module Flows
28
+ ##
29
+ # Client for the Flows service.
30
+ #
31
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Flow Flows}.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :flows_stub
38
+
39
+ ##
40
+ # Configure the Flows Client class.
41
+ #
42
+ # See {::Google::Cloud::Dialogflow::CX::V3::Flows::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all Flows clients
48
+ # ::Google::Cloud::Dialogflow::CX::V3::Flows::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 Flows 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::Flows::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 Flows client object.
101
+ #
102
+ # @example
103
+ #
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new
106
+ #
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the Flows 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/flow_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
+ @operations_client = Operations.new do |config|
143
+ config.credentials = credentials
144
+ config.endpoint = @config.endpoint
145
+ end
146
+
147
+ @flows_stub = ::Gapic::ServiceStub.new(
148
+ ::Google::Cloud::Dialogflow::CX::V3::Flows::Stub,
149
+ credentials: credentials,
150
+ endpoint: @config.endpoint,
151
+ channel_args: @config.channel_args,
152
+ interceptors: @config.interceptors
153
+ )
154
+ end
155
+
156
+ ##
157
+ # Get the associated client for long-running operations.
158
+ #
159
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Flows::Operations]
160
+ #
161
+ attr_reader :operations_client
162
+
163
+ # Service calls
164
+
165
+ ##
166
+ # Creates a flow in the specified agent.
167
+ #
168
+ # Note: You should always train a flow prior to sending it queries. See the
169
+ # [training
170
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
171
+ #
172
+ # @overload create_flow(request, options = nil)
173
+ # Pass arguments to `create_flow` via a request object, either of type
174
+ # {::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest} or an equivalent Hash.
175
+ #
176
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest, ::Hash]
177
+ # A request object representing the call parameters. Required. To specify no
178
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
179
+ # @param options [::Gapic::CallOptions, ::Hash]
180
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
181
+ #
182
+ # @overload create_flow(parent: nil, flow: nil, language_code: nil)
183
+ # Pass arguments to `create_flow` via keyword arguments. Note that at
184
+ # least one keyword argument is required. To specify no parameters, or to keep all
185
+ # the default parameter values, pass an empty Hash as a request object (see above).
186
+ #
187
+ # @param parent [::String]
188
+ # Required. The agent to create a flow for.
189
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
190
+ # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash]
191
+ # Required. The flow to create.
192
+ # @param language_code [::String]
193
+ # The language of the following fields in `flow`:
194
+ #
195
+ # * `Flow.event_handlers.trigger_fulfillment.messages`
196
+ # * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
197
+ # * `Flow.transition_routes.trigger_fulfillment.messages`
198
+ # * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
199
+ #
200
+ # If not specified, the agent's default language is used.
201
+ # [Many
202
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
203
+ # are supported.
204
+ # Note: languages must be enabled in the agent before they can be used.
205
+ #
206
+ # @yield [response, operation] Access the result along with the RPC operation
207
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Flow]
208
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
209
+ #
210
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Flow]
211
+ #
212
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
213
+ #
214
+ def create_flow request, options = nil
215
+ raise ::ArgumentError, "request must be provided" if request.nil?
216
+
217
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest
218
+
219
+ # Converts hash and nil to an options object
220
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
221
+
222
+ # Customize the options with defaults
223
+ metadata = @config.rpcs.create_flow.metadata.to_h
224
+
225
+ # Set x-goog-api-client and x-goog-user-project headers
226
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
227
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
228
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
229
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
230
+
231
+ header_params = {
232
+ "parent" => request.parent
233
+ }
234
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
235
+ metadata[:"x-goog-request-params"] ||= request_params_header
236
+
237
+ options.apply_defaults timeout: @config.rpcs.create_flow.timeout,
238
+ metadata: metadata,
239
+ retry_policy: @config.rpcs.create_flow.retry_policy
240
+
241
+ options.apply_defaults timeout: @config.timeout,
242
+ metadata: @config.metadata,
243
+ retry_policy: @config.retry_policy
244
+
245
+ @flows_stub.call_rpc :create_flow, request, options: options do |response, operation|
246
+ yield response, operation if block_given?
247
+ return response
248
+ end
249
+ rescue ::GRPC::BadStatus => e
250
+ raise ::Google::Cloud::Error.from_error(e)
251
+ end
252
+
253
+ ##
254
+ # Deletes a specified flow.
255
+ #
256
+ # @overload delete_flow(request, options = nil)
257
+ # Pass arguments to `delete_flow` via a request object, either of type
258
+ # {::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest} or an equivalent Hash.
259
+ #
260
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest, ::Hash]
261
+ # A request object representing the call parameters. Required. To specify no
262
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
263
+ # @param options [::Gapic::CallOptions, ::Hash]
264
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
265
+ #
266
+ # @overload delete_flow(name: nil, force: nil)
267
+ # Pass arguments to `delete_flow` via keyword arguments. Note that at
268
+ # least one keyword argument is required. To specify no parameters, or to keep all
269
+ # the default parameter values, pass an empty Hash as a request object (see above).
270
+ #
271
+ # @param name [::String]
272
+ # Required. The name of the flow to delete.
273
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
274
+ # ID>/flows/<Flow ID>`.
275
+ # @param force [::Boolean]
276
+ # This field has no effect for flows with no incoming transitions.
277
+ # For flows with incoming transitions:
278
+ #
279
+ # * If `force` is set to false, an error will be returned with message
280
+ # indicating the incoming transitions.
281
+ # * If `force` is set to true, Dialogflow will remove the flow, as well as
282
+ # any transitions to the flow (i.e. [Target
283
+ # flow][EventHandler.target_flow] in event handlers or [Target
284
+ # flow][TransitionRoute.target_flow] in transition routes that point to
285
+ # this flow will be cleared).
286
+ #
287
+ # @yield [response, operation] Access the result along with the RPC operation
288
+ # @yieldparam response [::Google::Protobuf::Empty]
289
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
290
+ #
291
+ # @return [::Google::Protobuf::Empty]
292
+ #
293
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
294
+ #
295
+ def delete_flow request, options = nil
296
+ raise ::ArgumentError, "request must be provided" if request.nil?
297
+
298
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest
299
+
300
+ # Converts hash and nil to an options object
301
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
302
+
303
+ # Customize the options with defaults
304
+ metadata = @config.rpcs.delete_flow.metadata.to_h
305
+
306
+ # Set x-goog-api-client and x-goog-user-project headers
307
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
308
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
309
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
310
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
311
+
312
+ header_params = {
313
+ "name" => request.name
314
+ }
315
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
316
+ metadata[:"x-goog-request-params"] ||= request_params_header
317
+
318
+ options.apply_defaults timeout: @config.rpcs.delete_flow.timeout,
319
+ metadata: metadata,
320
+ retry_policy: @config.rpcs.delete_flow.retry_policy
321
+
322
+ options.apply_defaults timeout: @config.timeout,
323
+ metadata: @config.metadata,
324
+ retry_policy: @config.retry_policy
325
+
326
+ @flows_stub.call_rpc :delete_flow, request, options: options do |response, operation|
327
+ yield response, operation if block_given?
328
+ return response
329
+ end
330
+ rescue ::GRPC::BadStatus => e
331
+ raise ::Google::Cloud::Error.from_error(e)
332
+ end
333
+
334
+ ##
335
+ # Returns the list of all flows in the specified agent.
336
+ #
337
+ # @overload list_flows(request, options = nil)
338
+ # Pass arguments to `list_flows` via a request object, either of type
339
+ # {::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest} or an equivalent Hash.
340
+ #
341
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest, ::Hash]
342
+ # A request object representing the call parameters. Required. To specify no
343
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
344
+ # @param options [::Gapic::CallOptions, ::Hash]
345
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
346
+ #
347
+ # @overload list_flows(parent: nil, page_size: nil, page_token: nil, language_code: nil)
348
+ # Pass arguments to `list_flows` via keyword arguments. Note that at
349
+ # least one keyword argument is required. To specify no parameters, or to keep all
350
+ # the default parameter values, pass an empty Hash as a request object (see above).
351
+ #
352
+ # @param parent [::String]
353
+ # Required. The agent containing the flows.
354
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
355
+ # @param page_size [::Integer]
356
+ # The maximum number of items to return in a single page. By default 100 and
357
+ # at most 1000.
358
+ # @param page_token [::String]
359
+ # The next_page_token value returned from a previous list request.
360
+ # @param language_code [::String]
361
+ # The language to list flows for. The following fields are language
362
+ # dependent:
363
+ #
364
+ # * `Flow.event_handlers.trigger_fulfillment.messages`
365
+ # * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
366
+ # * `Flow.transition_routes.trigger_fulfillment.messages`
367
+ # * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
368
+ #
369
+ # If not specified, the agent's default language is used.
370
+ # [Many
371
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
372
+ # are supported.
373
+ # Note: languages must be enabled in the agent before they can be used.
374
+ #
375
+ # @yield [response, operation] Access the result along with the RPC operation
376
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>]
377
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
378
+ #
379
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Flow>]
380
+ #
381
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
382
+ #
383
+ def list_flows request, options = nil
384
+ raise ::ArgumentError, "request must be provided" if request.nil?
385
+
386
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest
387
+
388
+ # Converts hash and nil to an options object
389
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
390
+
391
+ # Customize the options with defaults
392
+ metadata = @config.rpcs.list_flows.metadata.to_h
393
+
394
+ # Set x-goog-api-client and x-goog-user-project headers
395
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
396
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
397
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
398
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
399
+
400
+ header_params = {
401
+ "parent" => request.parent
402
+ }
403
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
404
+ metadata[:"x-goog-request-params"] ||= request_params_header
405
+
406
+ options.apply_defaults timeout: @config.rpcs.list_flows.timeout,
407
+ metadata: metadata,
408
+ retry_policy: @config.rpcs.list_flows.retry_policy
409
+
410
+ options.apply_defaults timeout: @config.timeout,
411
+ metadata: @config.metadata,
412
+ retry_policy: @config.retry_policy
413
+
414
+ @flows_stub.call_rpc :list_flows, request, options: options do |response, operation|
415
+ response = ::Gapic::PagedEnumerable.new @flows_stub, :list_flows, request, response, operation, options
416
+ yield response, operation if block_given?
417
+ return response
418
+ end
419
+ rescue ::GRPC::BadStatus => e
420
+ raise ::Google::Cloud::Error.from_error(e)
421
+ end
422
+
423
+ ##
424
+ # Retrieves the specified flow.
425
+ #
426
+ # @overload get_flow(request, options = nil)
427
+ # Pass arguments to `get_flow` via a request object, either of type
428
+ # {::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest} or an equivalent Hash.
429
+ #
430
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest, ::Hash]
431
+ # A request object representing the call parameters. Required. To specify no
432
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
433
+ # @param options [::Gapic::CallOptions, ::Hash]
434
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
435
+ #
436
+ # @overload get_flow(name: nil, language_code: nil)
437
+ # Pass arguments to `get_flow` via keyword arguments. Note that at
438
+ # least one keyword argument is required. To specify no parameters, or to keep all
439
+ # the default parameter values, pass an empty Hash as a request object (see above).
440
+ #
441
+ # @param name [::String]
442
+ # Required. The name of the flow to get.
443
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
444
+ # ID>/flows/<Flow ID>`.
445
+ # @param language_code [::String]
446
+ # The language to retrieve the flow for. The following fields are language
447
+ # dependent:
448
+ #
449
+ # * `Flow.event_handlers.trigger_fulfillment.messages`
450
+ # * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
451
+ # * `Flow.transition_routes.trigger_fulfillment.messages`
452
+ # * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
453
+ #
454
+ # If not specified, the agent's default language is used.
455
+ # [Many
456
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
457
+ # are supported.
458
+ # Note: languages must be enabled in the agent before they can be used.
459
+ #
460
+ # @yield [response, operation] Access the result along with the RPC operation
461
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Flow]
462
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
463
+ #
464
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Flow]
465
+ #
466
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
467
+ #
468
+ def get_flow request, options = nil
469
+ raise ::ArgumentError, "request must be provided" if request.nil?
470
+
471
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowRequest
472
+
473
+ # Converts hash and nil to an options object
474
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
475
+
476
+ # Customize the options with defaults
477
+ metadata = @config.rpcs.get_flow.metadata.to_h
478
+
479
+ # Set x-goog-api-client and x-goog-user-project headers
480
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
481
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
482
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
483
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
484
+
485
+ header_params = {
486
+ "name" => request.name
487
+ }
488
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
489
+ metadata[:"x-goog-request-params"] ||= request_params_header
490
+
491
+ options.apply_defaults timeout: @config.rpcs.get_flow.timeout,
492
+ metadata: metadata,
493
+ retry_policy: @config.rpcs.get_flow.retry_policy
494
+
495
+ options.apply_defaults timeout: @config.timeout,
496
+ metadata: @config.metadata,
497
+ retry_policy: @config.retry_policy
498
+
499
+ @flows_stub.call_rpc :get_flow, request, options: options do |response, operation|
500
+ yield response, operation if block_given?
501
+ return response
502
+ end
503
+ rescue ::GRPC::BadStatus => e
504
+ raise ::Google::Cloud::Error.from_error(e)
505
+ end
506
+
507
+ ##
508
+ # Updates the specified flow.
509
+ #
510
+ # Note: You should always train a flow prior to sending it queries. See the
511
+ # [training
512
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
513
+ #
514
+ # @overload update_flow(request, options = nil)
515
+ # Pass arguments to `update_flow` via a request object, either of type
516
+ # {::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest} or an equivalent Hash.
517
+ #
518
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest, ::Hash]
519
+ # A request object representing the call parameters. Required. To specify no
520
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
521
+ # @param options [::Gapic::CallOptions, ::Hash]
522
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
523
+ #
524
+ # @overload update_flow(flow: nil, update_mask: nil, language_code: nil)
525
+ # Pass arguments to `update_flow` via keyword arguments. Note that at
526
+ # least one keyword argument is required. To specify no parameters, or to keep all
527
+ # the default parameter values, pass an empty Hash as a request object (see above).
528
+ #
529
+ # @param flow [::Google::Cloud::Dialogflow::CX::V3::Flow, ::Hash]
530
+ # Required. The flow to update.
531
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
532
+ # Required. The mask to control which fields get updated. If `update_mask` is not
533
+ # specified, an error will be returned.
534
+ # @param language_code [::String]
535
+ # The language of the following fields in `flow`:
536
+ #
537
+ # * `Flow.event_handlers.trigger_fulfillment.messages`
538
+ # * `Flow.event_handlers.trigger_fulfillment.conditional_cases`
539
+ # * `Flow.transition_routes.trigger_fulfillment.messages`
540
+ # * `Flow.transition_routes.trigger_fulfillment.conditional_cases`
541
+ #
542
+ # If not specified, the agent's default language is used.
543
+ # [Many
544
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
545
+ # are supported.
546
+ # Note: languages must be enabled in the agent before they can be used.
547
+ #
548
+ # @yield [response, operation] Access the result along with the RPC operation
549
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Flow]
550
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
551
+ #
552
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Flow]
553
+ #
554
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
555
+ #
556
+ def update_flow request, options = nil
557
+ raise ::ArgumentError, "request must be provided" if request.nil?
558
+
559
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest
560
+
561
+ # Converts hash and nil to an options object
562
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
+
564
+ # Customize the options with defaults
565
+ metadata = @config.rpcs.update_flow.metadata.to_h
566
+
567
+ # Set x-goog-api-client and x-goog-user-project headers
568
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
569
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
570
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
571
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
572
+
573
+ header_params = {
574
+ "flow.name" => request.flow.name
575
+ }
576
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
577
+ metadata[:"x-goog-request-params"] ||= request_params_header
578
+
579
+ options.apply_defaults timeout: @config.rpcs.update_flow.timeout,
580
+ metadata: metadata,
581
+ retry_policy: @config.rpcs.update_flow.retry_policy
582
+
583
+ options.apply_defaults timeout: @config.timeout,
584
+ metadata: @config.metadata,
585
+ retry_policy: @config.retry_policy
586
+
587
+ @flows_stub.call_rpc :update_flow, request, options: options do |response, operation|
588
+ yield response, operation if block_given?
589
+ return response
590
+ end
591
+ rescue ::GRPC::BadStatus => e
592
+ raise ::Google::Cloud::Error.from_error(e)
593
+ end
594
+
595
+ ##
596
+ # Trains the specified flow. Note that only the flow in 'draft' environment
597
+ # is trained.
598
+ #
599
+ # Note: You should always train a flow prior to sending it queries. See the
600
+ # [training
601
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
602
+ #
603
+ # @overload train_flow(request, options = nil)
604
+ # Pass arguments to `train_flow` via a request object, either of type
605
+ # {::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest} or an equivalent Hash.
606
+ #
607
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest, ::Hash]
608
+ # A request object representing the call parameters. Required. To specify no
609
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
610
+ # @param options [::Gapic::CallOptions, ::Hash]
611
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
612
+ #
613
+ # @overload train_flow(name: nil)
614
+ # Pass arguments to `train_flow` via keyword arguments. Note that at
615
+ # least one keyword argument is required. To specify no parameters, or to keep all
616
+ # the default parameter values, pass an empty Hash as a request object (see above).
617
+ #
618
+ # @param name [::String]
619
+ # Required. The flow to train.
620
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
621
+ # ID>/flows/<Flow ID>`.
622
+ #
623
+ # @yield [response, operation] Access the result along with the RPC operation
624
+ # @yieldparam response [::Gapic::Operation]
625
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
626
+ #
627
+ # @return [::Gapic::Operation]
628
+ #
629
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
630
+ #
631
+ def train_flow request, options = nil
632
+ raise ::ArgumentError, "request must be provided" if request.nil?
633
+
634
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest
635
+
636
+ # Converts hash and nil to an options object
637
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
638
+
639
+ # Customize the options with defaults
640
+ metadata = @config.rpcs.train_flow.metadata.to_h
641
+
642
+ # Set x-goog-api-client and x-goog-user-project headers
643
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
644
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
645
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
646
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
647
+
648
+ header_params = {
649
+ "name" => request.name
650
+ }
651
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
652
+ metadata[:"x-goog-request-params"] ||= request_params_header
653
+
654
+ options.apply_defaults timeout: @config.rpcs.train_flow.timeout,
655
+ metadata: metadata,
656
+ retry_policy: @config.rpcs.train_flow.retry_policy
657
+
658
+ options.apply_defaults timeout: @config.timeout,
659
+ metadata: @config.metadata,
660
+ retry_policy: @config.retry_policy
661
+
662
+ @flows_stub.call_rpc :train_flow, request, options: options do |response, operation|
663
+ response = ::Gapic::Operation.new response, @operations_client, options: options
664
+ yield response, operation if block_given?
665
+ return response
666
+ end
667
+ rescue ::GRPC::BadStatus => e
668
+ raise ::Google::Cloud::Error.from_error(e)
669
+ end
670
+
671
+ ##
672
+ # Validates the specified flow and creates or updates validation results.
673
+ # Please call this API after the training is completed to get the complete
674
+ # validation results.
675
+ #
676
+ # @overload validate_flow(request, options = nil)
677
+ # Pass arguments to `validate_flow` via a request object, either of type
678
+ # {::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest} or an equivalent Hash.
679
+ #
680
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest, ::Hash]
681
+ # A request object representing the call parameters. Required. To specify no
682
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
683
+ # @param options [::Gapic::CallOptions, ::Hash]
684
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
685
+ #
686
+ # @overload validate_flow(name: nil, language_code: nil)
687
+ # Pass arguments to `validate_flow` via keyword arguments. Note that at
688
+ # least one keyword argument is required. To specify no parameters, or to keep all
689
+ # the default parameter values, pass an empty Hash as a request object (see above).
690
+ #
691
+ # @param name [::String]
692
+ # Required. The flow to validate.
693
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
694
+ # ID>/flows/<Flow ID>`.
695
+ # @param language_code [::String]
696
+ # If not specified, the agent's default language is used.
697
+ #
698
+ # @yield [response, operation] Access the result along with the RPC operation
699
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult]
700
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
701
+ #
702
+ # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult]
703
+ #
704
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
705
+ #
706
+ def validate_flow request, options = nil
707
+ raise ::ArgumentError, "request must be provided" if request.nil?
708
+
709
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest
710
+
711
+ # Converts hash and nil to an options object
712
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
713
+
714
+ # Customize the options with defaults
715
+ metadata = @config.rpcs.validate_flow.metadata.to_h
716
+
717
+ # Set x-goog-api-client and x-goog-user-project headers
718
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
719
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
720
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
721
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
722
+
723
+ header_params = {
724
+ "name" => request.name
725
+ }
726
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
727
+ metadata[:"x-goog-request-params"] ||= request_params_header
728
+
729
+ options.apply_defaults timeout: @config.rpcs.validate_flow.timeout,
730
+ metadata: metadata,
731
+ retry_policy: @config.rpcs.validate_flow.retry_policy
732
+
733
+ options.apply_defaults timeout: @config.timeout,
734
+ metadata: @config.metadata,
735
+ retry_policy: @config.retry_policy
736
+
737
+ @flows_stub.call_rpc :validate_flow, request, options: options do |response, operation|
738
+ yield response, operation if block_given?
739
+ return response
740
+ end
741
+ rescue ::GRPC::BadStatus => e
742
+ raise ::Google::Cloud::Error.from_error(e)
743
+ end
744
+
745
+ ##
746
+ # Gets the latest flow validation result. Flow validation is performed
747
+ # when ValidateFlow is called.
748
+ #
749
+ # @overload get_flow_validation_result(request, options = nil)
750
+ # Pass arguments to `get_flow_validation_result` via a request object, either of type
751
+ # {::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest} or an equivalent Hash.
752
+ #
753
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest, ::Hash]
754
+ # A request object representing the call parameters. Required. To specify no
755
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
756
+ # @param options [::Gapic::CallOptions, ::Hash]
757
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
758
+ #
759
+ # @overload get_flow_validation_result(name: nil, language_code: nil)
760
+ # Pass arguments to `get_flow_validation_result` via keyword arguments. Note that at
761
+ # least one keyword argument is required. To specify no parameters, or to keep all
762
+ # the default parameter values, pass an empty Hash as a request object (see above).
763
+ #
764
+ # @param name [::String]
765
+ # Required. The flow name.
766
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
767
+ # ID>/flows/<Flow ID>/validationResult`.
768
+ # @param language_code [::String]
769
+ # If not specified, the agent's default language is used.
770
+ #
771
+ # @yield [response, operation] Access the result along with the RPC operation
772
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult]
773
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
774
+ #
775
+ # @return [::Google::Cloud::Dialogflow::CX::V3::FlowValidationResult]
776
+ #
777
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
778
+ #
779
+ def get_flow_validation_result request, options = nil
780
+ raise ::ArgumentError, "request must be provided" if request.nil?
781
+
782
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest
783
+
784
+ # Converts hash and nil to an options object
785
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
786
+
787
+ # Customize the options with defaults
788
+ metadata = @config.rpcs.get_flow_validation_result.metadata.to_h
789
+
790
+ # Set x-goog-api-client and x-goog-user-project headers
791
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
792
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
793
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
794
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
795
+
796
+ header_params = {
797
+ "name" => request.name
798
+ }
799
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
800
+ metadata[:"x-goog-request-params"] ||= request_params_header
801
+
802
+ options.apply_defaults timeout: @config.rpcs.get_flow_validation_result.timeout,
803
+ metadata: metadata,
804
+ retry_policy: @config.rpcs.get_flow_validation_result.retry_policy
805
+
806
+ options.apply_defaults timeout: @config.timeout,
807
+ metadata: @config.metadata,
808
+ retry_policy: @config.retry_policy
809
+
810
+ @flows_stub.call_rpc :get_flow_validation_result, request, options: options do |response, operation|
811
+ yield response, operation if block_given?
812
+ return response
813
+ end
814
+ rescue ::GRPC::BadStatus => e
815
+ raise ::Google::Cloud::Error.from_error(e)
816
+ end
817
+
818
+ ##
819
+ # Imports the specified flow to the specified agent from a binary file.
820
+ #
821
+ # Note: You should always train a flow prior to sending it queries. See the
822
+ # [training
823
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
824
+ #
825
+ # @overload import_flow(request, options = nil)
826
+ # Pass arguments to `import_flow` via a request object, either of type
827
+ # {::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest} or an equivalent Hash.
828
+ #
829
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest, ::Hash]
830
+ # A request object representing the call parameters. Required. To specify no
831
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
832
+ # @param options [::Gapic::CallOptions, ::Hash]
833
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
834
+ #
835
+ # @overload import_flow(parent: nil, flow_uri: nil, flow_content: nil, import_option: nil)
836
+ # Pass arguments to `import_flow` via keyword arguments. Note that at
837
+ # least one keyword argument is required. To specify no parameters, or to keep all
838
+ # the default parameter values, pass an empty Hash as a request object (see above).
839
+ #
840
+ # @param parent [::String]
841
+ # Required. The agent to import the flow into.
842
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
843
+ # @param flow_uri [::String]
844
+ # The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI
845
+ # to import flow from. The format of this URI must be
846
+ # `gs://<bucket-name>/<object-name>`.
847
+ # @param flow_content [::String]
848
+ # Uncompressed raw byte content for flow.
849
+ # @param import_option [::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest::ImportOption]
850
+ # Flow import mode. If not specified, `KEEP` is assumed.
851
+ #
852
+ # @yield [response, operation] Access the result along with the RPC operation
853
+ # @yieldparam response [::Gapic::Operation]
854
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
855
+ #
856
+ # @return [::Gapic::Operation]
857
+ #
858
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
859
+ #
860
+ def import_flow request, options = nil
861
+ raise ::ArgumentError, "request must be provided" if request.nil?
862
+
863
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest
864
+
865
+ # Converts hash and nil to an options object
866
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
867
+
868
+ # Customize the options with defaults
869
+ metadata = @config.rpcs.import_flow.metadata.to_h
870
+
871
+ # Set x-goog-api-client and x-goog-user-project headers
872
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
873
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
874
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
875
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
876
+
877
+ header_params = {
878
+ "parent" => request.parent
879
+ }
880
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
881
+ metadata[:"x-goog-request-params"] ||= request_params_header
882
+
883
+ options.apply_defaults timeout: @config.rpcs.import_flow.timeout,
884
+ metadata: metadata,
885
+ retry_policy: @config.rpcs.import_flow.retry_policy
886
+
887
+ options.apply_defaults timeout: @config.timeout,
888
+ metadata: @config.metadata,
889
+ retry_policy: @config.retry_policy
890
+
891
+ @flows_stub.call_rpc :import_flow, request, options: options do |response, operation|
892
+ response = ::Gapic::Operation.new response, @operations_client, options: options
893
+ yield response, operation if block_given?
894
+ return response
895
+ end
896
+ rescue ::GRPC::BadStatus => e
897
+ raise ::Google::Cloud::Error.from_error(e)
898
+ end
899
+
900
+ ##
901
+ # Exports the specified flow to a binary file.
902
+ #
903
+ # Note that resources (e.g. intents, entities, webhooks) that the flow
904
+ # references will also be exported.
905
+ #
906
+ # @overload export_flow(request, options = nil)
907
+ # Pass arguments to `export_flow` via a request object, either of type
908
+ # {::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest} or an equivalent Hash.
909
+ #
910
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest, ::Hash]
911
+ # A request object representing the call parameters. Required. To specify no
912
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
913
+ # @param options [::Gapic::CallOptions, ::Hash]
914
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
915
+ #
916
+ # @overload export_flow(name: nil, flow_uri: nil, include_referenced_flows: nil)
917
+ # Pass arguments to `export_flow` via keyword arguments. Note that at
918
+ # least one keyword argument is required. To specify no parameters, or to keep all
919
+ # the default parameter values, pass an empty Hash as a request object (see above).
920
+ #
921
+ # @param name [::String]
922
+ # Required. The name of the flow to export.
923
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
924
+ # ID>/flows/<Flow ID>`.
925
+ # @param flow_uri [::String]
926
+ # Optional. The [Google Cloud Storage](https://cloud.google.com/storage/docs/) URI to
927
+ # export the flow to. The format of this URI must be
928
+ # `gs://<bucket-name>/<object-name>`.
929
+ # If left unspecified, the serialized flow is returned inline.
930
+ # @param include_referenced_flows [::Boolean]
931
+ # Optional. Whether to export flows referenced by the specified flow.
932
+ #
933
+ # @yield [response, operation] Access the result along with the RPC operation
934
+ # @yieldparam response [::Gapic::Operation]
935
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
936
+ #
937
+ # @return [::Gapic::Operation]
938
+ #
939
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
940
+ #
941
+ def export_flow request, options = nil
942
+ raise ::ArgumentError, "request must be provided" if request.nil?
943
+
944
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest
945
+
946
+ # Converts hash and nil to an options object
947
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
948
+
949
+ # Customize the options with defaults
950
+ metadata = @config.rpcs.export_flow.metadata.to_h
951
+
952
+ # Set x-goog-api-client and x-goog-user-project headers
953
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
954
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
955
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
956
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
957
+
958
+ header_params = {
959
+ "name" => request.name
960
+ }
961
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
962
+ metadata[:"x-goog-request-params"] ||= request_params_header
963
+
964
+ options.apply_defaults timeout: @config.rpcs.export_flow.timeout,
965
+ metadata: metadata,
966
+ retry_policy: @config.rpcs.export_flow.retry_policy
967
+
968
+ options.apply_defaults timeout: @config.timeout,
969
+ metadata: @config.metadata,
970
+ retry_policy: @config.retry_policy
971
+
972
+ @flows_stub.call_rpc :export_flow, request, options: options do |response, operation|
973
+ response = ::Gapic::Operation.new response, @operations_client, options: options
974
+ yield response, operation if block_given?
975
+ return response
976
+ end
977
+ rescue ::GRPC::BadStatus => e
978
+ raise ::Google::Cloud::Error.from_error(e)
979
+ end
980
+
981
+ ##
982
+ # Configuration class for the Flows API.
983
+ #
984
+ # This class represents the configuration for Flows,
985
+ # providing control over timeouts, retry behavior, logging, transport
986
+ # parameters, and other low-level controls. Certain parameters can also be
987
+ # applied individually to specific RPCs. See
988
+ # {::Google::Cloud::Dialogflow::CX::V3::Flows::Client::Configuration::Rpcs}
989
+ # for a list of RPCs that can be configured independently.
990
+ #
991
+ # Configuration can be applied globally to all clients, or to a single client
992
+ # on construction.
993
+ #
994
+ # @example
995
+ #
996
+ # # Modify the global config, setting the timeout for
997
+ # # create_flow to 20 seconds,
998
+ # # and all remaining timeouts to 10 seconds.
999
+ # ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.configure do |config|
1000
+ # config.timeout = 10.0
1001
+ # config.rpcs.create_flow.timeout = 20.0
1002
+ # end
1003
+ #
1004
+ # # Apply the above configuration only to a new client.
1005
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Flows::Client.new do |config|
1006
+ # config.timeout = 10.0
1007
+ # config.rpcs.create_flow.timeout = 20.0
1008
+ # end
1009
+ #
1010
+ # @!attribute [rw] endpoint
1011
+ # The hostname or hostname:port of the service endpoint.
1012
+ # Defaults to `"dialogflow.googleapis.com"`.
1013
+ # @return [::String]
1014
+ # @!attribute [rw] credentials
1015
+ # Credentials to send with calls. You may provide any of the following types:
1016
+ # * (`String`) The path to a service account key file in JSON format
1017
+ # * (`Hash`) A service account key as a Hash
1018
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1019
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1020
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1021
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1022
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1023
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1024
+ # * (`nil`) indicating no credentials
1025
+ # @return [::Object]
1026
+ # @!attribute [rw] scope
1027
+ # The OAuth scopes
1028
+ # @return [::Array<::String>]
1029
+ # @!attribute [rw] lib_name
1030
+ # The library name as recorded in instrumentation and logging
1031
+ # @return [::String]
1032
+ # @!attribute [rw] lib_version
1033
+ # The library version as recorded in instrumentation and logging
1034
+ # @return [::String]
1035
+ # @!attribute [rw] channel_args
1036
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1037
+ # `GRPC::Core::Channel` object is provided as the credential.
1038
+ # @return [::Hash]
1039
+ # @!attribute [rw] interceptors
1040
+ # An array of interceptors that are run before calls are executed.
1041
+ # @return [::Array<::GRPC::ClientInterceptor>]
1042
+ # @!attribute [rw] timeout
1043
+ # The call timeout in seconds.
1044
+ # @return [::Numeric]
1045
+ # @!attribute [rw] metadata
1046
+ # Additional gRPC headers to be sent with the call.
1047
+ # @return [::Hash{::Symbol=>::String}]
1048
+ # @!attribute [rw] retry_policy
1049
+ # The retry policy. The value is a hash with the following keys:
1050
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1051
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1052
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1053
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1054
+ # trigger a retry.
1055
+ # @return [::Hash]
1056
+ # @!attribute [rw] quota_project
1057
+ # A separate project against which to charge quota.
1058
+ # @return [::String]
1059
+ #
1060
+ class Configuration
1061
+ extend ::Gapic::Config
1062
+
1063
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
1064
+ config_attr :credentials, nil do |value|
1065
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1066
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1067
+ allowed.any? { |klass| klass === value }
1068
+ end
1069
+ config_attr :scope, nil, ::String, ::Array, nil
1070
+ config_attr :lib_name, nil, ::String, nil
1071
+ config_attr :lib_version, nil, ::String, nil
1072
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1073
+ config_attr :interceptors, nil, ::Array, nil
1074
+ config_attr :timeout, nil, ::Numeric, nil
1075
+ config_attr :metadata, nil, ::Hash, nil
1076
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1077
+ config_attr :quota_project, nil, ::String, nil
1078
+
1079
+ # @private
1080
+ def initialize parent_config = nil
1081
+ @parent_config = parent_config unless parent_config.nil?
1082
+
1083
+ yield self if block_given?
1084
+ end
1085
+
1086
+ ##
1087
+ # Configurations for individual RPCs
1088
+ # @return [Rpcs]
1089
+ #
1090
+ def rpcs
1091
+ @rpcs ||= begin
1092
+ parent_rpcs = nil
1093
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1094
+ Rpcs.new parent_rpcs
1095
+ end
1096
+ end
1097
+
1098
+ ##
1099
+ # Configuration RPC class for the Flows API.
1100
+ #
1101
+ # Includes fields providing the configuration for each RPC in this service.
1102
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1103
+ # the following configuration fields:
1104
+ #
1105
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1106
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1107
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1108
+ # include the following keys:
1109
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1110
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1111
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1112
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1113
+ # trigger a retry.
1114
+ #
1115
+ class Rpcs
1116
+ ##
1117
+ # RPC-specific configuration for `create_flow`
1118
+ # @return [::Gapic::Config::Method]
1119
+ #
1120
+ attr_reader :create_flow
1121
+ ##
1122
+ # RPC-specific configuration for `delete_flow`
1123
+ # @return [::Gapic::Config::Method]
1124
+ #
1125
+ attr_reader :delete_flow
1126
+ ##
1127
+ # RPC-specific configuration for `list_flows`
1128
+ # @return [::Gapic::Config::Method]
1129
+ #
1130
+ attr_reader :list_flows
1131
+ ##
1132
+ # RPC-specific configuration for `get_flow`
1133
+ # @return [::Gapic::Config::Method]
1134
+ #
1135
+ attr_reader :get_flow
1136
+ ##
1137
+ # RPC-specific configuration for `update_flow`
1138
+ # @return [::Gapic::Config::Method]
1139
+ #
1140
+ attr_reader :update_flow
1141
+ ##
1142
+ # RPC-specific configuration for `train_flow`
1143
+ # @return [::Gapic::Config::Method]
1144
+ #
1145
+ attr_reader :train_flow
1146
+ ##
1147
+ # RPC-specific configuration for `validate_flow`
1148
+ # @return [::Gapic::Config::Method]
1149
+ #
1150
+ attr_reader :validate_flow
1151
+ ##
1152
+ # RPC-specific configuration for `get_flow_validation_result`
1153
+ # @return [::Gapic::Config::Method]
1154
+ #
1155
+ attr_reader :get_flow_validation_result
1156
+ ##
1157
+ # RPC-specific configuration for `import_flow`
1158
+ # @return [::Gapic::Config::Method]
1159
+ #
1160
+ attr_reader :import_flow
1161
+ ##
1162
+ # RPC-specific configuration for `export_flow`
1163
+ # @return [::Gapic::Config::Method]
1164
+ #
1165
+ attr_reader :export_flow
1166
+
1167
+ # @private
1168
+ def initialize parent_rpcs = nil
1169
+ create_flow_config = parent_rpcs.create_flow if parent_rpcs.respond_to? :create_flow
1170
+ @create_flow = ::Gapic::Config::Method.new create_flow_config
1171
+ delete_flow_config = parent_rpcs.delete_flow if parent_rpcs.respond_to? :delete_flow
1172
+ @delete_flow = ::Gapic::Config::Method.new delete_flow_config
1173
+ list_flows_config = parent_rpcs.list_flows if parent_rpcs.respond_to? :list_flows
1174
+ @list_flows = ::Gapic::Config::Method.new list_flows_config
1175
+ get_flow_config = parent_rpcs.get_flow if parent_rpcs.respond_to? :get_flow
1176
+ @get_flow = ::Gapic::Config::Method.new get_flow_config
1177
+ update_flow_config = parent_rpcs.update_flow if parent_rpcs.respond_to? :update_flow
1178
+ @update_flow = ::Gapic::Config::Method.new update_flow_config
1179
+ train_flow_config = parent_rpcs.train_flow if parent_rpcs.respond_to? :train_flow
1180
+ @train_flow = ::Gapic::Config::Method.new train_flow_config
1181
+ validate_flow_config = parent_rpcs.validate_flow if parent_rpcs.respond_to? :validate_flow
1182
+ @validate_flow = ::Gapic::Config::Method.new validate_flow_config
1183
+ get_flow_validation_result_config = parent_rpcs.get_flow_validation_result if parent_rpcs.respond_to? :get_flow_validation_result
1184
+ @get_flow_validation_result = ::Gapic::Config::Method.new get_flow_validation_result_config
1185
+ import_flow_config = parent_rpcs.import_flow if parent_rpcs.respond_to? :import_flow
1186
+ @import_flow = ::Gapic::Config::Method.new import_flow_config
1187
+ export_flow_config = parent_rpcs.export_flow if parent_rpcs.respond_to? :export_flow
1188
+ @export_flow = ::Gapic::Config::Method.new export_flow_config
1189
+
1190
+ yield self if block_given?
1191
+ end
1192
+ end
1193
+ end
1194
+ end
1195
+ end
1196
+ end
1197
+ end
1198
+ end
1199
+ end
1200
+ end