google-cloud-dialogflow-v2 0.6.2 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +188 -190
  3. data/README.md +70 -2
  4. data/lib/google/cloud/dialogflow/v2.rb +13 -2
  5. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +25 -40
  6. data/lib/google/cloud/dialogflow/v2/agents.rb +1 -28
  7. data/lib/google/cloud/dialogflow/v2/agents/client.rb +41 -100
  8. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +96 -11
  9. data/lib/google/cloud/dialogflow/v2/agents/paths.rb +42 -3
  10. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +100 -0
  11. data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +48 -0
  12. data/lib/google/cloud/dialogflow/v2/answer_records.rb +49 -0
  13. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +478 -0
  14. data/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb +52 -0
  15. data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +105 -0
  16. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +7 -0
  17. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +8 -25
  18. data/lib/google/cloud/dialogflow/v2/contexts.rb +1 -18
  19. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +24 -63
  20. data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +74 -2
  21. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +39 -0
  22. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +89 -0
  23. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +182 -0
  24. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +61 -0
  25. data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +49 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +699 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb +52 -0
  28. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +246 -0
  29. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +75 -0
  30. data/lib/google/cloud/dialogflow/v2/conversations.rb +49 -0
  31. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +757 -0
  32. data/lib/google/cloud/dialogflow/v2/conversations/credentials.rb +52 -0
  33. data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +146 -0
  34. data/lib/google/cloud/dialogflow/v2/document_pb.rb +99 -0
  35. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +73 -0
  36. data/lib/google/cloud/dialogflow/v2/documents.rb +50 -0
  37. data/lib/google/cloud/dialogflow/v2/documents/client.rb +810 -0
  38. data/lib/google/cloud/dialogflow/v2/documents/credentials.rb +52 -0
  39. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +655 -0
  40. data/lib/google/cloud/dialogflow/v2/documents/paths.rb +119 -0
  41. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +12 -39
  42. data/lib/google/cloud/dialogflow/v2/entity_types.rb +1 -28
  43. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +28 -91
  44. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +96 -11
  45. data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +58 -12
  46. data/lib/google/cloud/dialogflow/v2/environment_pb.rb +50 -1
  47. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +24 -3
  48. data/lib/google/cloud/dialogflow/v2/environments.rb +1 -1
  49. data/lib/google/cloud/dialogflow/v2/environments/client.rb +430 -14
  50. data/lib/google/cloud/dialogflow/v2/environments/paths.rb +104 -5
  51. data/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +59 -0
  52. data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +47 -0
  53. data/lib/google/cloud/dialogflow/v2/fulfillments.rb +49 -0
  54. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +460 -0
  55. data/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb +52 -0
  56. data/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb +69 -0
  57. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +20 -0
  58. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +26 -0
  59. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
  60. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +9 -40
  61. data/lib/google/cloud/dialogflow/v2/intents.rb +1 -32
  62. data/lib/google/cloud/dialogflow/v2/intents/client.rb +34 -81
  63. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +96 -11
  64. data/lib/google/cloud/dialogflow/v2/intents/paths.rb +97 -13
  65. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +60 -0
  66. data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +53 -0
  67. data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +49 -0
  68. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +696 -0
  69. data/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb +52 -0
  70. data/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb +105 -0
  71. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +172 -0
  72. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +64 -0
  73. data/lib/google/cloud/dialogflow/v2/participants.rb +49 -0
  74. data/lib/google/cloud/dialogflow/v2/participants/client.rb +894 -0
  75. data/lib/google/cloud/dialogflow/v2/participants/credentials.rb +52 -0
  76. data/lib/google/cloud/dialogflow/v2/participants/paths.rb +334 -0
  77. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +7 -23
  78. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +1 -17
  79. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +23 -53
  80. data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +74 -2
  81. data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -0
  82. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +15 -7
  83. data/lib/google/cloud/dialogflow/v2/sessions.rb +4 -4
  84. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +51 -15
  85. data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +113 -3
  86. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  87. data/lib/google/cloud/dialogflow/v2/version_pb.rb +69 -0
  88. data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +59 -0
  89. data/lib/google/cloud/dialogflow/v2/versions.rb +49 -0
  90. data/lib/google/cloud/dialogflow/v2/versions/client.rb +709 -0
  91. data/lib/google/cloud/dialogflow/v2/versions/credentials.rb +52 -0
  92. data/lib/google/cloud/dialogflow/v2/versions/paths.rb +110 -0
  93. data/proto_docs/google/api/field_behavior.rb +6 -0
  94. data/proto_docs/google/api/resource.rb +50 -14
  95. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +9 -1
  96. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +252 -0
  97. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +25 -0
  98. data/proto_docs/google/cloud/dialogflow/v2/context.rb +17 -2
  99. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +253 -0
  100. data/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb +83 -0
  101. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +522 -0
  102. data/proto_docs/google/cloud/dialogflow/v2/document.rb +267 -0
  103. data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +12 -3
  104. data/proto_docs/google/cloud/dialogflow/v2/environment.rb +187 -5
  105. data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +144 -0
  106. data/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb +45 -0
  107. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +29 -4
  108. data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +139 -0
  109. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +503 -0
  110. data/proto_docs/google/cloud/dialogflow/v2/session.rb +52 -7
  111. data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +7 -6
  112. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +1 -1
  113. data/proto_docs/google/cloud/dialogflow/v2/version.rb +176 -0
  114. data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +2 -2
  115. data/proto_docs/google/longrunning/operations.rb +17 -3
  116. data/proto_docs/google/protobuf/any.rb +5 -2
  117. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  118. data/proto_docs/google/type/latlng.rb +2 -2
  119. metadata +73 -9
@@ -47,10 +47,32 @@ module Google
47
47
  # @param session [String]
48
48
  # @param context [String]
49
49
  #
50
+ # @overload context_path(project:, location:, session:, context:)
51
+ # The resource will be in the following format:
52
+ #
53
+ # `projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}`
54
+ #
55
+ # @param project [String]
56
+ # @param location [String]
57
+ # @param session [String]
58
+ # @param context [String]
59
+ #
60
+ # @overload context_path(project:, location:, environment:, user:, session:, context:)
61
+ # The resource will be in the following format:
62
+ #
63
+ # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}`
64
+ #
65
+ # @param project [String]
66
+ # @param location [String]
67
+ # @param environment [String]
68
+ # @param user [String]
69
+ # @param session [String]
70
+ # @param context [String]
71
+ #
50
72
  # @return [::String]
51
73
  def context_path **args
52
74
  resources = {
53
- "context:project:session" => (proc do |project:, session:, context:|
75
+ "context:project:session" => (proc do |project:, session:, context:|
54
76
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
55
77
  raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
56
78
 
@@ -63,6 +85,22 @@ module Google
63
85
  raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
64
86
 
65
87
  "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}"
88
+ end),
89
+ "context:location:project:session" => (proc do |project:, location:, session:, context:|
90
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
91
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
92
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
93
+
94
+ "projects/#{project}/locations/#{location}/agent/sessions/#{session}/contexts/#{context}"
95
+ end),
96
+ "context:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, context:|
97
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
98
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
99
+ raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
100
+ raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
101
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
102
+
103
+ "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/contexts/#{context}"
66
104
  end)
67
105
  }
68
106
 
@@ -92,10 +130,30 @@ module Google
92
130
  # @param user [String]
93
131
  # @param session [String]
94
132
  #
133
+ # @overload session_path(project:, location:, session:)
134
+ # The resource will be in the following format:
135
+ #
136
+ # `projects/{project}/locations/{location}/agent/sessions/{session}`
137
+ #
138
+ # @param project [String]
139
+ # @param location [String]
140
+ # @param session [String]
141
+ #
142
+ # @overload session_path(project:, location:, environment:, user:, session:)
143
+ # The resource will be in the following format:
144
+ #
145
+ # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}`
146
+ #
147
+ # @param project [String]
148
+ # @param location [String]
149
+ # @param environment [String]
150
+ # @param user [String]
151
+ # @param session [String]
152
+ #
95
153
  # @return [::String]
96
154
  def session_path **args
97
155
  resources = {
98
- "project:session" => (proc do |project:, session:|
156
+ "project:session" => (proc do |project:, session:|
99
157
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
100
158
 
101
159
  "projects/#{project}/agent/sessions/#{session}"
@@ -106,6 +164,20 @@ module Google
106
164
  raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
107
165
 
108
166
  "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
167
+ end),
168
+ "location:project:session" => (proc do |project:, location:, session:|
169
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
170
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
171
+
172
+ "projects/#{project}/locations/#{location}/agent/sessions/#{session}"
173
+ end),
174
+ "environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:|
175
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
176
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
177
+ raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
178
+ raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
179
+
180
+ "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}"
109
181
  end)
110
182
  }
111
183
 
@@ -137,10 +209,32 @@ module Google
137
209
  # @param session [String]
138
210
  # @param entity_type [String]
139
211
  #
212
+ # @overload session_entity_type_path(project:, location:, session:, entity_type:)
213
+ # The resource will be in the following format:
214
+ #
215
+ # `projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}`
216
+ #
217
+ # @param project [String]
218
+ # @param location [String]
219
+ # @param session [String]
220
+ # @param entity_type [String]
221
+ #
222
+ # @overload session_entity_type_path(project:, location:, environment:, user:, session:, entity_type:)
223
+ # The resource will be in the following format:
224
+ #
225
+ # `projects/{project}/locations/{location}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}`
226
+ #
227
+ # @param project [String]
228
+ # @param location [String]
229
+ # @param environment [String]
230
+ # @param user [String]
231
+ # @param session [String]
232
+ # @param entity_type [String]
233
+ #
140
234
  # @return [::String]
141
235
  def session_entity_type_path **args
142
236
  resources = {
143
- "entity_type:project:session" => (proc do |project:, session:, entity_type:|
237
+ "entity_type:project:session" => (proc do |project:, session:, entity_type:|
144
238
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
145
239
  raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
146
240
 
@@ -153,6 +247,22 @@ module Google
153
247
  raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
154
248
 
155
249
  "projects/#{project}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}"
250
+ end),
251
+ "entity_type:location:project:session" => (proc do |project:, location:, session:, entity_type:|
252
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
253
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
254
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
255
+
256
+ "projects/#{project}/locations/#{location}/agent/sessions/#{session}/entityTypes/#{entity_type}"
257
+ end),
258
+ "entity_type:environment:location:project:session:user" => (proc do |project:, location:, environment:, user:, session:, entity_type:|
259
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
260
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
261
+ raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"
262
+ raise ::ArgumentError, "user cannot contain /" if user.to_s.include? "/"
263
+ raise ::ArgumentError, "session cannot contain /" if session.to_s.include? "/"
264
+
265
+ "projects/#{project}/locations/#{location}/agent/environments/#{environment}/users/#{user}/sessions/#{session}/entityTypes/#{entity_type}"
156
266
  end)
157
267
  }
158
268
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Dialogflow
23
23
  module V2
24
- VERSION = "0.6.2"
24
+ VERSION = "0.8.1"
25
25
  end
26
26
  end
27
27
  end
@@ -0,0 +1,69 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/dialogflow/v2/version.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/protobuf/empty_pb'
11
+ require 'google/protobuf/field_mask_pb'
12
+ require 'google/protobuf/timestamp_pb'
13
+ Google::Protobuf::DescriptorPool.generated_pool.build do
14
+ add_file("google/cloud/dialogflow/v2/version.proto", :syntax => :proto3) do
15
+ add_message "google.cloud.dialogflow.v2.Version" do
16
+ optional :name, :string, 1
17
+ optional :description, :string, 2
18
+ optional :version_number, :int32, 3
19
+ optional :create_time, :message, 4, "google.protobuf.Timestamp"
20
+ optional :status, :enum, 6, "google.cloud.dialogflow.v2.Version.VersionStatus"
21
+ end
22
+ add_enum "google.cloud.dialogflow.v2.Version.VersionStatus" do
23
+ value :VERSION_STATUS_UNSPECIFIED, 0
24
+ value :IN_PROGRESS, 1
25
+ value :READY, 2
26
+ value :FAILED, 3
27
+ end
28
+ add_message "google.cloud.dialogflow.v2.ListVersionsRequest" do
29
+ optional :parent, :string, 1
30
+ optional :page_size, :int32, 2
31
+ optional :page_token, :string, 3
32
+ end
33
+ add_message "google.cloud.dialogflow.v2.ListVersionsResponse" do
34
+ repeated :versions, :message, 1, "google.cloud.dialogflow.v2.Version"
35
+ optional :next_page_token, :string, 2
36
+ end
37
+ add_message "google.cloud.dialogflow.v2.GetVersionRequest" do
38
+ optional :name, :string, 1
39
+ end
40
+ add_message "google.cloud.dialogflow.v2.CreateVersionRequest" do
41
+ optional :parent, :string, 1
42
+ optional :version, :message, 2, "google.cloud.dialogflow.v2.Version"
43
+ end
44
+ add_message "google.cloud.dialogflow.v2.UpdateVersionRequest" do
45
+ optional :version, :message, 1, "google.cloud.dialogflow.v2.Version"
46
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
47
+ end
48
+ add_message "google.cloud.dialogflow.v2.DeleteVersionRequest" do
49
+ optional :name, :string, 1
50
+ end
51
+ end
52
+ end
53
+
54
+ module Google
55
+ module Cloud
56
+ module Dialogflow
57
+ module V2
58
+ Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Version").msgclass
59
+ Version::VersionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.Version.VersionStatus").enummodule
60
+ ListVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListVersionsRequest").msgclass
61
+ ListVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.ListVersionsResponse").msgclass
62
+ GetVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.GetVersionRequest").msgclass
63
+ CreateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.CreateVersionRequest").msgclass
64
+ UpdateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.UpdateVersionRequest").msgclass
65
+ DeleteVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DeleteVersionRequest").msgclass
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,59 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: google/cloud/dialogflow/v2/version.proto for package 'google.cloud.dialogflow.v2'
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/v2/version_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module V2
26
+ module Versions
27
+ # Service for managing [Versions][google.cloud.dialogflow.v2.Version].
28
+ class Service
29
+
30
+ include ::GRPC::GenericService
31
+
32
+ self.marshal_class_method = :encode
33
+ self.unmarshal_class_method = :decode
34
+ self.service_name = 'google.cloud.dialogflow.v2.Versions'
35
+
36
+ # Returns the list of all versions of the specified agent.
37
+ rpc :ListVersions, ::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Google::Cloud::Dialogflow::V2::ListVersionsResponse
38
+ # Retrieves the specified agent version.
39
+ rpc :GetVersion, ::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Google::Cloud::Dialogflow::V2::Version
40
+ # Creates an agent version.
41
+ #
42
+ # The new version points to the agent instance in the "default" environment.
43
+ rpc :CreateVersion, ::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Google::Cloud::Dialogflow::V2::Version
44
+ # Updates the specified agent version.
45
+ #
46
+ # Note that this method does not allow you to update the state of the agent
47
+ # the given version points to. It allows you to update only mutable
48
+ # properties of the version resource.
49
+ rpc :UpdateVersion, ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Google::Cloud::Dialogflow::V2::Version
50
+ # Delete the specified agent version.
51
+ rpc :DeleteVersion, ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Google::Protobuf::Empty
52
+ end
53
+
54
+ Stub = Service.rpc_stub_class
55
+ end
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,49 @@
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/v2/version"
24
+
25
+ require "google/cloud/dialogflow/v2/versions/credentials"
26
+ require "google/cloud/dialogflow/v2/versions/paths"
27
+ require "google/cloud/dialogflow/v2/versions/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Dialogflow
32
+ module V2
33
+ ##
34
+ # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/dialogflow/v2/versions"
39
+ # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new
40
+ #
41
+ module Versions
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "versions", "helpers.rb"
49
+ require "google/cloud/dialogflow/v2/versions/helpers" if ::File.file? helper_path
@@ -0,0 +1,709 @@
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/v2/version_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module V2
26
+ module Versions
27
+ ##
28
+ # Client for the Versions service.
29
+ #
30
+ # Service for managing {::Google::Cloud::Dialogflow::V2::Version Versions}.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :versions_stub
37
+
38
+ ##
39
+ # Configure the Versions Client class.
40
+ #
41
+ # See {::Google::Cloud::Dialogflow::V2::Versions::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all Versions clients:
47
+ #
48
+ # ::Google::Cloud::Dialogflow::V2::Versions::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", "V2"]
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,
71
+ max_delay: 60.0,
72
+ multiplier: 1.3,
73
+ retry_codes: [14]
74
+ }
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the Versions Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::Dialogflow::V2::Versions::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # Create a new Versions client object.
104
+ #
105
+ # ## Examples
106
+ #
107
+ # To create a new Versions client with the default
108
+ # configuration:
109
+ #
110
+ # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new
111
+ #
112
+ # To create a new Versions client with a custom
113
+ # configuration:
114
+ #
115
+ # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config|
116
+ # config.timeout = 10.0
117
+ # end
118
+ #
119
+ # @yield [config] Configure the Versions client.
120
+ # @yieldparam config [Client::Configuration]
121
+ #
122
+ def initialize
123
+ # These require statements are intentionally placed here to initialize
124
+ # the gRPC module only when it's required.
125
+ # See https://github.com/googleapis/toolkit/issues/446
126
+ require "gapic/grpc"
127
+ require "google/cloud/dialogflow/v2/version_services_pb"
128
+
129
+ # Create the configuration object
130
+ @config = Configuration.new Client.configure
131
+
132
+ # Yield the configuration if needed
133
+ yield @config if block_given?
134
+
135
+ # Create credentials
136
+ credentials = @config.credentials
137
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
138
+ # but only if the default endpoint does not have a region prefix.
139
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
+ @config.endpoint == Client.configure.endpoint &&
141
+ !@config.endpoint.split(".").first.include?("-")
142
+ credentials ||= Credentials.default scope: @config.scope,
143
+ enable_self_signed_jwt: enable_self_signed_jwt
144
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
145
+ credentials = Credentials.new credentials, scope: @config.scope
146
+ end
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @versions_stub = ::Gapic::ServiceStub.new(
151
+ ::Google::Cloud::Dialogflow::V2::Versions::Stub,
152
+ credentials: credentials,
153
+ endpoint: @config.endpoint,
154
+ channel_args: @config.channel_args,
155
+ interceptors: @config.interceptors
156
+ )
157
+ end
158
+
159
+ # Service calls
160
+
161
+ ##
162
+ # Returns the list of all versions of the specified agent.
163
+ #
164
+ # @overload list_versions(request, options = nil)
165
+ # Pass arguments to `list_versions` via a request object, either of type
166
+ # {::Google::Cloud::Dialogflow::V2::ListVersionsRequest} or an equivalent Hash.
167
+ #
168
+ # @param request [::Google::Cloud::Dialogflow::V2::ListVersionsRequest, ::Hash]
169
+ # A request object representing the call parameters. Required. To specify no
170
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
171
+ # @param options [::Gapic::CallOptions, ::Hash]
172
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
173
+ #
174
+ # @overload list_versions(parent: nil, page_size: nil, page_token: nil)
175
+ # Pass arguments to `list_versions` via keyword arguments. Note that at
176
+ # least one keyword argument is required. To specify no parameters, or to keep all
177
+ # the default parameter values, pass an empty Hash as a request object (see above).
178
+ #
179
+ # @param parent [::String]
180
+ # Required. The agent to list all versions from.
181
+ # Supported formats:
182
+ # - `projects/<Project ID>/agent`
183
+ # - `projects/<Project ID>/locations/<Location ID>/agent`
184
+ # @param page_size [::Integer]
185
+ # Optional. The maximum number of items to return in a single page. By default 100 and
186
+ # at most 1000.
187
+ # @param page_token [::String]
188
+ # Optional. The next_page_token value returned from a previous list request.
189
+ #
190
+ # @yield [response, operation] Access the result along with the RPC operation
191
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>]
192
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
193
+ #
194
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Version>]
195
+ #
196
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
197
+ #
198
+ def list_versions request, options = nil
199
+ raise ::ArgumentError, "request must be provided" if request.nil?
200
+
201
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListVersionsRequest
202
+
203
+ # Converts hash and nil to an options object
204
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
205
+
206
+ # Customize the options with defaults
207
+ metadata = @config.rpcs.list_versions.metadata.to_h
208
+
209
+ # Set x-goog-api-client and x-goog-user-project headers
210
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
211
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
212
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
213
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
214
+
215
+ header_params = {
216
+ "parent" => request.parent
217
+ }
218
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
219
+ metadata[:"x-goog-request-params"] ||= request_params_header
220
+
221
+ options.apply_defaults timeout: @config.rpcs.list_versions.timeout,
222
+ metadata: metadata,
223
+ retry_policy: @config.rpcs.list_versions.retry_policy
224
+ options.apply_defaults metadata: @config.metadata,
225
+ retry_policy: @config.retry_policy
226
+
227
+ @versions_stub.call_rpc :list_versions, request, options: options do |response, operation|
228
+ response = ::Gapic::PagedEnumerable.new @versions_stub, :list_versions, request, response, operation, options
229
+ yield response, operation if block_given?
230
+ return response
231
+ end
232
+ rescue ::GRPC::BadStatus => e
233
+ raise ::Google::Cloud::Error.from_error(e)
234
+ end
235
+
236
+ ##
237
+ # Retrieves the specified agent version.
238
+ #
239
+ # @overload get_version(request, options = nil)
240
+ # Pass arguments to `get_version` via a request object, either of type
241
+ # {::Google::Cloud::Dialogflow::V2::GetVersionRequest} or an equivalent Hash.
242
+ #
243
+ # @param request [::Google::Cloud::Dialogflow::V2::GetVersionRequest, ::Hash]
244
+ # A request object representing the call parameters. Required. To specify no
245
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
246
+ # @param options [::Gapic::CallOptions, ::Hash]
247
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
248
+ #
249
+ # @overload get_version(name: nil)
250
+ # Pass arguments to `get_version` via keyword arguments. Note that at
251
+ # least one keyword argument is required. To specify no parameters, or to keep all
252
+ # the default parameter values, pass an empty Hash as a request object (see above).
253
+ #
254
+ # @param name [::String]
255
+ # Required. The name of the version.
256
+ # Supported formats:
257
+ # - `projects/<Project ID>/agent/versions/<Version ID>`
258
+ # - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
259
+ # ID>`
260
+ #
261
+ # @yield [response, operation] Access the result along with the RPC operation
262
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version]
263
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
264
+ #
265
+ # @return [::Google::Cloud::Dialogflow::V2::Version]
266
+ #
267
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
268
+ #
269
+ def get_version request, options = nil
270
+ raise ::ArgumentError, "request must be provided" if request.nil?
271
+
272
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetVersionRequest
273
+
274
+ # Converts hash and nil to an options object
275
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
276
+
277
+ # Customize the options with defaults
278
+ metadata = @config.rpcs.get_version.metadata.to_h
279
+
280
+ # Set x-goog-api-client and x-goog-user-project headers
281
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
282
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
283
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
284
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
285
+
286
+ header_params = {
287
+ "name" => request.name
288
+ }
289
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
290
+ metadata[:"x-goog-request-params"] ||= request_params_header
291
+
292
+ options.apply_defaults timeout: @config.rpcs.get_version.timeout,
293
+ metadata: metadata,
294
+ retry_policy: @config.rpcs.get_version.retry_policy
295
+ options.apply_defaults metadata: @config.metadata,
296
+ retry_policy: @config.retry_policy
297
+
298
+ @versions_stub.call_rpc :get_version, request, options: options do |response, operation|
299
+ yield response, operation if block_given?
300
+ return response
301
+ end
302
+ rescue ::GRPC::BadStatus => e
303
+ raise ::Google::Cloud::Error.from_error(e)
304
+ end
305
+
306
+ ##
307
+ # Creates an agent version.
308
+ #
309
+ # The new version points to the agent instance in the "default" environment.
310
+ #
311
+ # @overload create_version(request, options = nil)
312
+ # Pass arguments to `create_version` via a request object, either of type
313
+ # {::Google::Cloud::Dialogflow::V2::CreateVersionRequest} or an equivalent Hash.
314
+ #
315
+ # @param request [::Google::Cloud::Dialogflow::V2::CreateVersionRequest, ::Hash]
316
+ # A request object representing the call parameters. Required. To specify no
317
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
318
+ # @param options [::Gapic::CallOptions, ::Hash]
319
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
320
+ #
321
+ # @overload create_version(parent: nil, version: nil)
322
+ # Pass arguments to `create_version` via keyword arguments. Note that at
323
+ # least one keyword argument is required. To specify no parameters, or to keep all
324
+ # the default parameter values, pass an empty Hash as a request object (see above).
325
+ #
326
+ # @param parent [::String]
327
+ # Required. The agent to create a version for.
328
+ # Supported formats:
329
+ # - `projects/<Project ID>/agent`
330
+ # - `projects/<Project ID>/locations/<Location ID>/agent`
331
+ # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash]
332
+ # Required. The version to create.
333
+ #
334
+ # @yield [response, operation] Access the result along with the RPC operation
335
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version]
336
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
337
+ #
338
+ # @return [::Google::Cloud::Dialogflow::V2::Version]
339
+ #
340
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
341
+ #
342
+ def create_version request, options = nil
343
+ raise ::ArgumentError, "request must be provided" if request.nil?
344
+
345
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateVersionRequest
346
+
347
+ # Converts hash and nil to an options object
348
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
349
+
350
+ # Customize the options with defaults
351
+ metadata = @config.rpcs.create_version.metadata.to_h
352
+
353
+ # Set x-goog-api-client and x-goog-user-project headers
354
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
355
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
356
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
357
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
358
+
359
+ header_params = {
360
+ "parent" => request.parent
361
+ }
362
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
363
+ metadata[:"x-goog-request-params"] ||= request_params_header
364
+
365
+ options.apply_defaults timeout: @config.rpcs.create_version.timeout,
366
+ metadata: metadata,
367
+ retry_policy: @config.rpcs.create_version.retry_policy
368
+ options.apply_defaults metadata: @config.metadata,
369
+ retry_policy: @config.retry_policy
370
+
371
+ @versions_stub.call_rpc :create_version, request, options: options do |response, operation|
372
+ yield response, operation if block_given?
373
+ return response
374
+ end
375
+ rescue ::GRPC::BadStatus => e
376
+ raise ::Google::Cloud::Error.from_error(e)
377
+ end
378
+
379
+ ##
380
+ # Updates the specified agent version.
381
+ #
382
+ # Note that this method does not allow you to update the state of the agent
383
+ # the given version points to. It allows you to update only mutable
384
+ # properties of the version resource.
385
+ #
386
+ # @overload update_version(request, options = nil)
387
+ # Pass arguments to `update_version` via a request object, either of type
388
+ # {::Google::Cloud::Dialogflow::V2::UpdateVersionRequest} or an equivalent Hash.
389
+ #
390
+ # @param request [::Google::Cloud::Dialogflow::V2::UpdateVersionRequest, ::Hash]
391
+ # A request object representing the call parameters. Required. To specify no
392
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
393
+ # @param options [::Gapic::CallOptions, ::Hash]
394
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
395
+ #
396
+ # @overload update_version(version: nil, update_mask: nil)
397
+ # Pass arguments to `update_version` via keyword arguments. Note that at
398
+ # least one keyword argument is required. To specify no parameters, or to keep all
399
+ # the default parameter values, pass an empty Hash as a request object (see above).
400
+ #
401
+ # @param version [::Google::Cloud::Dialogflow::V2::Version, ::Hash]
402
+ # Required. The version to update.
403
+ # Supported formats:
404
+ # - `projects/<Project ID>/agent/versions/<Version ID>`
405
+ # - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
406
+ # ID>`
407
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
408
+ # Required. The mask to control which fields get updated.
409
+ #
410
+ # @yield [response, operation] Access the result along with the RPC operation
411
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Version]
412
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
413
+ #
414
+ # @return [::Google::Cloud::Dialogflow::V2::Version]
415
+ #
416
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
417
+ #
418
+ def update_version request, options = nil
419
+ raise ::ArgumentError, "request must be provided" if request.nil?
420
+
421
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateVersionRequest
422
+
423
+ # Converts hash and nil to an options object
424
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
425
+
426
+ # Customize the options with defaults
427
+ metadata = @config.rpcs.update_version.metadata.to_h
428
+
429
+ # Set x-goog-api-client and x-goog-user-project headers
430
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
432
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
433
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
434
+
435
+ header_params = {
436
+ "version.name" => request.version.name
437
+ }
438
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
439
+ metadata[:"x-goog-request-params"] ||= request_params_header
440
+
441
+ options.apply_defaults timeout: @config.rpcs.update_version.timeout,
442
+ metadata: metadata,
443
+ retry_policy: @config.rpcs.update_version.retry_policy
444
+ options.apply_defaults metadata: @config.metadata,
445
+ retry_policy: @config.retry_policy
446
+
447
+ @versions_stub.call_rpc :update_version, request, options: options do |response, operation|
448
+ yield response, operation if block_given?
449
+ return response
450
+ end
451
+ rescue ::GRPC::BadStatus => e
452
+ raise ::Google::Cloud::Error.from_error(e)
453
+ end
454
+
455
+ ##
456
+ # Delete the specified agent version.
457
+ #
458
+ # @overload delete_version(request, options = nil)
459
+ # Pass arguments to `delete_version` via a request object, either of type
460
+ # {::Google::Cloud::Dialogflow::V2::DeleteVersionRequest} or an equivalent Hash.
461
+ #
462
+ # @param request [::Google::Cloud::Dialogflow::V2::DeleteVersionRequest, ::Hash]
463
+ # A request object representing the call parameters. Required. To specify no
464
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
465
+ # @param options [::Gapic::CallOptions, ::Hash]
466
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
467
+ #
468
+ # @overload delete_version(name: nil)
469
+ # Pass arguments to `delete_version` via keyword arguments. Note that at
470
+ # least one keyword argument is required. To specify no parameters, or to keep all
471
+ # the default parameter values, pass an empty Hash as a request object (see above).
472
+ #
473
+ # @param name [::String]
474
+ # Required. The name of the version to delete.
475
+ # Supported formats:
476
+ # - `projects/<Project ID>/agent/versions/<Version ID>`
477
+ # - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
478
+ # ID>`
479
+ #
480
+ # @yield [response, operation] Access the result along with the RPC operation
481
+ # @yieldparam response [::Google::Protobuf::Empty]
482
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
483
+ #
484
+ # @return [::Google::Protobuf::Empty]
485
+ #
486
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
487
+ #
488
+ def delete_version request, options = nil
489
+ raise ::ArgumentError, "request must be provided" if request.nil?
490
+
491
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteVersionRequest
492
+
493
+ # Converts hash and nil to an options object
494
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
495
+
496
+ # Customize the options with defaults
497
+ metadata = @config.rpcs.delete_version.metadata.to_h
498
+
499
+ # Set x-goog-api-client and x-goog-user-project headers
500
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
501
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
502
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
503
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
504
+
505
+ header_params = {
506
+ "name" => request.name
507
+ }
508
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
509
+ metadata[:"x-goog-request-params"] ||= request_params_header
510
+
511
+ options.apply_defaults timeout: @config.rpcs.delete_version.timeout,
512
+ metadata: metadata,
513
+ retry_policy: @config.rpcs.delete_version.retry_policy
514
+ options.apply_defaults metadata: @config.metadata,
515
+ retry_policy: @config.retry_policy
516
+
517
+ @versions_stub.call_rpc :delete_version, request, options: options do |response, operation|
518
+ yield response, operation if block_given?
519
+ return response
520
+ end
521
+ rescue ::GRPC::BadStatus => e
522
+ raise ::Google::Cloud::Error.from_error(e)
523
+ end
524
+
525
+ ##
526
+ # Configuration class for the Versions API.
527
+ #
528
+ # This class represents the configuration for Versions,
529
+ # providing control over timeouts, retry behavior, logging, transport
530
+ # parameters, and other low-level controls. Certain parameters can also be
531
+ # applied individually to specific RPCs. See
532
+ # {::Google::Cloud::Dialogflow::V2::Versions::Client::Configuration::Rpcs}
533
+ # for a list of RPCs that can be configured independently.
534
+ #
535
+ # Configuration can be applied globally to all clients, or to a single client
536
+ # on construction.
537
+ #
538
+ # # Examples
539
+ #
540
+ # To modify the global config, setting the timeout for list_versions
541
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
542
+ #
543
+ # ::Google::Cloud::Dialogflow::V2::Versions::Client.configure do |config|
544
+ # config.timeout = 10.0
545
+ # config.rpcs.list_versions.timeout = 20.0
546
+ # end
547
+ #
548
+ # To apply the above configuration only to a new client:
549
+ #
550
+ # client = ::Google::Cloud::Dialogflow::V2::Versions::Client.new do |config|
551
+ # config.timeout = 10.0
552
+ # config.rpcs.list_versions.timeout = 20.0
553
+ # end
554
+ #
555
+ # @!attribute [rw] endpoint
556
+ # The hostname or hostname:port of the service endpoint.
557
+ # Defaults to `"dialogflow.googleapis.com"`.
558
+ # @return [::String]
559
+ # @!attribute [rw] credentials
560
+ # Credentials to send with calls. You may provide any of the following types:
561
+ # * (`String`) The path to a service account key file in JSON format
562
+ # * (`Hash`) A service account key as a Hash
563
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
564
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
565
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
566
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
567
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
568
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
569
+ # * (`nil`) indicating no credentials
570
+ # @return [::Object]
571
+ # @!attribute [rw] scope
572
+ # The OAuth scopes
573
+ # @return [::Array<::String>]
574
+ # @!attribute [rw] lib_name
575
+ # The library name as recorded in instrumentation and logging
576
+ # @return [::String]
577
+ # @!attribute [rw] lib_version
578
+ # The library version as recorded in instrumentation and logging
579
+ # @return [::String]
580
+ # @!attribute [rw] channel_args
581
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
582
+ # `GRPC::Core::Channel` object is provided as the credential.
583
+ # @return [::Hash]
584
+ # @!attribute [rw] interceptors
585
+ # An array of interceptors that are run before calls are executed.
586
+ # @return [::Array<::GRPC::ClientInterceptor>]
587
+ # @!attribute [rw] timeout
588
+ # The call timeout in seconds.
589
+ # @return [::Numeric]
590
+ # @!attribute [rw] metadata
591
+ # Additional gRPC headers to be sent with the call.
592
+ # @return [::Hash{::Symbol=>::String}]
593
+ # @!attribute [rw] retry_policy
594
+ # The retry policy. The value is a hash with the following keys:
595
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
596
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
597
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
598
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
599
+ # trigger a retry.
600
+ # @return [::Hash]
601
+ # @!attribute [rw] quota_project
602
+ # A separate project against which to charge quota.
603
+ # @return [::String]
604
+ #
605
+ class Configuration
606
+ extend ::Gapic::Config
607
+
608
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
609
+ config_attr :credentials, nil do |value|
610
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
611
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
612
+ allowed.any? { |klass| klass === value }
613
+ end
614
+ config_attr :scope, nil, ::String, ::Array, nil
615
+ config_attr :lib_name, nil, ::String, nil
616
+ config_attr :lib_version, nil, ::String, nil
617
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
618
+ config_attr :interceptors, nil, ::Array, nil
619
+ config_attr :timeout, nil, ::Numeric, nil
620
+ config_attr :metadata, nil, ::Hash, nil
621
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
622
+ config_attr :quota_project, nil, ::String, nil
623
+
624
+ # @private
625
+ def initialize parent_config = nil
626
+ @parent_config = parent_config unless parent_config.nil?
627
+
628
+ yield self if block_given?
629
+ end
630
+
631
+ ##
632
+ # Configurations for individual RPCs
633
+ # @return [Rpcs]
634
+ #
635
+ def rpcs
636
+ @rpcs ||= begin
637
+ parent_rpcs = nil
638
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
639
+ Rpcs.new parent_rpcs
640
+ end
641
+ end
642
+
643
+ ##
644
+ # Configuration RPC class for the Versions API.
645
+ #
646
+ # Includes fields providing the configuration for each RPC in this service.
647
+ # Each configuration object is of type `Gapic::Config::Method` and includes
648
+ # the following configuration fields:
649
+ #
650
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
651
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
652
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
653
+ # include the following keys:
654
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
655
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
656
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
657
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
658
+ # trigger a retry.
659
+ #
660
+ class Rpcs
661
+ ##
662
+ # RPC-specific configuration for `list_versions`
663
+ # @return [::Gapic::Config::Method]
664
+ #
665
+ attr_reader :list_versions
666
+ ##
667
+ # RPC-specific configuration for `get_version`
668
+ # @return [::Gapic::Config::Method]
669
+ #
670
+ attr_reader :get_version
671
+ ##
672
+ # RPC-specific configuration for `create_version`
673
+ # @return [::Gapic::Config::Method]
674
+ #
675
+ attr_reader :create_version
676
+ ##
677
+ # RPC-specific configuration for `update_version`
678
+ # @return [::Gapic::Config::Method]
679
+ #
680
+ attr_reader :update_version
681
+ ##
682
+ # RPC-specific configuration for `delete_version`
683
+ # @return [::Gapic::Config::Method]
684
+ #
685
+ attr_reader :delete_version
686
+
687
+ # @private
688
+ def initialize parent_rpcs = nil
689
+ list_versions_config = parent_rpcs.list_versions if parent_rpcs.respond_to? :list_versions
690
+ @list_versions = ::Gapic::Config::Method.new list_versions_config
691
+ get_version_config = parent_rpcs.get_version if parent_rpcs.respond_to? :get_version
692
+ @get_version = ::Gapic::Config::Method.new get_version_config
693
+ create_version_config = parent_rpcs.create_version if parent_rpcs.respond_to? :create_version
694
+ @create_version = ::Gapic::Config::Method.new create_version_config
695
+ update_version_config = parent_rpcs.update_version if parent_rpcs.respond_to? :update_version
696
+ @update_version = ::Gapic::Config::Method.new update_version_config
697
+ delete_version_config = parent_rpcs.delete_version if parent_rpcs.respond_to? :delete_version
698
+ @delete_version = ::Gapic::Config::Method.new delete_version_config
699
+
700
+ yield self if block_given?
701
+ end
702
+ end
703
+ end
704
+ end
705
+ end
706
+ end
707
+ end
708
+ end
709
+ end