google-cloud-dialogflow-cx-v3 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/dialogflow/cx/v3/agent_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/cx/v3/audio_config_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/cx/v3/entity_type_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3/entity_type_services_pb.rb +2 -2
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +119 -119
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +112 -112
- data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +50 -50
- data/lib/google/cloud/dialogflow/cx/v3/generator_pb.rb +60 -0
- data/lib/google/cloud/dialogflow/cx/v3/generator_services_pb.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/generators/client.rb +827 -0
- data/lib/google/cloud/dialogflow/cx/v3/generators/credentials.rb +54 -0
- data/lib/google/cloud/dialogflow/cx/v3/generators/paths.rb +75 -0
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/client.rb +771 -0
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest/service_stub.rb +347 -0
- data/lib/google/cloud/dialogflow/cx/v3/generators/rest.rb +55 -0
- data/lib/google/cloud/dialogflow/cx/v3/generators.rb +57 -0
- data/lib/google/cloud/dialogflow/cx/v3/rest.rb +1 -0
- data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +12 -1
- data/lib/google/cloud/dialogflow/cx/v3/session_services_pb.rb +3 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +101 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/paths.rb +45 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +94 -0
- data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +60 -0
- data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
- data/lib/google/cloud/dialogflow/cx/v3.rb +1 -0
- data/proto_docs/google/api/client.rb +13 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/agent.rb +15 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/audio_config.rb +47 -3
- data/proto_docs/google/cloud/dialogflow/cx/v3/generator.rb +187 -0
- data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +185 -0
- metadata +13 -3
@@ -156,108 +156,6 @@ module Google
|
|
156
156
|
|
157
157
|
# Service calls
|
158
158
|
|
159
|
-
##
|
160
|
-
# Returns the list of all entity types in the specified agent.
|
161
|
-
#
|
162
|
-
# @overload list_entity_types(request, options = nil)
|
163
|
-
# Pass arguments to `list_entity_types` via a request object, either of type
|
164
|
-
# {::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest} or an equivalent Hash.
|
165
|
-
#
|
166
|
-
# @param request [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest, ::Hash]
|
167
|
-
# A request object representing the call parameters. Required. To specify no
|
168
|
-
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
169
|
-
# @param options [::Gapic::CallOptions, ::Hash]
|
170
|
-
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
171
|
-
#
|
172
|
-
# @overload list_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil)
|
173
|
-
# Pass arguments to `list_entity_types` via keyword arguments. Note that at
|
174
|
-
# least one keyword argument is required. To specify no parameters, or to keep all
|
175
|
-
# the default parameter values, pass an empty Hash as a request object (see above).
|
176
|
-
#
|
177
|
-
# @param parent [::String]
|
178
|
-
# Required. The agent to list all entity types for.
|
179
|
-
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
|
180
|
-
# @param language_code [::String]
|
181
|
-
# The language to list entity types for. The following fields are language
|
182
|
-
# dependent:
|
183
|
-
#
|
184
|
-
# * `EntityType.entities.value`
|
185
|
-
# * `EntityType.entities.synonyms`
|
186
|
-
# * `EntityType.excluded_phrases.value`
|
187
|
-
#
|
188
|
-
# If not specified, the agent's default language is used.
|
189
|
-
# [Many
|
190
|
-
# languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
191
|
-
# are supported.
|
192
|
-
# Note: languages must be enabled in the agent before they can be used.
|
193
|
-
# @param page_size [::Integer]
|
194
|
-
# The maximum number of items to return in a single page. By default 100 and
|
195
|
-
# at most 1000.
|
196
|
-
# @param page_token [::String]
|
197
|
-
# The next_page_token value returned from a previous list request.
|
198
|
-
# @yield [result, operation] Access the result along with the TransportOperation object
|
199
|
-
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>]
|
200
|
-
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
201
|
-
#
|
202
|
-
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>]
|
203
|
-
#
|
204
|
-
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
205
|
-
#
|
206
|
-
# @example Basic example
|
207
|
-
# require "google/cloud/dialogflow/cx/v3"
|
208
|
-
#
|
209
|
-
# # Create a client object. The client can be reused for multiple calls.
|
210
|
-
# client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new
|
211
|
-
#
|
212
|
-
# # Create a request. To set request fields, pass in keyword arguments.
|
213
|
-
# request = Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest.new
|
214
|
-
#
|
215
|
-
# # Call the list_entity_types method.
|
216
|
-
# result = client.list_entity_types request
|
217
|
-
#
|
218
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
219
|
-
# # over elements, and API calls will be issued to fetch pages as needed.
|
220
|
-
# result.each do |item|
|
221
|
-
# # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::EntityType.
|
222
|
-
# p item
|
223
|
-
# end
|
224
|
-
#
|
225
|
-
def list_entity_types request, options = nil
|
226
|
-
raise ::ArgumentError, "request must be provided" if request.nil?
|
227
|
-
|
228
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest
|
229
|
-
|
230
|
-
# Converts hash and nil to an options object
|
231
|
-
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
232
|
-
|
233
|
-
# Customize the options with defaults
|
234
|
-
call_metadata = @config.rpcs.list_entity_types.metadata.to_h
|
235
|
-
|
236
|
-
# Set x-goog-api-client and x-goog-user-project headers
|
237
|
-
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
238
|
-
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
239
|
-
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
240
|
-
transports_version_send: [:rest]
|
241
|
-
|
242
|
-
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
243
|
-
|
244
|
-
options.apply_defaults timeout: @config.rpcs.list_entity_types.timeout,
|
245
|
-
metadata: call_metadata,
|
246
|
-
retry_policy: @config.rpcs.list_entity_types.retry_policy
|
247
|
-
|
248
|
-
options.apply_defaults timeout: @config.timeout,
|
249
|
-
metadata: @config.metadata,
|
250
|
-
retry_policy: @config.retry_policy
|
251
|
-
|
252
|
-
@entity_types_stub.list_entity_types request, options do |result, operation|
|
253
|
-
result = ::Gapic::Rest::PagedEnumerable.new @entity_types_stub, :list_entity_types, "entity_types", request, result, options
|
254
|
-
yield result, operation if block_given?
|
255
|
-
return result
|
256
|
-
end
|
257
|
-
rescue ::Gapic::Rest::Error => e
|
258
|
-
raise ::Google::Cloud::Error.from_error(e)
|
259
|
-
end
|
260
|
-
|
261
159
|
##
|
262
160
|
# Retrieves the specified entity type.
|
263
161
|
#
|
@@ -641,6 +539,108 @@ module Google
|
|
641
539
|
raise ::Google::Cloud::Error.from_error(e)
|
642
540
|
end
|
643
541
|
|
542
|
+
##
|
543
|
+
# Returns the list of all entity types in the specified agent.
|
544
|
+
#
|
545
|
+
# @overload list_entity_types(request, options = nil)
|
546
|
+
# Pass arguments to `list_entity_types` via a request object, either of type
|
547
|
+
# {::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest} or an equivalent Hash.
|
548
|
+
#
|
549
|
+
# @param request [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest, ::Hash]
|
550
|
+
# A request object representing the call parameters. Required. To specify no
|
551
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
552
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
553
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
554
|
+
#
|
555
|
+
# @overload list_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil)
|
556
|
+
# Pass arguments to `list_entity_types` via keyword arguments. Note that at
|
557
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
558
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
559
|
+
#
|
560
|
+
# @param parent [::String]
|
561
|
+
# Required. The agent to list all entity types for.
|
562
|
+
# Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>`.
|
563
|
+
# @param language_code [::String]
|
564
|
+
# The language to list entity types for. The following fields are language
|
565
|
+
# dependent:
|
566
|
+
#
|
567
|
+
# * `EntityType.entities.value`
|
568
|
+
# * `EntityType.entities.synonyms`
|
569
|
+
# * `EntityType.excluded_phrases.value`
|
570
|
+
#
|
571
|
+
# If not specified, the agent's default language is used.
|
572
|
+
# [Many
|
573
|
+
# languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
574
|
+
# are supported.
|
575
|
+
# Note: languages must be enabled in the agent before they can be used.
|
576
|
+
# @param page_size [::Integer]
|
577
|
+
# The maximum number of items to return in a single page. By default 100 and
|
578
|
+
# at most 1000.
|
579
|
+
# @param page_token [::String]
|
580
|
+
# The next_page_token value returned from a previous list request.
|
581
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
582
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>]
|
583
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
584
|
+
#
|
585
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::EntityType>]
|
586
|
+
#
|
587
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
588
|
+
#
|
589
|
+
# @example Basic example
|
590
|
+
# require "google/cloud/dialogflow/cx/v3"
|
591
|
+
#
|
592
|
+
# # Create a client object. The client can be reused for multiple calls.
|
593
|
+
# client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new
|
594
|
+
#
|
595
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
596
|
+
# request = Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest.new
|
597
|
+
#
|
598
|
+
# # Call the list_entity_types method.
|
599
|
+
# result = client.list_entity_types request
|
600
|
+
#
|
601
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
602
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
603
|
+
# result.each do |item|
|
604
|
+
# # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::EntityType.
|
605
|
+
# p item
|
606
|
+
# end
|
607
|
+
#
|
608
|
+
def list_entity_types request, options = nil
|
609
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
610
|
+
|
611
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest
|
612
|
+
|
613
|
+
# Converts hash and nil to an options object
|
614
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
615
|
+
|
616
|
+
# Customize the options with defaults
|
617
|
+
call_metadata = @config.rpcs.list_entity_types.metadata.to_h
|
618
|
+
|
619
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
620
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
621
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
622
|
+
gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
|
623
|
+
transports_version_send: [:rest]
|
624
|
+
|
625
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
626
|
+
|
627
|
+
options.apply_defaults timeout: @config.rpcs.list_entity_types.timeout,
|
628
|
+
metadata: call_metadata,
|
629
|
+
retry_policy: @config.rpcs.list_entity_types.retry_policy
|
630
|
+
|
631
|
+
options.apply_defaults timeout: @config.timeout,
|
632
|
+
metadata: @config.metadata,
|
633
|
+
retry_policy: @config.retry_policy
|
634
|
+
|
635
|
+
@entity_types_stub.list_entity_types request, options do |result, operation|
|
636
|
+
result = ::Gapic::Rest::PagedEnumerable.new @entity_types_stub, :list_entity_types, "entity_types", request, result, options
|
637
|
+
yield result, operation if block_given?
|
638
|
+
return result
|
639
|
+
end
|
640
|
+
rescue ::Gapic::Rest::Error => e
|
641
|
+
raise ::Google::Cloud::Error.from_error(e)
|
642
|
+
end
|
643
|
+
|
644
644
|
##
|
645
645
|
# Configuration class for the EntityTypes REST API.
|
646
646
|
#
|
@@ -657,17 +657,17 @@ module Google
|
|
657
657
|
# @example
|
658
658
|
#
|
659
659
|
# # Modify the global config, setting the timeout for
|
660
|
-
# #
|
660
|
+
# # get_entity_type to 20 seconds,
|
661
661
|
# # and all remaining timeouts to 10 seconds.
|
662
662
|
# ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.configure do |config|
|
663
663
|
# config.timeout = 10.0
|
664
|
-
# config.rpcs.
|
664
|
+
# config.rpcs.get_entity_type.timeout = 20.0
|
665
665
|
# end
|
666
666
|
#
|
667
667
|
# # Apply the above configuration only to a new client.
|
668
668
|
# client = ::Google::Cloud::Dialogflow::CX::V3::EntityTypes::Rest::Client.new do |config|
|
669
669
|
# config.timeout = 10.0
|
670
|
-
# config.rpcs.
|
670
|
+
# config.rpcs.get_entity_type.timeout = 20.0
|
671
671
|
# end
|
672
672
|
#
|
673
673
|
# @!attribute [rw] endpoint
|
@@ -773,11 +773,6 @@ module Google
|
|
773
773
|
# trigger a retry.
|
774
774
|
#
|
775
775
|
class Rpcs
|
776
|
-
##
|
777
|
-
# RPC-specific configuration for `list_entity_types`
|
778
|
-
# @return [::Gapic::Config::Method]
|
779
|
-
#
|
780
|
-
attr_reader :list_entity_types
|
781
776
|
##
|
782
777
|
# RPC-specific configuration for `get_entity_type`
|
783
778
|
# @return [::Gapic::Config::Method]
|
@@ -798,11 +793,14 @@ module Google
|
|
798
793
|
# @return [::Gapic::Config::Method]
|
799
794
|
#
|
800
795
|
attr_reader :delete_entity_type
|
796
|
+
##
|
797
|
+
# RPC-specific configuration for `list_entity_types`
|
798
|
+
# @return [::Gapic::Config::Method]
|
799
|
+
#
|
800
|
+
attr_reader :list_entity_types
|
801
801
|
|
802
802
|
# @private
|
803
803
|
def initialize parent_rpcs = nil
|
804
|
-
list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types
|
805
|
-
@list_entity_types = ::Gapic::Config::Method.new list_entity_types_config
|
806
804
|
get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type
|
807
805
|
@get_entity_type = ::Gapic::Config::Method.new get_entity_type_config
|
808
806
|
create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type
|
@@ -811,6 +809,8 @@ module Google
|
|
811
809
|
@update_entity_type = ::Gapic::Config::Method.new update_entity_type_config
|
812
810
|
delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type
|
813
811
|
@delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config
|
812
|
+
list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types
|
813
|
+
@list_entity_types = ::Gapic::Config::Method.new list_entity_types_config
|
814
814
|
|
815
815
|
yield self if block_given?
|
816
816
|
end
|
@@ -42,23 +42,23 @@ module Google
|
|
42
42
|
end
|
43
43
|
|
44
44
|
##
|
45
|
-
# Baseline implementation for the
|
45
|
+
# Baseline implementation for the get_entity_type REST call
|
46
46
|
#
|
47
|
-
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::
|
47
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest]
|
48
48
|
# A request object representing the call parameters. Required.
|
49
49
|
# @param options [::Gapic::CallOptions]
|
50
50
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
51
51
|
#
|
52
52
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
53
|
-
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::
|
53
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
54
54
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
55
55
|
#
|
56
|
-
# @return [::Google::Cloud::Dialogflow::CX::V3::
|
56
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
57
57
|
# A result object deserialized from the server's reply
|
58
|
-
def
|
58
|
+
def get_entity_type request_pb, options = nil
|
59
59
|
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
60
60
|
|
61
|
-
verb, uri, query_string_params, body = ServiceStub.
|
61
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_get_entity_type_request request_pb
|
62
62
|
query_string_params = if query_string_params.any?
|
63
63
|
query_string_params.to_h { |p| p.split "=", 2 }
|
64
64
|
else
|
@@ -73,16 +73,16 @@ module Google
|
|
73
73
|
options: options
|
74
74
|
)
|
75
75
|
operation = ::Gapic::Rest::TransportOperation.new response
|
76
|
-
result = ::Google::Cloud::Dialogflow::CX::V3::
|
76
|
+
result = ::Google::Cloud::Dialogflow::CX::V3::EntityType.decode_json response.body, ignore_unknown_fields: true
|
77
77
|
|
78
78
|
yield result, operation if block_given?
|
79
79
|
result
|
80
80
|
end
|
81
81
|
|
82
82
|
##
|
83
|
-
# Baseline implementation for the
|
83
|
+
# Baseline implementation for the create_entity_type REST call
|
84
84
|
#
|
85
|
-
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::
|
85
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest]
|
86
86
|
# A request object representing the call parameters. Required.
|
87
87
|
# @param options [::Gapic::CallOptions]
|
88
88
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
@@ -93,10 +93,10 @@ module Google
|
|
93
93
|
#
|
94
94
|
# @return [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
95
95
|
# A result object deserialized from the server's reply
|
96
|
-
def
|
96
|
+
def create_entity_type request_pb, options = nil
|
97
97
|
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
98
98
|
|
99
|
-
verb, uri, query_string_params, body = ServiceStub.
|
99
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_create_entity_type_request request_pb
|
100
100
|
query_string_params = if query_string_params.any?
|
101
101
|
query_string_params.to_h { |p| p.split "=", 2 }
|
102
102
|
else
|
@@ -118,9 +118,9 @@ module Google
|
|
118
118
|
end
|
119
119
|
|
120
120
|
##
|
121
|
-
# Baseline implementation for the
|
121
|
+
# Baseline implementation for the update_entity_type REST call
|
122
122
|
#
|
123
|
-
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::
|
123
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest]
|
124
124
|
# A request object representing the call parameters. Required.
|
125
125
|
# @param options [::Gapic::CallOptions]
|
126
126
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
@@ -131,10 +131,10 @@ module Google
|
|
131
131
|
#
|
132
132
|
# @return [::Google::Cloud::Dialogflow::CX::V3::EntityType]
|
133
133
|
# A result object deserialized from the server's reply
|
134
|
-
def
|
134
|
+
def update_entity_type request_pb, options = nil
|
135
135
|
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
136
136
|
|
137
|
-
verb, uri, query_string_params, body = ServiceStub.
|
137
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_update_entity_type_request request_pb
|
138
138
|
query_string_params = if query_string_params.any?
|
139
139
|
query_string_params.to_h { |p| p.split "=", 2 }
|
140
140
|
else
|
@@ -156,23 +156,23 @@ module Google
|
|
156
156
|
end
|
157
157
|
|
158
158
|
##
|
159
|
-
# Baseline implementation for the
|
159
|
+
# Baseline implementation for the delete_entity_type REST call
|
160
160
|
#
|
161
|
-
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::
|
161
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest]
|
162
162
|
# A request object representing the call parameters. Required.
|
163
163
|
# @param options [::Gapic::CallOptions]
|
164
164
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
165
165
|
#
|
166
166
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
167
|
-
# @yieldparam result [::Google::
|
167
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
168
168
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
169
169
|
#
|
170
|
-
# @return [::Google::
|
170
|
+
# @return [::Google::Protobuf::Empty]
|
171
171
|
# A result object deserialized from the server's reply
|
172
|
-
def
|
172
|
+
def delete_entity_type request_pb, options = nil
|
173
173
|
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
174
174
|
|
175
|
-
verb, uri, query_string_params, body = ServiceStub.
|
175
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_delete_entity_type_request request_pb
|
176
176
|
query_string_params = if query_string_params.any?
|
177
177
|
query_string_params.to_h { |p| p.split "=", 2 }
|
178
178
|
else
|
@@ -187,30 +187,30 @@ module Google
|
|
187
187
|
options: options
|
188
188
|
)
|
189
189
|
operation = ::Gapic::Rest::TransportOperation.new response
|
190
|
-
result = ::Google::
|
190
|
+
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
191
191
|
|
192
192
|
yield result, operation if block_given?
|
193
193
|
result
|
194
194
|
end
|
195
195
|
|
196
196
|
##
|
197
|
-
# Baseline implementation for the
|
197
|
+
# Baseline implementation for the list_entity_types REST call
|
198
198
|
#
|
199
|
-
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::
|
199
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest]
|
200
200
|
# A request object representing the call parameters. Required.
|
201
201
|
# @param options [::Gapic::CallOptions]
|
202
202
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
203
203
|
#
|
204
204
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
205
|
-
# @yieldparam result [::Google::
|
205
|
+
# @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesResponse]
|
206
206
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
207
207
|
#
|
208
|
-
# @return [::Google::
|
208
|
+
# @return [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesResponse]
|
209
209
|
# A result object deserialized from the server's reply
|
210
|
-
def
|
210
|
+
def list_entity_types request_pb, options = nil
|
211
211
|
raise ::ArgumentError, "request must be provided" if request_pb.nil?
|
212
212
|
|
213
|
-
verb, uri, query_string_params, body = ServiceStub.
|
213
|
+
verb, uri, query_string_params, body = ServiceStub.transcode_list_entity_types_request request_pb
|
214
214
|
query_string_params = if query_string_params.any?
|
215
215
|
query_string_params.to_h { |p| p.split "=", 2 }
|
216
216
|
else
|
@@ -225,33 +225,12 @@ module Google
|
|
225
225
|
options: options
|
226
226
|
)
|
227
227
|
operation = ::Gapic::Rest::TransportOperation.new response
|
228
|
-
result = ::Google::
|
228
|
+
result = ::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesResponse.decode_json response.body, ignore_unknown_fields: true
|
229
229
|
|
230
230
|
yield result, operation if block_given?
|
231
231
|
result
|
232
232
|
end
|
233
233
|
|
234
|
-
##
|
235
|
-
# @private
|
236
|
-
#
|
237
|
-
# GRPC transcoding helper method for the list_entity_types REST call
|
238
|
-
#
|
239
|
-
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest]
|
240
|
-
# A request object representing the call parameters. Required.
|
241
|
-
# @return [Array(String, [String, nil], Hash{String => String})]
|
242
|
-
# Uri, Body, Query string parameters
|
243
|
-
def self.transcode_list_entity_types_request request_pb
|
244
|
-
transcoder = Gapic::Rest::GrpcTranscoder.new
|
245
|
-
.with_bindings(
|
246
|
-
uri_method: :get,
|
247
|
-
uri_template: "/v3/{parent}/entityTypes",
|
248
|
-
matches: [
|
249
|
-
["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false]
|
250
|
-
]
|
251
|
-
)
|
252
|
-
transcoder.transcode request_pb
|
253
|
-
end
|
254
|
-
|
255
234
|
##
|
256
235
|
# @private
|
257
236
|
#
|
@@ -337,6 +316,27 @@ module Google
|
|
337
316
|
)
|
338
317
|
transcoder.transcode request_pb
|
339
318
|
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# @private
|
322
|
+
#
|
323
|
+
# GRPC transcoding helper method for the list_entity_types REST call
|
324
|
+
#
|
325
|
+
# @param request_pb [::Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest]
|
326
|
+
# A request object representing the call parameters. Required.
|
327
|
+
# @return [Array(String, [String, nil], Hash{String => String})]
|
328
|
+
# Uri, Body, Query string parameters
|
329
|
+
def self.transcode_list_entity_types_request request_pb
|
330
|
+
transcoder = Gapic::Rest::GrpcTranscoder.new
|
331
|
+
.with_bindings(
|
332
|
+
uri_method: :get,
|
333
|
+
uri_template: "/v3/{parent}/entityTypes",
|
334
|
+
matches: [
|
335
|
+
["parent", %r{^projects/[^/]+/locations/[^/]+/agents/[^/]+/?$}, false]
|
336
|
+
]
|
337
|
+
)
|
338
|
+
transcoder.transcode request_pb
|
339
|
+
end
|
340
340
|
end
|
341
341
|
end
|
342
342
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/cloud/dialogflow/cx/v3/generator.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/api/annotations_pb'
|
8
|
+
require 'google/api/client_pb'
|
9
|
+
require 'google/api/field_behavior_pb'
|
10
|
+
require 'google/api/resource_pb'
|
11
|
+
require 'google/protobuf/empty_pb'
|
12
|
+
require 'google/protobuf/field_mask_pb'
|
13
|
+
|
14
|
+
|
15
|
+
descriptor_data = "\n-google/cloud/dialogflow/cx/v3/generator.proto\x12\x1dgoogle.cloud.dialogflow.cx.v3\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xe8\x02\n\tGenerator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0bprompt_text\x18\x03 \x01(\x0b\x32%.google.cloud.dialogflow.cx.v3.PhraseB\x03\xe0\x41\x02\x12O\n\x0cplaceholders\x18\x05 \x03(\x0b\x32\x34.google.cloud.dialogflow.cx.v3.Generator.PlaceholderB\x03\xe0\x41\x01\x1a\'\n\x0bPlaceholder\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t:w\xea\x41t\n#dialogflow.googleapis.com/Generator\x12Mprojects/{project}/locations/{location}/agents/{agent}/generators/{generator}\"\x1b\n\x06Phrase\x12\x11\n\x04text\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\x92\x01\n\x15ListGeneratorsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"o\n\x16ListGeneratorsResponse\x12<\n\ngenerators\x18\x01 \x03(\x0b\x32(.google.cloud.dialogflow.cx.v3.Generator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"g\n\x13GetGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\"\xae\x01\n\x16\x43reateGeneratorRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#dialogflow.googleapis.com/Generator\x12@\n\tgenerator\x18\x02 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x03 \x01(\t\"\xa2\x01\n\x16UpdateGeneratorRequest\x12@\n\tgenerator\x18\x01 \x01(\x0b\x32(.google.cloud.dialogflow.cx.v3.GeneratorB\x03\xe0\x41\x02\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"b\n\x16\x44\x65leteGeneratorRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#dialogflow.googleapis.com/Generator\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x32\xe9\x08\n\nGenerators\x12\xc7\x01\n\x0eListGenerators\x12\x34.google.cloud.dialogflow.cx.v3.ListGeneratorsRequest\x1a\x35.google.cloud.dialogflow.cx.v3.ListGeneratorsResponse\"H\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{parent=projects/*/locations/*/agents/*}/generators\xda\x41\x06parent\x12\xb4\x01\n\x0cGetGenerator\x12\x32.google.cloud.dialogflow.cx.v3.GetGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"F\x82\xd3\xe4\x93\x02\x39\x12\x37/v3/{name=projects/*/locations/*/agents/*/generators/*}\xda\x41\x04name\x12\xd1\x01\n\x0f\x43reateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.CreateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"]\x82\xd3\xe4\x93\x02\x44\"7/v3/{parent=projects/*/locations/*/agents/*}/generators:\tgenerator\xda\x41\x10parent,generator\x12\xe0\x01\n\x0fUpdateGenerator\x12\x35.google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest\x1a(.google.cloud.dialogflow.cx.v3.Generator\"l\x82\xd3\xe4\x93\x02N2A/v3/{generator.name=projects/*/locations/*/agents/*/generators/*}:\tgenerator\xda\x41\x15generator,update_mask\x12\xa8\x01\n\x0f\x44\x65leteGenerator\x12\x35.google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest\x1a\x16.google.protobuf.Empty\"F\x82\xd3\xe4\x93\x02\x39*7/v3/{name=projects/*/locations/*/agents/*/generators/*}\xda\x41\x04name\x1ax\xca\x41\x19\x64ialogflow.googleapis.com\xd2\x41Yhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflowB\xb4\x01\n!com.google.cloud.dialogflow.cx.v3B\x0eGeneratorProtoP\x01Z1cloud.google.com/go/dialogflow/cx/apiv3/cxpb;cxpb\xf8\x01\x01\xa2\x02\x02\x44\x46\xaa\x02\x1dGoogle.Cloud.Dialogflow.Cx.V3\xea\x02!Google::Cloud::Dialogflow::CX::V3b\x06proto3"
|
16
|
+
|
17
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
18
|
+
|
19
|
+
begin
|
20
|
+
pool.add_serialized_file(descriptor_data)
|
21
|
+
rescue TypeError => e
|
22
|
+
# Compatibility code: will be removed in the next major version.
|
23
|
+
require 'google/protobuf/descriptor_pb'
|
24
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
25
|
+
parsed.clear_dependency
|
26
|
+
serialized = parsed.class.encode(parsed)
|
27
|
+
file = pool.add_serialized_file(serialized)
|
28
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
29
|
+
imports = [
|
30
|
+
["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"],
|
31
|
+
]
|
32
|
+
imports.each do |type_name, expected_filename|
|
33
|
+
import_file = pool.lookup(type_name).file_descriptor
|
34
|
+
if import_file.name != expected_filename
|
35
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
39
|
+
warn "This will become an error in the next major version."
|
40
|
+
end
|
41
|
+
|
42
|
+
module Google
|
43
|
+
module Cloud
|
44
|
+
module Dialogflow
|
45
|
+
module CX
|
46
|
+
module V3
|
47
|
+
Generator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator").msgclass
|
48
|
+
Generator::Placeholder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Generator.Placeholder").msgclass
|
49
|
+
Phrase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.Phrase").msgclass
|
50
|
+
ListGeneratorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListGeneratorsRequest").msgclass
|
51
|
+
ListGeneratorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.ListGeneratorsResponse").msgclass
|
52
|
+
GetGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.GetGeneratorRequest").msgclass
|
53
|
+
CreateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CreateGeneratorRequest").msgclass
|
54
|
+
UpdateGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateGeneratorRequest").msgclass
|
55
|
+
DeleteGeneratorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteGeneratorRequest").msgclass
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/dialogflow/cx/v3/generator.proto for package 'Google.Cloud.Dialogflow.CX.V3'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2023 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/generator_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Dialogflow
|
25
|
+
module CX
|
26
|
+
module V3
|
27
|
+
module Generators
|
28
|
+
# Service for managing [Generators][google.cloud.dialogflow.cx.v3.Generator]
|
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.Generators'
|
36
|
+
|
37
|
+
# Returns the list of all generators in the specified agent.
|
38
|
+
rpc :ListGenerators, ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsRequest, ::Google::Cloud::Dialogflow::CX::V3::ListGeneratorsResponse
|
39
|
+
# Retrieves the specified generator.
|
40
|
+
rpc :GetGenerator, ::Google::Cloud::Dialogflow::CX::V3::GetGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator
|
41
|
+
# Creates a generator in the specified agent.
|
42
|
+
rpc :CreateGenerator, ::Google::Cloud::Dialogflow::CX::V3::CreateGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator
|
43
|
+
# Update the specified generator.
|
44
|
+
rpc :UpdateGenerator, ::Google::Cloud::Dialogflow::CX::V3::UpdateGeneratorRequest, ::Google::Cloud::Dialogflow::CX::V3::Generator
|
45
|
+
# Deletes the specified generators.
|
46
|
+
rpc :DeleteGenerator, ::Google::Cloud::Dialogflow::CX::V3::DeleteGeneratorRequest, ::Google::Protobuf::Empty
|
47
|
+
end
|
48
|
+
|
49
|
+
Stub = Service.rpc_stub_class
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|