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 Intents
27
+ # Credentials for the Intents 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,96 @@
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 Intents
26
+ # Path helper methods for the Intents API.
27
+ module Paths
28
+ ##
29
+ # Create a fully-qualified Agent resource string.
30
+ #
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/agents/{agent}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param agent [String]
38
+ #
39
+ # @return [::String]
40
+ def agent_path project:, location:, agent:
41
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
+
44
+ "projects/#{project}/locations/#{location}/agents/#{agent}"
45
+ end
46
+
47
+ ##
48
+ # Create a fully-qualified EntityType resource string.
49
+ #
50
+ # The resource will be in the following format:
51
+ #
52
+ # `projects/{project}/locations/{location}/agents/{agent}/entityTypes/{entity_type}`
53
+ #
54
+ # @param project [String]
55
+ # @param location [String]
56
+ # @param agent [String]
57
+ # @param entity_type [String]
58
+ #
59
+ # @return [::String]
60
+ def entity_type_path project:, location:, agent:, entity_type:
61
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
62
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
63
+ raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
64
+
65
+ "projects/#{project}/locations/#{location}/agents/#{agent}/entityTypes/#{entity_type}"
66
+ end
67
+
68
+ ##
69
+ # Create a fully-qualified Intent resource string.
70
+ #
71
+ # The resource will be in the following format:
72
+ #
73
+ # `projects/{project}/locations/{location}/agents/{agent}/intents/{intent}`
74
+ #
75
+ # @param project [String]
76
+ # @param location [String]
77
+ # @param agent [String]
78
+ # @param intent [String]
79
+ #
80
+ # @return [::String]
81
+ def intent_path project:, location:, agent:, intent:
82
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
83
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
84
+ raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
85
+
86
+ "projects/#{project}/locations/#{location}/agents/#{agent}/intents/#{intent}"
87
+ end
88
+
89
+ extend self
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
96
+ 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/intents/credentials"
26
+ require "google/cloud/dialogflow/cx/v3/intents/paths"
27
+ require "google/cloud/dialogflow/cx/v3/intents/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::Intent Intents}.
36
+ #
37
+ # To load this service and instantiate a client:
38
+ #
39
+ # require "google/cloud/dialogflow/cx/v3/intents"
40
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Intents::Client.new
41
+ #
42
+ module Intents
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ helper_path = ::File.join __dir__, "intents", "helpers.rb"
51
+ require "google/cloud/dialogflow/cx/v3/intents/helpers" if ::File.file? helper_path
@@ -0,0 +1,113 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/dialogflow/cx/v3/page.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/fulfillment_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/page.proto", :syntax => :proto3) do
17
+ add_message "google.cloud.dialogflow.cx.v3.Page" do
18
+ optional :name, :string, 1
19
+ optional :display_name, :string, 2
20
+ optional :entry_fulfillment, :message, 7, "google.cloud.dialogflow.cx.v3.Fulfillment"
21
+ optional :form, :message, 4, "google.cloud.dialogflow.cx.v3.Form"
22
+ repeated :transition_route_groups, :string, 11
23
+ repeated :transition_routes, :message, 9, "google.cloud.dialogflow.cx.v3.TransitionRoute"
24
+ repeated :event_handlers, :message, 10, "google.cloud.dialogflow.cx.v3.EventHandler"
25
+ end
26
+ add_message "google.cloud.dialogflow.cx.v3.Form" do
27
+ repeated :parameters, :message, 1, "google.cloud.dialogflow.cx.v3.Form.Parameter"
28
+ end
29
+ add_message "google.cloud.dialogflow.cx.v3.Form.Parameter" do
30
+ optional :display_name, :string, 1
31
+ optional :required, :bool, 2
32
+ optional :entity_type, :string, 3
33
+ optional :is_list, :bool, 4
34
+ optional :fill_behavior, :message, 7, "google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior"
35
+ optional :default_value, :message, 9, "google.protobuf.Value"
36
+ optional :redact, :bool, 11
37
+ end
38
+ add_message "google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior" do
39
+ optional :initial_prompt_fulfillment, :message, 3, "google.cloud.dialogflow.cx.v3.Fulfillment"
40
+ repeated :reprompt_event_handlers, :message, 5, "google.cloud.dialogflow.cx.v3.EventHandler"
41
+ end
42
+ add_message "google.cloud.dialogflow.cx.v3.EventHandler" do
43
+ optional :name, :string, 6
44
+ optional :event, :string, 4
45
+ optional :trigger_fulfillment, :message, 5, "google.cloud.dialogflow.cx.v3.Fulfillment"
46
+ oneof :target do
47
+ optional :target_page, :string, 2
48
+ optional :target_flow, :string, 3
49
+ end
50
+ end
51
+ add_message "google.cloud.dialogflow.cx.v3.TransitionRoute" do
52
+ optional :name, :string, 6
53
+ optional :intent, :string, 1
54
+ optional :condition, :string, 2
55
+ optional :trigger_fulfillment, :message, 3, "google.cloud.dialogflow.cx.v3.Fulfillment"
56
+ oneof :target do
57
+ optional :target_page, :string, 4
58
+ optional :target_flow, :string, 5
59
+ end
60
+ end
61
+ add_message "google.cloud.dialogflow.cx.v3.ListPagesRequest" do
62
+ optional :parent, :string, 1
63
+ optional :language_code, :string, 2
64
+ optional :page_size, :int32, 3
65
+ optional :page_token, :string, 4
66
+ end
67
+ add_message "google.cloud.dialogflow.cx.v3.ListPagesResponse" do
68
+ repeated :pages, :message, 1, "google.cloud.dialogflow.cx.v3.Page"
69
+ optional :next_page_token, :string, 2
70
+ end
71
+ add_message "google.cloud.dialogflow.cx.v3.GetPageRequest" do
72
+ optional :name, :string, 1
73
+ optional :language_code, :string, 2
74
+ end
75
+ add_message "google.cloud.dialogflow.cx.v3.CreatePageRequest" do
76
+ optional :parent, :string, 1
77
+ optional :page, :message, 2, "google.cloud.dialogflow.cx.v3.Page"
78
+ optional :language_code, :string, 3
79
+ end
80
+ add_message "google.cloud.dialogflow.cx.v3.UpdatePageRequest" do
81
+ optional :page, :message, 1, "google.cloud.dialogflow.cx.v3.Page"
82
+ optional :language_code, :string, 2
83
+ optional :update_mask, :message, 3, "google.protobuf.FieldMask"
84
+ end
85
+ add_message "google.cloud.dialogflow.cx.v3.DeletePageRequest" do
86
+ optional :name, :string, 1
87
+ optional :force, :bool, 2
88
+ end
89
+ end
90
+ end
91
+
92
+ module Google
93
+ module Cloud
94
+ module Dialogflow
95
+ module CX
96
+ module V3
97
+ Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Page").msgclass
98
+ Form = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form").msgclass
99
+ Form::Parameter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form.Parameter").msgclass
100
+ Form::Parameter::FillBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Form.Parameter.FillBehavior").msgclass
101
+ EventHandler = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.EventHandler").msgclass
102
+ TransitionRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.TransitionRoute").msgclass
103
+ ListPagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPagesRequest").msgclass
104
+ ListPagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListPagesResponse").msgclass
105
+ GetPageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetPageRequest").msgclass
106
+ CreatePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreatePageRequest").msgclass
107
+ UpdatePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdatePageRequest").msgclass
108
+ DeletePageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeletePageRequest").msgclass
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,67 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/dialogflow/cx/v3/page.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/page_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module Pages
28
+ # Service for managing [Pages][google.cloud.dialogflow.cx.v3.Page].
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.Pages'
36
+
37
+ # Returns the list of all pages in the specified flow.
38
+ rpc :ListPages, ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::Google::Cloud::Dialogflow::CX::V3::ListPagesResponse
39
+ # Retrieves the specified page.
40
+ rpc :GetPage, ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page
41
+ # Creates a page in the specified flow.
42
+ #
43
+ # Note: You should always train a flow prior to sending it queries. See the
44
+ # [training
45
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
46
+ rpc :CreatePage, ::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page
47
+ # Updates the specified page.
48
+ #
49
+ # Note: You should always train a flow prior to sending it queries. See the
50
+ # [training
51
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
52
+ rpc :UpdatePage, ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Google::Cloud::Dialogflow::CX::V3::Page
53
+ # Deletes the specified page.
54
+ #
55
+ # Note: You should always train a flow prior to sending it queries. See the
56
+ # [training
57
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
58
+ rpc :DeletePage, ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Google::Protobuf::Empty
59
+ end
60
+
61
+ Stub = Service.rpc_stub_class
62
+ end
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,805 @@
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/page_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module CX
26
+ module V3
27
+ module Pages
28
+ ##
29
+ # Client for the Pages service.
30
+ #
31
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Page Pages}.
32
+ #
33
+ class Client
34
+ include Paths
35
+
36
+ # @private
37
+ attr_reader :pages_stub
38
+
39
+ ##
40
+ # Configure the Pages Client class.
41
+ #
42
+ # See {::Google::Cloud::Dialogflow::CX::V3::Pages::Client::Configuration}
43
+ # for a description of the configuration fields.
44
+ #
45
+ # @example
46
+ #
47
+ # # Modify the configuration for all Pages clients
48
+ # ::Google::Cloud::Dialogflow::CX::V3::Pages::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 Pages 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::Pages::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 Pages client object.
101
+ #
102
+ # @example
103
+ #
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new
106
+ #
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the Pages 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/page_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
+ @pages_stub = ::Gapic::ServiceStub.new(
143
+ ::Google::Cloud::Dialogflow::CX::V3::Pages::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 pages in the specified flow.
155
+ #
156
+ # @overload list_pages(request, options = nil)
157
+ # Pass arguments to `list_pages` via a request object, either of type
158
+ # {::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest} or an equivalent Hash.
159
+ #
160
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest, ::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_pages(parent: nil, language_code: nil, page_size: nil, page_token: nil)
167
+ # Pass arguments to `list_pages` 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 flow to list all pages for.
173
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
174
+ # ID>/flows/<Flow ID>`.
175
+ # @param language_code [::String]
176
+ # The language to list pages for. The following fields are language
177
+ # dependent:
178
+ #
179
+ # * `Page.entry_fulfillment.messages`
180
+ # * `Page.entry_fulfillment.conditional_cases`
181
+ # * `Page.event_handlers.trigger_fulfillment.messages`
182
+ # * `Page.event_handlers.trigger_fulfillment.conditional_cases`
183
+ # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
184
+ # *
185
+ # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
186
+ # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
187
+ # *
188
+ # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
189
+ # * `Page.transition_routes.trigger_fulfillment.messages`
190
+ # * `Page.transition_routes.trigger_fulfillment.conditional_cases`
191
+ #
192
+ # If not specified, the agent's default language is used.
193
+ # [Many
194
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
195
+ # are supported.
196
+ # Note: languages must be enabled in the agent before they can be used.
197
+ # @param page_size [::Integer]
198
+ # The maximum number of items to return in a single page. By default 100 and
199
+ # at most 1000.
200
+ # @param page_token [::String]
201
+ # The next_page_token value returned from a previous list request.
202
+ #
203
+ # @yield [response, operation] Access the result along with the RPC operation
204
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>]
205
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
206
+ #
207
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Page>]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
210
+ #
211
+ def list_pages request, options = nil
212
+ raise ::ArgumentError, "request must be provided" if request.nil?
213
+
214
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListPagesRequest
215
+
216
+ # Converts hash and nil to an options object
217
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
218
+
219
+ # Customize the options with defaults
220
+ metadata = @config.rpcs.list_pages.metadata.to_h
221
+
222
+ # Set x-goog-api-client and x-goog-user-project headers
223
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
224
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
225
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
226
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
227
+
228
+ header_params = {
229
+ "parent" => request.parent
230
+ }
231
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
232
+ metadata[:"x-goog-request-params"] ||= request_params_header
233
+
234
+ options.apply_defaults timeout: @config.rpcs.list_pages.timeout,
235
+ metadata: metadata,
236
+ retry_policy: @config.rpcs.list_pages.retry_policy
237
+
238
+ options.apply_defaults timeout: @config.timeout,
239
+ metadata: @config.metadata,
240
+ retry_policy: @config.retry_policy
241
+
242
+ @pages_stub.call_rpc :list_pages, request, options: options do |response, operation|
243
+ response = ::Gapic::PagedEnumerable.new @pages_stub, :list_pages, request, response, operation, options
244
+ yield response, operation if block_given?
245
+ return response
246
+ end
247
+ rescue ::GRPC::BadStatus => e
248
+ raise ::Google::Cloud::Error.from_error(e)
249
+ end
250
+
251
+ ##
252
+ # Retrieves the specified page.
253
+ #
254
+ # @overload get_page(request, options = nil)
255
+ # Pass arguments to `get_page` via a request object, either of type
256
+ # {::Google::Cloud::Dialogflow::CX::V3::GetPageRequest} or an equivalent Hash.
257
+ #
258
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetPageRequest, ::Hash]
259
+ # A request object representing the call parameters. Required. To specify no
260
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
261
+ # @param options [::Gapic::CallOptions, ::Hash]
262
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
263
+ #
264
+ # @overload get_page(name: nil, language_code: nil)
265
+ # Pass arguments to `get_page` via keyword arguments. Note that at
266
+ # least one keyword argument is required. To specify no parameters, or to keep all
267
+ # the default parameter values, pass an empty Hash as a request object (see above).
268
+ #
269
+ # @param name [::String]
270
+ # Required. The name of the page.
271
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
272
+ # ID>/flows/<Flow ID>/pages/<Page ID>`.
273
+ # @param language_code [::String]
274
+ # The language to retrieve the page for. The following fields are language
275
+ # dependent:
276
+ #
277
+ # * `Page.entry_fulfillment.messages`
278
+ # * `Page.entry_fulfillment.conditional_cases`
279
+ # * `Page.event_handlers.trigger_fulfillment.messages`
280
+ # * `Page.event_handlers.trigger_fulfillment.conditional_cases`
281
+ # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
282
+ # *
283
+ # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
284
+ # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
285
+ # *
286
+ # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
287
+ # * `Page.transition_routes.trigger_fulfillment.messages`
288
+ # * `Page.transition_routes.trigger_fulfillment.conditional_cases`
289
+ #
290
+ # If not specified, the agent's default language is used.
291
+ # [Many
292
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
293
+ # are supported.
294
+ # Note: languages must be enabled in the agent before they can be used.
295
+ #
296
+ # @yield [response, operation] Access the result along with the RPC operation
297
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Page]
298
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
299
+ #
300
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Page]
301
+ #
302
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
303
+ #
304
+ def get_page request, options = nil
305
+ raise ::ArgumentError, "request must be provided" if request.nil?
306
+
307
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetPageRequest
308
+
309
+ # Converts hash and nil to an options object
310
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
311
+
312
+ # Customize the options with defaults
313
+ metadata = @config.rpcs.get_page.metadata.to_h
314
+
315
+ # Set x-goog-api-client and x-goog-user-project headers
316
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
317
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
318
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
319
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
320
+
321
+ header_params = {
322
+ "name" => request.name
323
+ }
324
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
325
+ metadata[:"x-goog-request-params"] ||= request_params_header
326
+
327
+ options.apply_defaults timeout: @config.rpcs.get_page.timeout,
328
+ metadata: metadata,
329
+ retry_policy: @config.rpcs.get_page.retry_policy
330
+
331
+ options.apply_defaults timeout: @config.timeout,
332
+ metadata: @config.metadata,
333
+ retry_policy: @config.retry_policy
334
+
335
+ @pages_stub.call_rpc :get_page, request, options: options do |response, operation|
336
+ yield response, operation if block_given?
337
+ return response
338
+ end
339
+ rescue ::GRPC::BadStatus => e
340
+ raise ::Google::Cloud::Error.from_error(e)
341
+ end
342
+
343
+ ##
344
+ # Creates a page in the specified flow.
345
+ #
346
+ # Note: You should always train a flow prior to sending it queries. See the
347
+ # [training
348
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
349
+ #
350
+ # @overload create_page(request, options = nil)
351
+ # Pass arguments to `create_page` via a request object, either of type
352
+ # {::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest} or an equivalent Hash.
353
+ #
354
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::CreatePageRequest, ::Hash]
355
+ # A request object representing the call parameters. Required. To specify no
356
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
357
+ # @param options [::Gapic::CallOptions, ::Hash]
358
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
359
+ #
360
+ # @overload create_page(parent: nil, page: nil, language_code: nil)
361
+ # Pass arguments to `create_page` via keyword arguments. Note that at
362
+ # least one keyword argument is required. To specify no parameters, or to keep all
363
+ # the default parameter values, pass an empty Hash as a request object (see above).
364
+ #
365
+ # @param parent [::String]
366
+ # Required. The flow to create a page for.
367
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
368
+ # ID>/flows/<Flow ID>`.
369
+ # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash]
370
+ # Required. The page to create.
371
+ # @param language_code [::String]
372
+ # The language of the following fields in `page`:
373
+ #
374
+ # * `Page.entry_fulfillment.messages`
375
+ # * `Page.entry_fulfillment.conditional_cases`
376
+ # * `Page.event_handlers.trigger_fulfillment.messages`
377
+ # * `Page.event_handlers.trigger_fulfillment.conditional_cases`
378
+ # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
379
+ # *
380
+ # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
381
+ # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
382
+ # *
383
+ # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
384
+ # * `Page.transition_routes.trigger_fulfillment.messages`
385
+ # * `Page.transition_routes.trigger_fulfillment.conditional_cases`
386
+ #
387
+ # If not specified, the agent's default language is used.
388
+ # [Many
389
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
390
+ # are supported.
391
+ # Note: languages must be enabled in the agent before they can be used.
392
+ #
393
+ # @yield [response, operation] Access the result along with the RPC operation
394
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Page]
395
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
396
+ #
397
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Page]
398
+ #
399
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
400
+ #
401
+ def create_page 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::CreatePageRequest
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.create_page.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
+ "parent" => request.parent
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.create_page.timeout,
425
+ metadata: metadata,
426
+ retry_policy: @config.rpcs.create_page.retry_policy
427
+
428
+ options.apply_defaults timeout: @config.timeout,
429
+ metadata: @config.metadata,
430
+ retry_policy: @config.retry_policy
431
+
432
+ @pages_stub.call_rpc :create_page, 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
+ # Updates the specified page.
442
+ #
443
+ # Note: You should always train a flow prior to sending it queries. See the
444
+ # [training
445
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
446
+ #
447
+ # @overload update_page(request, options = nil)
448
+ # Pass arguments to `update_page` via a request object, either of type
449
+ # {::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest} or an equivalent Hash.
450
+ #
451
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest, ::Hash]
452
+ # A request object representing the call parameters. Required. To specify no
453
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
454
+ # @param options [::Gapic::CallOptions, ::Hash]
455
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
456
+ #
457
+ # @overload update_page(page: nil, language_code: nil, update_mask: nil)
458
+ # Pass arguments to `update_page` via keyword arguments. Note that at
459
+ # least one keyword argument is required. To specify no parameters, or to keep all
460
+ # the default parameter values, pass an empty Hash as a request object (see above).
461
+ #
462
+ # @param page [::Google::Cloud::Dialogflow::CX::V3::Page, ::Hash]
463
+ # Required. The page to update.
464
+ # @param language_code [::String]
465
+ # The language of the following fields in `page`:
466
+ #
467
+ # * `Page.entry_fulfillment.messages`
468
+ # * `Page.entry_fulfillment.conditional_cases`
469
+ # * `Page.event_handlers.trigger_fulfillment.messages`
470
+ # * `Page.event_handlers.trigger_fulfillment.conditional_cases`
471
+ # * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages`
472
+ # *
473
+ # `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_cases`
474
+ # * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages`
475
+ # *
476
+ # `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases`
477
+ # * `Page.transition_routes.trigger_fulfillment.messages`
478
+ # * `Page.transition_routes.trigger_fulfillment.conditional_cases`
479
+ #
480
+ # If not specified, the agent's default language is used.
481
+ # [Many
482
+ # languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
483
+ # are supported.
484
+ # Note: languages must be enabled in the agent before they can be used.
485
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
486
+ # The mask to control which fields get updated. If the mask is not present,
487
+ # all fields will be updated.
488
+ #
489
+ # @yield [response, operation] Access the result along with the RPC operation
490
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::Page]
491
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
492
+ #
493
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Page]
494
+ #
495
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
496
+ #
497
+ def update_page request, options = nil
498
+ raise ::ArgumentError, "request must be provided" if request.nil?
499
+
500
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest
501
+
502
+ # Converts hash and nil to an options object
503
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
504
+
505
+ # Customize the options with defaults
506
+ metadata = @config.rpcs.update_page.metadata.to_h
507
+
508
+ # Set x-goog-api-client and x-goog-user-project headers
509
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
510
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
511
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
512
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
513
+
514
+ header_params = {
515
+ "page.name" => request.page.name
516
+ }
517
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
518
+ metadata[:"x-goog-request-params"] ||= request_params_header
519
+
520
+ options.apply_defaults timeout: @config.rpcs.update_page.timeout,
521
+ metadata: metadata,
522
+ retry_policy: @config.rpcs.update_page.retry_policy
523
+
524
+ options.apply_defaults timeout: @config.timeout,
525
+ metadata: @config.metadata,
526
+ retry_policy: @config.retry_policy
527
+
528
+ @pages_stub.call_rpc :update_page, request, options: options do |response, operation|
529
+ yield response, operation if block_given?
530
+ return response
531
+ end
532
+ rescue ::GRPC::BadStatus => e
533
+ raise ::Google::Cloud::Error.from_error(e)
534
+ end
535
+
536
+ ##
537
+ # Deletes the specified page.
538
+ #
539
+ # Note: You should always train a flow prior to sending it queries. See the
540
+ # [training
541
+ # documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
542
+ #
543
+ # @overload delete_page(request, options = nil)
544
+ # Pass arguments to `delete_page` via a request object, either of type
545
+ # {::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest} or an equivalent Hash.
546
+ #
547
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest, ::Hash]
548
+ # A request object representing the call parameters. Required. To specify no
549
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
550
+ # @param options [::Gapic::CallOptions, ::Hash]
551
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
552
+ #
553
+ # @overload delete_page(name: nil, force: nil)
554
+ # Pass arguments to `delete_page` via keyword arguments. Note that at
555
+ # least one keyword argument is required. To specify no parameters, or to keep all
556
+ # the default parameter values, pass an empty Hash as a request object (see above).
557
+ #
558
+ # @param name [::String]
559
+ # Required. The name of the page to delete.
560
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
561
+ # ID>/Flows/<flow ID>/pages/<Page ID>`.
562
+ # @param force [::Boolean]
563
+ # This field has no effect for pages with no incoming transitions.
564
+ # For pages with incoming transitions:
565
+ #
566
+ # * If `force` is set to false, an error will be returned with message
567
+ # indicating the incoming transitions.
568
+ # * If `force` is set to true, Dialogflow will remove the page, as well as
569
+ # any transitions to the page (i.e. [Target
570
+ # page][EventHandler.target_page] in event handlers or [Target
571
+ # page][TransitionRoute.target_page] in transition routes that point to
572
+ # this page will be cleared).
573
+ #
574
+ # @yield [response, operation] Access the result along with the RPC operation
575
+ # @yieldparam response [::Google::Protobuf::Empty]
576
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
577
+ #
578
+ # @return [::Google::Protobuf::Empty]
579
+ #
580
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
581
+ #
582
+ def delete_page request, options = nil
583
+ raise ::ArgumentError, "request must be provided" if request.nil?
584
+
585
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeletePageRequest
586
+
587
+ # Converts hash and nil to an options object
588
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
589
+
590
+ # Customize the options with defaults
591
+ metadata = @config.rpcs.delete_page.metadata.to_h
592
+
593
+ # Set x-goog-api-client and x-goog-user-project headers
594
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
595
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
596
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
597
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
598
+
599
+ header_params = {
600
+ "name" => request.name
601
+ }
602
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
603
+ metadata[:"x-goog-request-params"] ||= request_params_header
604
+
605
+ options.apply_defaults timeout: @config.rpcs.delete_page.timeout,
606
+ metadata: metadata,
607
+ retry_policy: @config.rpcs.delete_page.retry_policy
608
+
609
+ options.apply_defaults timeout: @config.timeout,
610
+ metadata: @config.metadata,
611
+ retry_policy: @config.retry_policy
612
+
613
+ @pages_stub.call_rpc :delete_page, request, options: options do |response, operation|
614
+ yield response, operation if block_given?
615
+ return response
616
+ end
617
+ rescue ::GRPC::BadStatus => e
618
+ raise ::Google::Cloud::Error.from_error(e)
619
+ end
620
+
621
+ ##
622
+ # Configuration class for the Pages API.
623
+ #
624
+ # This class represents the configuration for Pages,
625
+ # providing control over timeouts, retry behavior, logging, transport
626
+ # parameters, and other low-level controls. Certain parameters can also be
627
+ # applied individually to specific RPCs. See
628
+ # {::Google::Cloud::Dialogflow::CX::V3::Pages::Client::Configuration::Rpcs}
629
+ # for a list of RPCs that can be configured independently.
630
+ #
631
+ # Configuration can be applied globally to all clients, or to a single client
632
+ # on construction.
633
+ #
634
+ # @example
635
+ #
636
+ # # Modify the global config, setting the timeout for
637
+ # # list_pages to 20 seconds,
638
+ # # and all remaining timeouts to 10 seconds.
639
+ # ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.configure do |config|
640
+ # config.timeout = 10.0
641
+ # config.rpcs.list_pages.timeout = 20.0
642
+ # end
643
+ #
644
+ # # Apply the above configuration only to a new client.
645
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Pages::Client.new do |config|
646
+ # config.timeout = 10.0
647
+ # config.rpcs.list_pages.timeout = 20.0
648
+ # end
649
+ #
650
+ # @!attribute [rw] endpoint
651
+ # The hostname or hostname:port of the service endpoint.
652
+ # Defaults to `"dialogflow.googleapis.com"`.
653
+ # @return [::String]
654
+ # @!attribute [rw] credentials
655
+ # Credentials to send with calls. You may provide any of the following types:
656
+ # * (`String`) The path to a service account key file in JSON format
657
+ # * (`Hash`) A service account key as a Hash
658
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
659
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
660
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
661
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
662
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
663
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
664
+ # * (`nil`) indicating no credentials
665
+ # @return [::Object]
666
+ # @!attribute [rw] scope
667
+ # The OAuth scopes
668
+ # @return [::Array<::String>]
669
+ # @!attribute [rw] lib_name
670
+ # The library name as recorded in instrumentation and logging
671
+ # @return [::String]
672
+ # @!attribute [rw] lib_version
673
+ # The library version as recorded in instrumentation and logging
674
+ # @return [::String]
675
+ # @!attribute [rw] channel_args
676
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
677
+ # `GRPC::Core::Channel` object is provided as the credential.
678
+ # @return [::Hash]
679
+ # @!attribute [rw] interceptors
680
+ # An array of interceptors that are run before calls are executed.
681
+ # @return [::Array<::GRPC::ClientInterceptor>]
682
+ # @!attribute [rw] timeout
683
+ # The call timeout in seconds.
684
+ # @return [::Numeric]
685
+ # @!attribute [rw] metadata
686
+ # Additional gRPC headers to be sent with the call.
687
+ # @return [::Hash{::Symbol=>::String}]
688
+ # @!attribute [rw] retry_policy
689
+ # The retry policy. The value is a hash with the following keys:
690
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
691
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
692
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
693
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
694
+ # trigger a retry.
695
+ # @return [::Hash]
696
+ # @!attribute [rw] quota_project
697
+ # A separate project against which to charge quota.
698
+ # @return [::String]
699
+ #
700
+ class Configuration
701
+ extend ::Gapic::Config
702
+
703
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
704
+ config_attr :credentials, nil do |value|
705
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
706
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
707
+ allowed.any? { |klass| klass === value }
708
+ end
709
+ config_attr :scope, nil, ::String, ::Array, nil
710
+ config_attr :lib_name, nil, ::String, nil
711
+ config_attr :lib_version, nil, ::String, nil
712
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
713
+ config_attr :interceptors, nil, ::Array, nil
714
+ config_attr :timeout, nil, ::Numeric, nil
715
+ config_attr :metadata, nil, ::Hash, nil
716
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
717
+ config_attr :quota_project, nil, ::String, nil
718
+
719
+ # @private
720
+ def initialize parent_config = nil
721
+ @parent_config = parent_config unless parent_config.nil?
722
+
723
+ yield self if block_given?
724
+ end
725
+
726
+ ##
727
+ # Configurations for individual RPCs
728
+ # @return [Rpcs]
729
+ #
730
+ def rpcs
731
+ @rpcs ||= begin
732
+ parent_rpcs = nil
733
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
734
+ Rpcs.new parent_rpcs
735
+ end
736
+ end
737
+
738
+ ##
739
+ # Configuration RPC class for the Pages API.
740
+ #
741
+ # Includes fields providing the configuration for each RPC in this service.
742
+ # Each configuration object is of type `Gapic::Config::Method` and includes
743
+ # the following configuration fields:
744
+ #
745
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
746
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
747
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
748
+ # include the following keys:
749
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
750
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
751
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
752
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
753
+ # trigger a retry.
754
+ #
755
+ class Rpcs
756
+ ##
757
+ # RPC-specific configuration for `list_pages`
758
+ # @return [::Gapic::Config::Method]
759
+ #
760
+ attr_reader :list_pages
761
+ ##
762
+ # RPC-specific configuration for `get_page`
763
+ # @return [::Gapic::Config::Method]
764
+ #
765
+ attr_reader :get_page
766
+ ##
767
+ # RPC-specific configuration for `create_page`
768
+ # @return [::Gapic::Config::Method]
769
+ #
770
+ attr_reader :create_page
771
+ ##
772
+ # RPC-specific configuration for `update_page`
773
+ # @return [::Gapic::Config::Method]
774
+ #
775
+ attr_reader :update_page
776
+ ##
777
+ # RPC-specific configuration for `delete_page`
778
+ # @return [::Gapic::Config::Method]
779
+ #
780
+ attr_reader :delete_page
781
+
782
+ # @private
783
+ def initialize parent_rpcs = nil
784
+ list_pages_config = parent_rpcs.list_pages if parent_rpcs.respond_to? :list_pages
785
+ @list_pages = ::Gapic::Config::Method.new list_pages_config
786
+ get_page_config = parent_rpcs.get_page if parent_rpcs.respond_to? :get_page
787
+ @get_page = ::Gapic::Config::Method.new get_page_config
788
+ create_page_config = parent_rpcs.create_page if parent_rpcs.respond_to? :create_page
789
+ @create_page = ::Gapic::Config::Method.new create_page_config
790
+ update_page_config = parent_rpcs.update_page if parent_rpcs.respond_to? :update_page
791
+ @update_page = ::Gapic::Config::Method.new update_page_config
792
+ delete_page_config = parent_rpcs.delete_page if parent_rpcs.respond_to? :delete_page
793
+ @delete_page = ::Gapic::Config::Method.new delete_page_config
794
+
795
+ yield self if block_given?
796
+ end
797
+ end
798
+ end
799
+ end
800
+ end
801
+ end
802
+ end
803
+ end
804
+ end
805
+ end