google-cloud-contact_center_insights-v1 0.3.0 → 0.7.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.
@@ -140,6 +140,7 @@ module Google
140
140
 
141
141
  @operations_client = Operations.new do |config|
142
142
  config.credentials = credentials
143
+ config.quota_project = @quota_project_id
143
144
  config.endpoint = @config.endpoint
144
145
  end
145
146
 
@@ -188,8 +189,8 @@ module Google
188
189
  # component of the conversation's resource name. If no ID is specified, a
189
190
  # server-generated ID will be used.
190
191
  #
191
- # This value should be 4-32 characters and must match the regular
192
- # expression /^[a-z0-9-]\\{4,32}$/. Valid characters are /[a-z][0-9]-/
192
+ # This value should be 4-64 characters and must match the regular
193
+ # expression `^[a-z0-9-]{4,64}$`. Valid characters are `[a-z][0-9]-`
193
194
  #
194
195
  # @yield [response, operation] Access the result along with the RPC operation
195
196
  # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::Conversation]
@@ -199,6 +200,21 @@ module Google
199
200
  #
200
201
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
201
202
  #
203
+ # @example Basic example
204
+ # require "google/cloud/contact_center_insights/v1"
205
+ #
206
+ # # Create a client object. The client can be reused for multiple calls.
207
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
208
+ #
209
+ # # Create a request. To set request fields, pass in keyword arguments.
210
+ # request = Google::Cloud::ContactCenterInsights::V1::CreateConversationRequest.new
211
+ #
212
+ # # Call the create_conversation method.
213
+ # result = client.create_conversation request
214
+ #
215
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation.
216
+ # p result
217
+ #
202
218
  def create_conversation request, options = nil
203
219
  raise ::ArgumentError, "request must be provided" if request.nil?
204
220
 
@@ -216,9 +232,11 @@ module Google
216
232
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
217
233
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
218
234
 
219
- header_params = {
220
- "parent" => request.parent
221
- }
235
+ header_params = {}
236
+ if request.parent
237
+ header_params["parent"] = request.parent
238
+ end
239
+
222
240
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
223
241
  metadata[:"x-goog-request-params"] ||= request_params_header
224
242
 
@@ -269,6 +287,21 @@ module Google
269
287
  #
270
288
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
271
289
  #
290
+ # @example Basic example
291
+ # require "google/cloud/contact_center_insights/v1"
292
+ #
293
+ # # Create a client object. The client can be reused for multiple calls.
294
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
295
+ #
296
+ # # Create a request. To set request fields, pass in keyword arguments.
297
+ # request = Google::Cloud::ContactCenterInsights::V1::UpdateConversationRequest.new
298
+ #
299
+ # # Call the update_conversation method.
300
+ # result = client.update_conversation request
301
+ #
302
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation.
303
+ # p result
304
+ #
272
305
  def update_conversation request, options = nil
273
306
  raise ::ArgumentError, "request must be provided" if request.nil?
274
307
 
@@ -286,9 +319,11 @@ module Google
286
319
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
287
320
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
321
 
289
- header_params = {
290
- "conversation.name" => request.conversation.name
291
- }
322
+ header_params = {}
323
+ if request.conversation&.name
324
+ header_params["conversation.name"] = request.conversation.name
325
+ end
326
+
292
327
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
293
328
  metadata[:"x-goog-request-params"] ||= request_params_header
294
329
 
@@ -339,6 +374,21 @@ module Google
339
374
  #
340
375
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
341
376
  #
377
+ # @example Basic example
378
+ # require "google/cloud/contact_center_insights/v1"
379
+ #
380
+ # # Create a client object. The client can be reused for multiple calls.
381
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
382
+ #
383
+ # # Create a request. To set request fields, pass in keyword arguments.
384
+ # request = Google::Cloud::ContactCenterInsights::V1::GetConversationRequest.new
385
+ #
386
+ # # Call the get_conversation method.
387
+ # result = client.get_conversation request
388
+ #
389
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation.
390
+ # p result
391
+ #
342
392
  def get_conversation request, options = nil
343
393
  raise ::ArgumentError, "request must be provided" if request.nil?
344
394
 
@@ -356,9 +406,11 @@ module Google
356
406
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
357
407
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
358
408
 
359
- header_params = {
360
- "name" => request.name
361
- }
409
+ header_params = {}
410
+ if request.name
411
+ header_params["name"] = request.name
412
+ end
413
+
362
414
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
363
415
  metadata[:"x-goog-request-params"] ||= request_params_header
364
416
 
@@ -421,6 +473,27 @@ module Google
421
473
  #
422
474
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
423
475
  #
476
+ # @example Basic example
477
+ # require "google/cloud/contact_center_insights/v1"
478
+ #
479
+ # # Create a client object. The client can be reused for multiple calls.
480
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
481
+ #
482
+ # # Create a request. To set request fields, pass in keyword arguments.
483
+ # request = Google::Cloud::ContactCenterInsights::V1::ListConversationsRequest.new
484
+ #
485
+ # # Call the list_conversations method.
486
+ # result = client.list_conversations request
487
+ #
488
+ # # The returned object is of type Gapic::PagedEnumerable. You can
489
+ # # iterate over all elements by calling #each, and the enumerable
490
+ # # will lazily make API calls to fetch subsequent pages. Other
491
+ # # methods are also available for managing paging directly.
492
+ # result.each do |response|
493
+ # # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::Conversation.
494
+ # p response
495
+ # end
496
+ #
424
497
  def list_conversations request, options = nil
425
498
  raise ::ArgumentError, "request must be provided" if request.nil?
426
499
 
@@ -438,9 +511,11 @@ module Google
438
511
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
439
512
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
440
513
 
441
- header_params = {
442
- "parent" => request.parent
443
- }
514
+ header_params = {}
515
+ if request.parent
516
+ header_params["parent"] = request.parent
517
+ end
518
+
444
519
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
445
520
  metadata[:"x-goog-request-params"] ||= request_params_header
446
521
 
@@ -494,6 +569,21 @@ module Google
494
569
  #
495
570
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
496
571
  #
572
+ # @example Basic example
573
+ # require "google/cloud/contact_center_insights/v1"
574
+ #
575
+ # # Create a client object. The client can be reused for multiple calls.
576
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
577
+ #
578
+ # # Create a request. To set request fields, pass in keyword arguments.
579
+ # request = Google::Cloud::ContactCenterInsights::V1::DeleteConversationRequest.new
580
+ #
581
+ # # Call the delete_conversation method.
582
+ # result = client.delete_conversation request
583
+ #
584
+ # # The returned object is of type Google::Protobuf::Empty.
585
+ # p result
586
+ #
497
587
  def delete_conversation request, options = nil
498
588
  raise ::ArgumentError, "request must be provided" if request.nil?
499
589
 
@@ -511,9 +601,11 @@ module Google
511
601
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
512
602
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
513
603
 
514
- header_params = {
515
- "name" => request.name
516
- }
604
+ header_params = {}
605
+ if request.name
606
+ header_params["name"] = request.name
607
+ end
608
+
517
609
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
518
610
  metadata[:"x-goog-request-params"] ||= request_params_header
519
611
 
@@ -565,6 +657,28 @@ module Google
565
657
  #
566
658
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
567
659
  #
660
+ # @example Basic example
661
+ # require "google/cloud/contact_center_insights/v1"
662
+ #
663
+ # # Create a client object. The client can be reused for multiple calls.
664
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
665
+ #
666
+ # # Create a request. To set request fields, pass in keyword arguments.
667
+ # request = Google::Cloud::ContactCenterInsights::V1::CreateAnalysisRequest.new
668
+ #
669
+ # # Call the create_analysis method.
670
+ # result = client.create_analysis request
671
+ #
672
+ # # The returned object is of type Gapic::Operation. You can use this
673
+ # # object to check the status of an operation, cancel it, or wait
674
+ # # for results. Here is how to block until completion:
675
+ # result.wait_until_done! timeout: 60
676
+ # if result.response?
677
+ # p result.response
678
+ # else
679
+ # puts "Error!"
680
+ # end
681
+ #
568
682
  def create_analysis request, options = nil
569
683
  raise ::ArgumentError, "request must be provided" if request.nil?
570
684
 
@@ -582,9 +696,11 @@ module Google
582
696
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
583
697
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
584
698
 
585
- header_params = {
586
- "parent" => request.parent
587
- }
699
+ header_params = {}
700
+ if request.parent
701
+ header_params["parent"] = request.parent
702
+ end
703
+
588
704
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
589
705
  metadata[:"x-goog-request-params"] ||= request_params_header
590
706
 
@@ -634,6 +750,21 @@ module Google
634
750
  #
635
751
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
636
752
  #
753
+ # @example Basic example
754
+ # require "google/cloud/contact_center_insights/v1"
755
+ #
756
+ # # Create a client object. The client can be reused for multiple calls.
757
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
758
+ #
759
+ # # Create a request. To set request fields, pass in keyword arguments.
760
+ # request = Google::Cloud::ContactCenterInsights::V1::GetAnalysisRequest.new
761
+ #
762
+ # # Call the get_analysis method.
763
+ # result = client.get_analysis request
764
+ #
765
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Analysis.
766
+ # p result
767
+ #
637
768
  def get_analysis request, options = nil
638
769
  raise ::ArgumentError, "request must be provided" if request.nil?
639
770
 
@@ -651,9 +782,11 @@ module Google
651
782
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
652
783
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
653
784
 
654
- header_params = {
655
- "name" => request.name
656
- }
785
+ header_params = {}
786
+ if request.name
787
+ header_params["name"] = request.name
788
+ end
789
+
657
790
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
658
791
  metadata[:"x-goog-request-params"] ||= request_params_header
659
792
 
@@ -714,6 +847,27 @@ module Google
714
847
  #
715
848
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
716
849
  #
850
+ # @example Basic example
851
+ # require "google/cloud/contact_center_insights/v1"
852
+ #
853
+ # # Create a client object. The client can be reused for multiple calls.
854
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
855
+ #
856
+ # # Create a request. To set request fields, pass in keyword arguments.
857
+ # request = Google::Cloud::ContactCenterInsights::V1::ListAnalysesRequest.new
858
+ #
859
+ # # Call the list_analyses method.
860
+ # result = client.list_analyses request
861
+ #
862
+ # # The returned object is of type Gapic::PagedEnumerable. You can
863
+ # # iterate over all elements by calling #each, and the enumerable
864
+ # # will lazily make API calls to fetch subsequent pages. Other
865
+ # # methods are also available for managing paging directly.
866
+ # result.each do |response|
867
+ # # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::Analysis.
868
+ # p response
869
+ # end
870
+ #
717
871
  def list_analyses request, options = nil
718
872
  raise ::ArgumentError, "request must be provided" if request.nil?
719
873
 
@@ -731,9 +885,11 @@ module Google
731
885
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
732
886
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
733
887
 
734
- header_params = {
735
- "parent" => request.parent
736
- }
888
+ header_params = {}
889
+ if request.parent
890
+ header_params["parent"] = request.parent
891
+ end
892
+
737
893
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
738
894
  metadata[:"x-goog-request-params"] ||= request_params_header
739
895
 
@@ -783,6 +939,21 @@ module Google
783
939
  #
784
940
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
785
941
  #
942
+ # @example Basic example
943
+ # require "google/cloud/contact_center_insights/v1"
944
+ #
945
+ # # Create a client object. The client can be reused for multiple calls.
946
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
947
+ #
948
+ # # Create a request. To set request fields, pass in keyword arguments.
949
+ # request = Google::Cloud::ContactCenterInsights::V1::DeleteAnalysisRequest.new
950
+ #
951
+ # # Call the delete_analysis method.
952
+ # result = client.delete_analysis request
953
+ #
954
+ # # The returned object is of type Google::Protobuf::Empty.
955
+ # p result
956
+ #
786
957
  def delete_analysis request, options = nil
787
958
  raise ::ArgumentError, "request must be provided" if request.nil?
788
959
 
@@ -800,9 +971,11 @@ module Google
800
971
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
801
972
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
802
973
 
803
- header_params = {
804
- "name" => request.name
805
- }
974
+ header_params = {}
975
+ if request.name
976
+ header_params["name"] = request.name
977
+ end
978
+
806
979
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
807
980
  metadata[:"x-goog-request-params"] ||= request_params_header
808
981
 
@@ -835,7 +1008,7 @@ module Google
835
1008
  # @param options [::Gapic::CallOptions, ::Hash]
836
1009
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
837
1010
  #
838
- # @overload export_insights_data(big_query_destination: nil, parent: nil, filter: nil, kms_key: nil)
1011
+ # @overload export_insights_data(big_query_destination: nil, parent: nil, filter: nil, kms_key: nil, write_disposition: nil)
839
1012
  # Pass arguments to `export_insights_data` via keyword arguments. Note that at
840
1013
  # least one keyword argument is required. To specify no parameters, or to keep all
841
1014
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -851,6 +1024,8 @@ module Google
851
1024
  # A fully qualified KMS key name for BigQuery tables protected by CMEK.
852
1025
  # Format:
853
1026
  # projects/\\{project}/locations/\\{location}/keyRings/\\{keyring}/cryptoKeys/\\{key}/cryptoKeyVersions/\\{version}
1027
+ # @param write_disposition [::Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest::WriteDisposition]
1028
+ # Options for what to do if the destination table already exists.
854
1029
  #
855
1030
  # @yield [response, operation] Access the result along with the RPC operation
856
1031
  # @yieldparam response [::Gapic::Operation]
@@ -860,6 +1035,28 @@ module Google
860
1035
  #
861
1036
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
862
1037
  #
1038
+ # @example Basic example
1039
+ # require "google/cloud/contact_center_insights/v1"
1040
+ #
1041
+ # # Create a client object. The client can be reused for multiple calls.
1042
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1043
+ #
1044
+ # # Create a request. To set request fields, pass in keyword arguments.
1045
+ # request = Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest.new
1046
+ #
1047
+ # # Call the export_insights_data method.
1048
+ # result = client.export_insights_data request
1049
+ #
1050
+ # # The returned object is of type Gapic::Operation. You can use this
1051
+ # # object to check the status of an operation, cancel it, or wait
1052
+ # # for results. Here is how to block until completion:
1053
+ # result.wait_until_done! timeout: 60
1054
+ # if result.response?
1055
+ # p result.response
1056
+ # else
1057
+ # puts "Error!"
1058
+ # end
1059
+ #
863
1060
  def export_insights_data request, options = nil
864
1061
  raise ::ArgumentError, "request must be provided" if request.nil?
865
1062
 
@@ -877,9 +1074,11 @@ module Google
877
1074
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
878
1075
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
879
1076
 
880
- header_params = {
881
- "parent" => request.parent
882
- }
1077
+ header_params = {}
1078
+ if request.parent
1079
+ header_params["parent"] = request.parent
1080
+ end
1081
+
883
1082
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
884
1083
  metadata[:"x-goog-request-params"] ||= request_params_header
885
1084
 
@@ -931,6 +1130,28 @@ module Google
931
1130
  #
932
1131
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
933
1132
  #
1133
+ # @example Basic example
1134
+ # require "google/cloud/contact_center_insights/v1"
1135
+ #
1136
+ # # Create a client object. The client can be reused for multiple calls.
1137
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1138
+ #
1139
+ # # Create a request. To set request fields, pass in keyword arguments.
1140
+ # request = Google::Cloud::ContactCenterInsights::V1::CreateIssueModelRequest.new
1141
+ #
1142
+ # # Call the create_issue_model method.
1143
+ # result = client.create_issue_model request
1144
+ #
1145
+ # # The returned object is of type Gapic::Operation. You can use this
1146
+ # # object to check the status of an operation, cancel it, or wait
1147
+ # # for results. Here is how to block until completion:
1148
+ # result.wait_until_done! timeout: 60
1149
+ # if result.response?
1150
+ # p result.response
1151
+ # else
1152
+ # puts "Error!"
1153
+ # end
1154
+ #
934
1155
  def create_issue_model request, options = nil
935
1156
  raise ::ArgumentError, "request must be provided" if request.nil?
936
1157
 
@@ -948,9 +1169,11 @@ module Google
948
1169
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
949
1170
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
950
1171
 
951
- header_params = {
952
- "parent" => request.parent
953
- }
1172
+ header_params = {}
1173
+ if request.parent
1174
+ header_params["parent"] = request.parent
1175
+ end
1176
+
954
1177
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
955
1178
  metadata[:"x-goog-request-params"] ||= request_params_header
956
1179
 
@@ -1002,6 +1225,21 @@ module Google
1002
1225
  #
1003
1226
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1004
1227
  #
1228
+ # @example Basic example
1229
+ # require "google/cloud/contact_center_insights/v1"
1230
+ #
1231
+ # # Create a client object. The client can be reused for multiple calls.
1232
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1233
+ #
1234
+ # # Create a request. To set request fields, pass in keyword arguments.
1235
+ # request = Google::Cloud::ContactCenterInsights::V1::UpdateIssueModelRequest.new
1236
+ #
1237
+ # # Call the update_issue_model method.
1238
+ # result = client.update_issue_model request
1239
+ #
1240
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::IssueModel.
1241
+ # p result
1242
+ #
1005
1243
  def update_issue_model request, options = nil
1006
1244
  raise ::ArgumentError, "request must be provided" if request.nil?
1007
1245
 
@@ -1019,9 +1257,11 @@ module Google
1019
1257
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1020
1258
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1021
1259
 
1022
- header_params = {
1023
- "issue_model.name" => request.issue_model.name
1024
- }
1260
+ header_params = {}
1261
+ if request.issue_model&.name
1262
+ header_params["issue_model.name"] = request.issue_model.name
1263
+ end
1264
+
1025
1265
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1026
1266
  metadata[:"x-goog-request-params"] ||= request_params_header
1027
1267
 
@@ -1070,6 +1310,21 @@ module Google
1070
1310
  #
1071
1311
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1072
1312
  #
1313
+ # @example Basic example
1314
+ # require "google/cloud/contact_center_insights/v1"
1315
+ #
1316
+ # # Create a client object. The client can be reused for multiple calls.
1317
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1318
+ #
1319
+ # # Create a request. To set request fields, pass in keyword arguments.
1320
+ # request = Google::Cloud::ContactCenterInsights::V1::GetIssueModelRequest.new
1321
+ #
1322
+ # # Call the get_issue_model method.
1323
+ # result = client.get_issue_model request
1324
+ #
1325
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::IssueModel.
1326
+ # p result
1327
+ #
1073
1328
  def get_issue_model request, options = nil
1074
1329
  raise ::ArgumentError, "request must be provided" if request.nil?
1075
1330
 
@@ -1087,9 +1342,11 @@ module Google
1087
1342
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1088
1343
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1089
1344
 
1090
- header_params = {
1091
- "name" => request.name
1092
- }
1345
+ header_params = {}
1346
+ if request.name
1347
+ header_params["name"] = request.name
1348
+ end
1349
+
1093
1350
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1094
1351
  metadata[:"x-goog-request-params"] ||= request_params_header
1095
1352
 
@@ -1138,6 +1395,21 @@ module Google
1138
1395
  #
1139
1396
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1140
1397
  #
1398
+ # @example Basic example
1399
+ # require "google/cloud/contact_center_insights/v1"
1400
+ #
1401
+ # # Create a client object. The client can be reused for multiple calls.
1402
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1403
+ #
1404
+ # # Create a request. To set request fields, pass in keyword arguments.
1405
+ # request = Google::Cloud::ContactCenterInsights::V1::ListIssueModelsRequest.new
1406
+ #
1407
+ # # Call the list_issue_models method.
1408
+ # result = client.list_issue_models request
1409
+ #
1410
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::ListIssueModelsResponse.
1411
+ # p result
1412
+ #
1141
1413
  def list_issue_models request, options = nil
1142
1414
  raise ::ArgumentError, "request must be provided" if request.nil?
1143
1415
 
@@ -1155,9 +1427,11 @@ module Google
1155
1427
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1156
1428
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1157
1429
 
1158
- header_params = {
1159
- "parent" => request.parent
1160
- }
1430
+ header_params = {}
1431
+ if request.parent
1432
+ header_params["parent"] = request.parent
1433
+ end
1434
+
1161
1435
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1162
1436
  metadata[:"x-goog-request-params"] ||= request_params_header
1163
1437
 
@@ -1206,6 +1480,28 @@ module Google
1206
1480
  #
1207
1481
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1208
1482
  #
1483
+ # @example Basic example
1484
+ # require "google/cloud/contact_center_insights/v1"
1485
+ #
1486
+ # # Create a client object. The client can be reused for multiple calls.
1487
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1488
+ #
1489
+ # # Create a request. To set request fields, pass in keyword arguments.
1490
+ # request = Google::Cloud::ContactCenterInsights::V1::DeleteIssueModelRequest.new
1491
+ #
1492
+ # # Call the delete_issue_model method.
1493
+ # result = client.delete_issue_model request
1494
+ #
1495
+ # # The returned object is of type Gapic::Operation. You can use this
1496
+ # # object to check the status of an operation, cancel it, or wait
1497
+ # # for results. Here is how to block until completion:
1498
+ # result.wait_until_done! timeout: 60
1499
+ # if result.response?
1500
+ # p result.response
1501
+ # else
1502
+ # puts "Error!"
1503
+ # end
1504
+ #
1209
1505
  def delete_issue_model request, options = nil
1210
1506
  raise ::ArgumentError, "request must be provided" if request.nil?
1211
1507
 
@@ -1223,9 +1519,11 @@ module Google
1223
1519
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1224
1520
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1225
1521
 
1226
- header_params = {
1227
- "name" => request.name
1228
- }
1522
+ header_params = {}
1523
+ if request.name
1524
+ header_params["name"] = request.name
1525
+ end
1526
+
1229
1527
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1230
1528
  metadata[:"x-goog-request-params"] ||= request_params_header
1231
1529
 
@@ -1276,6 +1574,28 @@ module Google
1276
1574
  #
1277
1575
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1278
1576
  #
1577
+ # @example Basic example
1578
+ # require "google/cloud/contact_center_insights/v1"
1579
+ #
1580
+ # # Create a client object. The client can be reused for multiple calls.
1581
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1582
+ #
1583
+ # # Create a request. To set request fields, pass in keyword arguments.
1584
+ # request = Google::Cloud::ContactCenterInsights::V1::DeployIssueModelRequest.new
1585
+ #
1586
+ # # Call the deploy_issue_model method.
1587
+ # result = client.deploy_issue_model request
1588
+ #
1589
+ # # The returned object is of type Gapic::Operation. You can use this
1590
+ # # object to check the status of an operation, cancel it, or wait
1591
+ # # for results. Here is how to block until completion:
1592
+ # result.wait_until_done! timeout: 60
1593
+ # if result.response?
1594
+ # p result.response
1595
+ # else
1596
+ # puts "Error!"
1597
+ # end
1598
+ #
1279
1599
  def deploy_issue_model request, options = nil
1280
1600
  raise ::ArgumentError, "request must be provided" if request.nil?
1281
1601
 
@@ -1293,9 +1613,11 @@ module Google
1293
1613
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1294
1614
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1295
1615
 
1296
- header_params = {
1297
- "name" => request.name
1298
- }
1616
+ header_params = {}
1617
+ if request.name
1618
+ header_params["name"] = request.name
1619
+ end
1620
+
1299
1621
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1300
1622
  metadata[:"x-goog-request-params"] ||= request_params_header
1301
1623
 
@@ -1346,6 +1668,28 @@ module Google
1346
1668
  #
1347
1669
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1348
1670
  #
1671
+ # @example Basic example
1672
+ # require "google/cloud/contact_center_insights/v1"
1673
+ #
1674
+ # # Create a client object. The client can be reused for multiple calls.
1675
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1676
+ #
1677
+ # # Create a request. To set request fields, pass in keyword arguments.
1678
+ # request = Google::Cloud::ContactCenterInsights::V1::UndeployIssueModelRequest.new
1679
+ #
1680
+ # # Call the undeploy_issue_model method.
1681
+ # result = client.undeploy_issue_model request
1682
+ #
1683
+ # # The returned object is of type Gapic::Operation. You can use this
1684
+ # # object to check the status of an operation, cancel it, or wait
1685
+ # # for results. Here is how to block until completion:
1686
+ # result.wait_until_done! timeout: 60
1687
+ # if result.response?
1688
+ # p result.response
1689
+ # else
1690
+ # puts "Error!"
1691
+ # end
1692
+ #
1349
1693
  def undeploy_issue_model request, options = nil
1350
1694
  raise ::ArgumentError, "request must be provided" if request.nil?
1351
1695
 
@@ -1363,9 +1707,11 @@ module Google
1363
1707
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1364
1708
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1365
1709
 
1366
- header_params = {
1367
- "name" => request.name
1368
- }
1710
+ header_params = {}
1711
+ if request.name
1712
+ header_params["name"] = request.name
1713
+ end
1714
+
1369
1715
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1370
1716
  metadata[:"x-goog-request-params"] ||= request_params_header
1371
1717
 
@@ -1415,6 +1761,21 @@ module Google
1415
1761
  #
1416
1762
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1417
1763
  #
1764
+ # @example Basic example
1765
+ # require "google/cloud/contact_center_insights/v1"
1766
+ #
1767
+ # # Create a client object. The client can be reused for multiple calls.
1768
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1769
+ #
1770
+ # # Create a request. To set request fields, pass in keyword arguments.
1771
+ # request = Google::Cloud::ContactCenterInsights::V1::GetIssueRequest.new
1772
+ #
1773
+ # # Call the get_issue method.
1774
+ # result = client.get_issue request
1775
+ #
1776
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Issue.
1777
+ # p result
1778
+ #
1418
1779
  def get_issue request, options = nil
1419
1780
  raise ::ArgumentError, "request must be provided" if request.nil?
1420
1781
 
@@ -1432,9 +1793,11 @@ module Google
1432
1793
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1433
1794
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1434
1795
 
1435
- header_params = {
1436
- "name" => request.name
1437
- }
1796
+ header_params = {}
1797
+ if request.name
1798
+ header_params["name"] = request.name
1799
+ end
1800
+
1438
1801
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1439
1802
  metadata[:"x-goog-request-params"] ||= request_params_header
1440
1803
 
@@ -1483,6 +1846,21 @@ module Google
1483
1846
  #
1484
1847
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1485
1848
  #
1849
+ # @example Basic example
1850
+ # require "google/cloud/contact_center_insights/v1"
1851
+ #
1852
+ # # Create a client object. The client can be reused for multiple calls.
1853
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1854
+ #
1855
+ # # Create a request. To set request fields, pass in keyword arguments.
1856
+ # request = Google::Cloud::ContactCenterInsights::V1::ListIssuesRequest.new
1857
+ #
1858
+ # # Call the list_issues method.
1859
+ # result = client.list_issues request
1860
+ #
1861
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::ListIssuesResponse.
1862
+ # p result
1863
+ #
1486
1864
  def list_issues request, options = nil
1487
1865
  raise ::ArgumentError, "request must be provided" if request.nil?
1488
1866
 
@@ -1500,9 +1878,11 @@ module Google
1500
1878
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1501
1879
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1502
1880
 
1503
- header_params = {
1504
- "parent" => request.parent
1505
- }
1881
+ header_params = {}
1882
+ if request.parent
1883
+ header_params["parent"] = request.parent
1884
+ end
1885
+
1506
1886
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1507
1887
  metadata[:"x-goog-request-params"] ||= request_params_header
1508
1888
 
@@ -1553,6 +1933,21 @@ module Google
1553
1933
  #
1554
1934
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1555
1935
  #
1936
+ # @example Basic example
1937
+ # require "google/cloud/contact_center_insights/v1"
1938
+ #
1939
+ # # Create a client object. The client can be reused for multiple calls.
1940
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
1941
+ #
1942
+ # # Create a request. To set request fields, pass in keyword arguments.
1943
+ # request = Google::Cloud::ContactCenterInsights::V1::UpdateIssueRequest.new
1944
+ #
1945
+ # # Call the update_issue method.
1946
+ # result = client.update_issue request
1947
+ #
1948
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Issue.
1949
+ # p result
1950
+ #
1556
1951
  def update_issue request, options = nil
1557
1952
  raise ::ArgumentError, "request must be provided" if request.nil?
1558
1953
 
@@ -1570,9 +1965,11 @@ module Google
1570
1965
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1571
1966
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1572
1967
 
1573
- header_params = {
1574
- "issue.name" => request.issue.name
1575
- }
1968
+ header_params = {}
1969
+ if request.issue&.name
1970
+ header_params["issue.name"] = request.issue.name
1971
+ end
1972
+
1576
1973
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1577
1974
  metadata[:"x-goog-request-params"] ||= request_params_header
1578
1975
 
@@ -1621,6 +2018,21 @@ module Google
1621
2018
  #
1622
2019
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1623
2020
  #
2021
+ # @example Basic example
2022
+ # require "google/cloud/contact_center_insights/v1"
2023
+ #
2024
+ # # Create a client object. The client can be reused for multiple calls.
2025
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2026
+ #
2027
+ # # Create a request. To set request fields, pass in keyword arguments.
2028
+ # request = Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsRequest.new
2029
+ #
2030
+ # # Call the calculate_issue_model_stats method.
2031
+ # result = client.calculate_issue_model_stats request
2032
+ #
2033
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsResponse.
2034
+ # p result
2035
+ #
1624
2036
  def calculate_issue_model_stats request, options = nil
1625
2037
  raise ::ArgumentError, "request must be provided" if request.nil?
1626
2038
 
@@ -1638,9 +2050,11 @@ module Google
1638
2050
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1639
2051
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1640
2052
 
1641
- header_params = {
1642
- "issue_model" => request.issue_model
1643
- }
2053
+ header_params = {}
2054
+ if request.issue_model
2055
+ header_params["issue_model"] = request.issue_model
2056
+ end
2057
+
1644
2058
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1645
2059
  metadata[:"x-goog-request-params"] ||= request_params_header
1646
2060
 
@@ -1694,6 +2108,21 @@ module Google
1694
2108
  #
1695
2109
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1696
2110
  #
2111
+ # @example Basic example
2112
+ # require "google/cloud/contact_center_insights/v1"
2113
+ #
2114
+ # # Create a client object. The client can be reused for multiple calls.
2115
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2116
+ #
2117
+ # # Create a request. To set request fields, pass in keyword arguments.
2118
+ # request = Google::Cloud::ContactCenterInsights::V1::CreatePhraseMatcherRequest.new
2119
+ #
2120
+ # # Call the create_phrase_matcher method.
2121
+ # result = client.create_phrase_matcher request
2122
+ #
2123
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher.
2124
+ # p result
2125
+ #
1697
2126
  def create_phrase_matcher request, options = nil
1698
2127
  raise ::ArgumentError, "request must be provided" if request.nil?
1699
2128
 
@@ -1711,9 +2140,11 @@ module Google
1711
2140
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1712
2141
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1713
2142
 
1714
- header_params = {
1715
- "parent" => request.parent
1716
- }
2143
+ header_params = {}
2144
+ if request.parent
2145
+ header_params["parent"] = request.parent
2146
+ end
2147
+
1717
2148
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1718
2149
  metadata[:"x-goog-request-params"] ||= request_params_header
1719
2150
 
@@ -1762,6 +2193,21 @@ module Google
1762
2193
  #
1763
2194
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1764
2195
  #
2196
+ # @example Basic example
2197
+ # require "google/cloud/contact_center_insights/v1"
2198
+ #
2199
+ # # Create a client object. The client can be reused for multiple calls.
2200
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2201
+ #
2202
+ # # Create a request. To set request fields, pass in keyword arguments.
2203
+ # request = Google::Cloud::ContactCenterInsights::V1::GetPhraseMatcherRequest.new
2204
+ #
2205
+ # # Call the get_phrase_matcher method.
2206
+ # result = client.get_phrase_matcher request
2207
+ #
2208
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher.
2209
+ # p result
2210
+ #
1765
2211
  def get_phrase_matcher request, options = nil
1766
2212
  raise ::ArgumentError, "request must be provided" if request.nil?
1767
2213
 
@@ -1779,9 +2225,11 @@ module Google
1779
2225
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1780
2226
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1781
2227
 
1782
- header_params = {
1783
- "name" => request.name
1784
- }
2228
+ header_params = {}
2229
+ if request.name
2230
+ header_params["name"] = request.name
2231
+ end
2232
+
1785
2233
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1786
2234
  metadata[:"x-goog-request-params"] ||= request_params_header
1787
2235
 
@@ -1842,6 +2290,27 @@ module Google
1842
2290
  #
1843
2291
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1844
2292
  #
2293
+ # @example Basic example
2294
+ # require "google/cloud/contact_center_insights/v1"
2295
+ #
2296
+ # # Create a client object. The client can be reused for multiple calls.
2297
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2298
+ #
2299
+ # # Create a request. To set request fields, pass in keyword arguments.
2300
+ # request = Google::Cloud::ContactCenterInsights::V1::ListPhraseMatchersRequest.new
2301
+ #
2302
+ # # Call the list_phrase_matchers method.
2303
+ # result = client.list_phrase_matchers request
2304
+ #
2305
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2306
+ # # iterate over all elements by calling #each, and the enumerable
2307
+ # # will lazily make API calls to fetch subsequent pages. Other
2308
+ # # methods are also available for managing paging directly.
2309
+ # result.each do |response|
2310
+ # # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher.
2311
+ # p response
2312
+ # end
2313
+ #
1845
2314
  def list_phrase_matchers request, options = nil
1846
2315
  raise ::ArgumentError, "request must be provided" if request.nil?
1847
2316
 
@@ -1859,9 +2328,11 @@ module Google
1859
2328
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1860
2329
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1861
2330
 
1862
- header_params = {
1863
- "parent" => request.parent
1864
- }
2331
+ header_params = {}
2332
+ if request.parent
2333
+ header_params["parent"] = request.parent
2334
+ end
2335
+
1865
2336
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1866
2337
  metadata[:"x-goog-request-params"] ||= request_params_header
1867
2338
 
@@ -1911,6 +2382,21 @@ module Google
1911
2382
  #
1912
2383
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1913
2384
  #
2385
+ # @example Basic example
2386
+ # require "google/cloud/contact_center_insights/v1"
2387
+ #
2388
+ # # Create a client object. The client can be reused for multiple calls.
2389
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2390
+ #
2391
+ # # Create a request. To set request fields, pass in keyword arguments.
2392
+ # request = Google::Cloud::ContactCenterInsights::V1::DeletePhraseMatcherRequest.new
2393
+ #
2394
+ # # Call the delete_phrase_matcher method.
2395
+ # result = client.delete_phrase_matcher request
2396
+ #
2397
+ # # The returned object is of type Google::Protobuf::Empty.
2398
+ # p result
2399
+ #
1914
2400
  def delete_phrase_matcher request, options = nil
1915
2401
  raise ::ArgumentError, "request must be provided" if request.nil?
1916
2402
 
@@ -1928,9 +2414,11 @@ module Google
1928
2414
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
1929
2415
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1930
2416
 
1931
- header_params = {
1932
- "name" => request.name
1933
- }
2417
+ header_params = {}
2418
+ if request.name
2419
+ header_params["name"] = request.name
2420
+ end
2421
+
1934
2422
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1935
2423
  metadata[:"x-goog-request-params"] ||= request_params_header
1936
2424
 
@@ -1950,6 +2438,93 @@ module Google
1950
2438
  raise ::Google::Cloud::Error.from_error(e)
1951
2439
  end
1952
2440
 
2441
+ ##
2442
+ # Updates a phrase matcher.
2443
+ #
2444
+ # @overload update_phrase_matcher(request, options = nil)
2445
+ # Pass arguments to `update_phrase_matcher` via a request object, either of type
2446
+ # {::Google::Cloud::ContactCenterInsights::V1::UpdatePhraseMatcherRequest} or an equivalent Hash.
2447
+ #
2448
+ # @param request [::Google::Cloud::ContactCenterInsights::V1::UpdatePhraseMatcherRequest, ::Hash]
2449
+ # A request object representing the call parameters. Required. To specify no
2450
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2451
+ # @param options [::Gapic::CallOptions, ::Hash]
2452
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2453
+ #
2454
+ # @overload update_phrase_matcher(phrase_matcher: nil, update_mask: nil)
2455
+ # Pass arguments to `update_phrase_matcher` via keyword arguments. Note that at
2456
+ # least one keyword argument is required. To specify no parameters, or to keep all
2457
+ # the default parameter values, pass an empty Hash as a request object (see above).
2458
+ #
2459
+ # @param phrase_matcher [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher, ::Hash]
2460
+ # Required. The new values for the phrase matcher.
2461
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
2462
+ # The list of fields to be updated.
2463
+ #
2464
+ # @yield [response, operation] Access the result along with the RPC operation
2465
+ # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher]
2466
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2467
+ #
2468
+ # @return [::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher]
2469
+ #
2470
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2471
+ #
2472
+ # @example Basic example
2473
+ # require "google/cloud/contact_center_insights/v1"
2474
+ #
2475
+ # # Create a client object. The client can be reused for multiple calls.
2476
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2477
+ #
2478
+ # # Create a request. To set request fields, pass in keyword arguments.
2479
+ # request = Google::Cloud::ContactCenterInsights::V1::UpdatePhraseMatcherRequest.new
2480
+ #
2481
+ # # Call the update_phrase_matcher method.
2482
+ # result = client.update_phrase_matcher request
2483
+ #
2484
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher.
2485
+ # p result
2486
+ #
2487
+ def update_phrase_matcher request, options = nil
2488
+ raise ::ArgumentError, "request must be provided" if request.nil?
2489
+
2490
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::UpdatePhraseMatcherRequest
2491
+
2492
+ # Converts hash and nil to an options object
2493
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2494
+
2495
+ # Customize the options with defaults
2496
+ metadata = @config.rpcs.update_phrase_matcher.metadata.to_h
2497
+
2498
+ # Set x-goog-api-client and x-goog-user-project headers
2499
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2500
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2501
+ gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
2502
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2503
+
2504
+ header_params = {}
2505
+ if request.phrase_matcher&.name
2506
+ header_params["phrase_matcher.name"] = request.phrase_matcher.name
2507
+ end
2508
+
2509
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2510
+ metadata[:"x-goog-request-params"] ||= request_params_header
2511
+
2512
+ options.apply_defaults timeout: @config.rpcs.update_phrase_matcher.timeout,
2513
+ metadata: metadata,
2514
+ retry_policy: @config.rpcs.update_phrase_matcher.retry_policy
2515
+
2516
+ options.apply_defaults timeout: @config.timeout,
2517
+ metadata: @config.metadata,
2518
+ retry_policy: @config.retry_policy
2519
+
2520
+ @contact_center_insights_stub.call_rpc :update_phrase_matcher, request, options: options do |response, operation|
2521
+ yield response, operation if block_given?
2522
+ return response
2523
+ end
2524
+ rescue ::GRPC::BadStatus => e
2525
+ raise ::Google::Cloud::Error.from_error(e)
2526
+ end
2527
+
1953
2528
  ##
1954
2529
  # Gets conversation statistics.
1955
2530
  #
@@ -1982,6 +2557,21 @@ module Google
1982
2557
  #
1983
2558
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1984
2559
  #
2560
+ # @example Basic example
2561
+ # require "google/cloud/contact_center_insights/v1"
2562
+ #
2563
+ # # Create a client object. The client can be reused for multiple calls.
2564
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2565
+ #
2566
+ # # Create a request. To set request fields, pass in keyword arguments.
2567
+ # request = Google::Cloud::ContactCenterInsights::V1::CalculateStatsRequest.new
2568
+ #
2569
+ # # Call the calculate_stats method.
2570
+ # result = client.calculate_stats request
2571
+ #
2572
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::CalculateStatsResponse.
2573
+ # p result
2574
+ #
1985
2575
  def calculate_stats request, options = nil
1986
2576
  raise ::ArgumentError, "request must be provided" if request.nil?
1987
2577
 
@@ -1999,9 +2589,11 @@ module Google
1999
2589
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
2000
2590
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2001
2591
 
2002
- header_params = {
2003
- "location" => request.location
2004
- }
2592
+ header_params = {}
2593
+ if request.location
2594
+ header_params["location"] = request.location
2595
+ end
2596
+
2005
2597
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2006
2598
  metadata[:"x-goog-request-params"] ||= request_params_header
2007
2599
 
@@ -2050,6 +2642,21 @@ module Google
2050
2642
  #
2051
2643
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2052
2644
  #
2645
+ # @example Basic example
2646
+ # require "google/cloud/contact_center_insights/v1"
2647
+ #
2648
+ # # Create a client object. The client can be reused for multiple calls.
2649
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2650
+ #
2651
+ # # Create a request. To set request fields, pass in keyword arguments.
2652
+ # request = Google::Cloud::ContactCenterInsights::V1::GetSettingsRequest.new
2653
+ #
2654
+ # # Call the get_settings method.
2655
+ # result = client.get_settings request
2656
+ #
2657
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Settings.
2658
+ # p result
2659
+ #
2053
2660
  def get_settings request, options = nil
2054
2661
  raise ::ArgumentError, "request must be provided" if request.nil?
2055
2662
 
@@ -2067,9 +2674,11 @@ module Google
2067
2674
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
2068
2675
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2069
2676
 
2070
- header_params = {
2071
- "name" => request.name
2072
- }
2677
+ header_params = {}
2678
+ if request.name
2679
+ header_params["name"] = request.name
2680
+ end
2681
+
2073
2682
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2074
2683
  metadata[:"x-goog-request-params"] ||= request_params_header
2075
2684
 
@@ -2120,6 +2729,21 @@ module Google
2120
2729
  #
2121
2730
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2122
2731
  #
2732
+ # @example Basic example
2733
+ # require "google/cloud/contact_center_insights/v1"
2734
+ #
2735
+ # # Create a client object. The client can be reused for multiple calls.
2736
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2737
+ #
2738
+ # # Create a request. To set request fields, pass in keyword arguments.
2739
+ # request = Google::Cloud::ContactCenterInsights::V1::UpdateSettingsRequest.new
2740
+ #
2741
+ # # Call the update_settings method.
2742
+ # result = client.update_settings request
2743
+ #
2744
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Settings.
2745
+ # p result
2746
+ #
2123
2747
  def update_settings request, options = nil
2124
2748
  raise ::ArgumentError, "request must be provided" if request.nil?
2125
2749
 
@@ -2137,9 +2761,11 @@ module Google
2137
2761
  gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
2138
2762
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2139
2763
 
2140
- header_params = {
2141
- "settings.name" => request.settings.name
2142
- }
2764
+ header_params = {}
2765
+ if request.settings&.name
2766
+ header_params["settings.name"] = request.settings.name
2767
+ end
2768
+
2143
2769
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2144
2770
  metadata[:"x-goog-request-params"] ||= request_params_header
2145
2771
 
@@ -2159,6 +2785,454 @@ module Google
2159
2785
  raise ::Google::Cloud::Error.from_error(e)
2160
2786
  end
2161
2787
 
2788
+ ##
2789
+ # Creates a view.
2790
+ #
2791
+ # @overload create_view(request, options = nil)
2792
+ # Pass arguments to `create_view` via a request object, either of type
2793
+ # {::Google::Cloud::ContactCenterInsights::V1::CreateViewRequest} or an equivalent Hash.
2794
+ #
2795
+ # @param request [::Google::Cloud::ContactCenterInsights::V1::CreateViewRequest, ::Hash]
2796
+ # A request object representing the call parameters. Required. To specify no
2797
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2798
+ # @param options [::Gapic::CallOptions, ::Hash]
2799
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2800
+ #
2801
+ # @overload create_view(parent: nil, view: nil)
2802
+ # Pass arguments to `create_view` via keyword arguments. Note that at
2803
+ # least one keyword argument is required. To specify no parameters, or to keep all
2804
+ # the default parameter values, pass an empty Hash as a request object (see above).
2805
+ #
2806
+ # @param parent [::String]
2807
+ # Required. The parent resource of the view. Required. The location to create
2808
+ # a view for.
2809
+ # Format: `projects/<Project ID>/locations/<Location ID>` or
2810
+ # `projects/<Project Number>/locations/<Location ID>`
2811
+ # @param view [::Google::Cloud::ContactCenterInsights::V1::View, ::Hash]
2812
+ # Required. The view resource to create.
2813
+ #
2814
+ # @yield [response, operation] Access the result along with the RPC operation
2815
+ # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::View]
2816
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2817
+ #
2818
+ # @return [::Google::Cloud::ContactCenterInsights::V1::View]
2819
+ #
2820
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2821
+ #
2822
+ # @example Basic example
2823
+ # require "google/cloud/contact_center_insights/v1"
2824
+ #
2825
+ # # Create a client object. The client can be reused for multiple calls.
2826
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2827
+ #
2828
+ # # Create a request. To set request fields, pass in keyword arguments.
2829
+ # request = Google::Cloud::ContactCenterInsights::V1::CreateViewRequest.new
2830
+ #
2831
+ # # Call the create_view method.
2832
+ # result = client.create_view request
2833
+ #
2834
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::View.
2835
+ # p result
2836
+ #
2837
+ def create_view request, options = nil
2838
+ raise ::ArgumentError, "request must be provided" if request.nil?
2839
+
2840
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::CreateViewRequest
2841
+
2842
+ # Converts hash and nil to an options object
2843
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2844
+
2845
+ # Customize the options with defaults
2846
+ metadata = @config.rpcs.create_view.metadata.to_h
2847
+
2848
+ # Set x-goog-api-client and x-goog-user-project headers
2849
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2850
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2851
+ gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
2852
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2853
+
2854
+ header_params = {}
2855
+ if request.parent
2856
+ header_params["parent"] = request.parent
2857
+ end
2858
+
2859
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2860
+ metadata[:"x-goog-request-params"] ||= request_params_header
2861
+
2862
+ options.apply_defaults timeout: @config.rpcs.create_view.timeout,
2863
+ metadata: metadata,
2864
+ retry_policy: @config.rpcs.create_view.retry_policy
2865
+
2866
+ options.apply_defaults timeout: @config.timeout,
2867
+ metadata: @config.metadata,
2868
+ retry_policy: @config.retry_policy
2869
+
2870
+ @contact_center_insights_stub.call_rpc :create_view, request, options: options do |response, operation|
2871
+ yield response, operation if block_given?
2872
+ return response
2873
+ end
2874
+ rescue ::GRPC::BadStatus => e
2875
+ raise ::Google::Cloud::Error.from_error(e)
2876
+ end
2877
+
2878
+ ##
2879
+ # Gets a view.
2880
+ #
2881
+ # @overload get_view(request, options = nil)
2882
+ # Pass arguments to `get_view` via a request object, either of type
2883
+ # {::Google::Cloud::ContactCenterInsights::V1::GetViewRequest} or an equivalent Hash.
2884
+ #
2885
+ # @param request [::Google::Cloud::ContactCenterInsights::V1::GetViewRequest, ::Hash]
2886
+ # A request object representing the call parameters. Required. To specify no
2887
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2888
+ # @param options [::Gapic::CallOptions, ::Hash]
2889
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2890
+ #
2891
+ # @overload get_view(name: nil)
2892
+ # Pass arguments to `get_view` via keyword arguments. Note that at
2893
+ # least one keyword argument is required. To specify no parameters, or to keep all
2894
+ # the default parameter values, pass an empty Hash as a request object (see above).
2895
+ #
2896
+ # @param name [::String]
2897
+ # Required. The name of the view to get.
2898
+ #
2899
+ # @yield [response, operation] Access the result along with the RPC operation
2900
+ # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::View]
2901
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2902
+ #
2903
+ # @return [::Google::Cloud::ContactCenterInsights::V1::View]
2904
+ #
2905
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2906
+ #
2907
+ # @example Basic example
2908
+ # require "google/cloud/contact_center_insights/v1"
2909
+ #
2910
+ # # Create a client object. The client can be reused for multiple calls.
2911
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
2912
+ #
2913
+ # # Create a request. To set request fields, pass in keyword arguments.
2914
+ # request = Google::Cloud::ContactCenterInsights::V1::GetViewRequest.new
2915
+ #
2916
+ # # Call the get_view method.
2917
+ # result = client.get_view request
2918
+ #
2919
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::View.
2920
+ # p result
2921
+ #
2922
+ def get_view request, options = nil
2923
+ raise ::ArgumentError, "request must be provided" if request.nil?
2924
+
2925
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::GetViewRequest
2926
+
2927
+ # Converts hash and nil to an options object
2928
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2929
+
2930
+ # Customize the options with defaults
2931
+ metadata = @config.rpcs.get_view.metadata.to_h
2932
+
2933
+ # Set x-goog-api-client and x-goog-user-project headers
2934
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2935
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2936
+ gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
2937
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2938
+
2939
+ header_params = {}
2940
+ if request.name
2941
+ header_params["name"] = request.name
2942
+ end
2943
+
2944
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2945
+ metadata[:"x-goog-request-params"] ||= request_params_header
2946
+
2947
+ options.apply_defaults timeout: @config.rpcs.get_view.timeout,
2948
+ metadata: metadata,
2949
+ retry_policy: @config.rpcs.get_view.retry_policy
2950
+
2951
+ options.apply_defaults timeout: @config.timeout,
2952
+ metadata: @config.metadata,
2953
+ retry_policy: @config.retry_policy
2954
+
2955
+ @contact_center_insights_stub.call_rpc :get_view, request, options: options do |response, operation|
2956
+ yield response, operation if block_given?
2957
+ return response
2958
+ end
2959
+ rescue ::GRPC::BadStatus => e
2960
+ raise ::Google::Cloud::Error.from_error(e)
2961
+ end
2962
+
2963
+ ##
2964
+ # Lists views.
2965
+ #
2966
+ # @overload list_views(request, options = nil)
2967
+ # Pass arguments to `list_views` via a request object, either of type
2968
+ # {::Google::Cloud::ContactCenterInsights::V1::ListViewsRequest} or an equivalent Hash.
2969
+ #
2970
+ # @param request [::Google::Cloud::ContactCenterInsights::V1::ListViewsRequest, ::Hash]
2971
+ # A request object representing the call parameters. Required. To specify no
2972
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2973
+ # @param options [::Gapic::CallOptions, ::Hash]
2974
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2975
+ #
2976
+ # @overload list_views(parent: nil, page_size: nil, page_token: nil)
2977
+ # Pass arguments to `list_views` via keyword arguments. Note that at
2978
+ # least one keyword argument is required. To specify no parameters, or to keep all
2979
+ # the default parameter values, pass an empty Hash as a request object (see above).
2980
+ #
2981
+ # @param parent [::String]
2982
+ # Required. The parent resource of the views.
2983
+ # @param page_size [::Integer]
2984
+ # The maximum number of views to return in the response. If this
2985
+ # value is zero, the service will select a default size. A call may return
2986
+ # fewer objects than requested. A non-empty `next_page_token` in the response
2987
+ # indicates that more data is available.
2988
+ # @param page_token [::String]
2989
+ # The value returned by the last `ListViewsResponse`; indicates
2990
+ # that this is a continuation of a prior `ListViews` call and
2991
+ # the system should return the next page of data.
2992
+ #
2993
+ # @yield [response, operation] Access the result along with the RPC operation
2994
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::View>]
2995
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2996
+ #
2997
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::ContactCenterInsights::V1::View>]
2998
+ #
2999
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3000
+ #
3001
+ # @example Basic example
3002
+ # require "google/cloud/contact_center_insights/v1"
3003
+ #
3004
+ # # Create a client object. The client can be reused for multiple calls.
3005
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
3006
+ #
3007
+ # # Create a request. To set request fields, pass in keyword arguments.
3008
+ # request = Google::Cloud::ContactCenterInsights::V1::ListViewsRequest.new
3009
+ #
3010
+ # # Call the list_views method.
3011
+ # result = client.list_views request
3012
+ #
3013
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3014
+ # # iterate over all elements by calling #each, and the enumerable
3015
+ # # will lazily make API calls to fetch subsequent pages. Other
3016
+ # # methods are also available for managing paging directly.
3017
+ # result.each do |response|
3018
+ # # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::View.
3019
+ # p response
3020
+ # end
3021
+ #
3022
+ def list_views request, options = nil
3023
+ raise ::ArgumentError, "request must be provided" if request.nil?
3024
+
3025
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::ListViewsRequest
3026
+
3027
+ # Converts hash and nil to an options object
3028
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3029
+
3030
+ # Customize the options with defaults
3031
+ metadata = @config.rpcs.list_views.metadata.to_h
3032
+
3033
+ # Set x-goog-api-client and x-goog-user-project headers
3034
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3035
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3036
+ gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
3037
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3038
+
3039
+ header_params = {}
3040
+ if request.parent
3041
+ header_params["parent"] = request.parent
3042
+ end
3043
+
3044
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3045
+ metadata[:"x-goog-request-params"] ||= request_params_header
3046
+
3047
+ options.apply_defaults timeout: @config.rpcs.list_views.timeout,
3048
+ metadata: metadata,
3049
+ retry_policy: @config.rpcs.list_views.retry_policy
3050
+
3051
+ options.apply_defaults timeout: @config.timeout,
3052
+ metadata: @config.metadata,
3053
+ retry_policy: @config.retry_policy
3054
+
3055
+ @contact_center_insights_stub.call_rpc :list_views, request, options: options do |response, operation|
3056
+ response = ::Gapic::PagedEnumerable.new @contact_center_insights_stub, :list_views, request, response, operation, options
3057
+ yield response, operation if block_given?
3058
+ return response
3059
+ end
3060
+ rescue ::GRPC::BadStatus => e
3061
+ raise ::Google::Cloud::Error.from_error(e)
3062
+ end
3063
+
3064
+ ##
3065
+ # Updates a view.
3066
+ #
3067
+ # @overload update_view(request, options = nil)
3068
+ # Pass arguments to `update_view` via a request object, either of type
3069
+ # {::Google::Cloud::ContactCenterInsights::V1::UpdateViewRequest} or an equivalent Hash.
3070
+ #
3071
+ # @param request [::Google::Cloud::ContactCenterInsights::V1::UpdateViewRequest, ::Hash]
3072
+ # A request object representing the call parameters. Required. To specify no
3073
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3074
+ # @param options [::Gapic::CallOptions, ::Hash]
3075
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3076
+ #
3077
+ # @overload update_view(view: nil, update_mask: nil)
3078
+ # Pass arguments to `update_view` via keyword arguments. Note that at
3079
+ # least one keyword argument is required. To specify no parameters, or to keep all
3080
+ # the default parameter values, pass an empty Hash as a request object (see above).
3081
+ #
3082
+ # @param view [::Google::Cloud::ContactCenterInsights::V1::View, ::Hash]
3083
+ # Required. The new view.
3084
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
3085
+ # The list of fields to be updated.
3086
+ #
3087
+ # @yield [response, operation] Access the result along with the RPC operation
3088
+ # @yieldparam response [::Google::Cloud::ContactCenterInsights::V1::View]
3089
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3090
+ #
3091
+ # @return [::Google::Cloud::ContactCenterInsights::V1::View]
3092
+ #
3093
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3094
+ #
3095
+ # @example Basic example
3096
+ # require "google/cloud/contact_center_insights/v1"
3097
+ #
3098
+ # # Create a client object. The client can be reused for multiple calls.
3099
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
3100
+ #
3101
+ # # Create a request. To set request fields, pass in keyword arguments.
3102
+ # request = Google::Cloud::ContactCenterInsights::V1::UpdateViewRequest.new
3103
+ #
3104
+ # # Call the update_view method.
3105
+ # result = client.update_view request
3106
+ #
3107
+ # # The returned object is of type Google::Cloud::ContactCenterInsights::V1::View.
3108
+ # p result
3109
+ #
3110
+ def update_view request, options = nil
3111
+ raise ::ArgumentError, "request must be provided" if request.nil?
3112
+
3113
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::UpdateViewRequest
3114
+
3115
+ # Converts hash and nil to an options object
3116
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3117
+
3118
+ # Customize the options with defaults
3119
+ metadata = @config.rpcs.update_view.metadata.to_h
3120
+
3121
+ # Set x-goog-api-client and x-goog-user-project headers
3122
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3123
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3124
+ gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
3125
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3126
+
3127
+ header_params = {}
3128
+ if request.view&.name
3129
+ header_params["view.name"] = request.view.name
3130
+ end
3131
+
3132
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3133
+ metadata[:"x-goog-request-params"] ||= request_params_header
3134
+
3135
+ options.apply_defaults timeout: @config.rpcs.update_view.timeout,
3136
+ metadata: metadata,
3137
+ retry_policy: @config.rpcs.update_view.retry_policy
3138
+
3139
+ options.apply_defaults timeout: @config.timeout,
3140
+ metadata: @config.metadata,
3141
+ retry_policy: @config.retry_policy
3142
+
3143
+ @contact_center_insights_stub.call_rpc :update_view, request, options: options do |response, operation|
3144
+ yield response, operation if block_given?
3145
+ return response
3146
+ end
3147
+ rescue ::GRPC::BadStatus => e
3148
+ raise ::Google::Cloud::Error.from_error(e)
3149
+ end
3150
+
3151
+ ##
3152
+ # Deletes a view.
3153
+ #
3154
+ # @overload delete_view(request, options = nil)
3155
+ # Pass arguments to `delete_view` via a request object, either of type
3156
+ # {::Google::Cloud::ContactCenterInsights::V1::DeleteViewRequest} or an equivalent Hash.
3157
+ #
3158
+ # @param request [::Google::Cloud::ContactCenterInsights::V1::DeleteViewRequest, ::Hash]
3159
+ # A request object representing the call parameters. Required. To specify no
3160
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3161
+ # @param options [::Gapic::CallOptions, ::Hash]
3162
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3163
+ #
3164
+ # @overload delete_view(name: nil)
3165
+ # Pass arguments to `delete_view` via keyword arguments. Note that at
3166
+ # least one keyword argument is required. To specify no parameters, or to keep all
3167
+ # the default parameter values, pass an empty Hash as a request object (see above).
3168
+ #
3169
+ # @param name [::String]
3170
+ # Required. The name of the view to delete.
3171
+ #
3172
+ # @yield [response, operation] Access the result along with the RPC operation
3173
+ # @yieldparam response [::Google::Protobuf::Empty]
3174
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3175
+ #
3176
+ # @return [::Google::Protobuf::Empty]
3177
+ #
3178
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3179
+ #
3180
+ # @example Basic example
3181
+ # require "google/cloud/contact_center_insights/v1"
3182
+ #
3183
+ # # Create a client object. The client can be reused for multiple calls.
3184
+ # client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new
3185
+ #
3186
+ # # Create a request. To set request fields, pass in keyword arguments.
3187
+ # request = Google::Cloud::ContactCenterInsights::V1::DeleteViewRequest.new
3188
+ #
3189
+ # # Call the delete_view method.
3190
+ # result = client.delete_view request
3191
+ #
3192
+ # # The returned object is of type Google::Protobuf::Empty.
3193
+ # p result
3194
+ #
3195
+ def delete_view request, options = nil
3196
+ raise ::ArgumentError, "request must be provided" if request.nil?
3197
+
3198
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ContactCenterInsights::V1::DeleteViewRequest
3199
+
3200
+ # Converts hash and nil to an options object
3201
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3202
+
3203
+ # Customize the options with defaults
3204
+ metadata = @config.rpcs.delete_view.metadata.to_h
3205
+
3206
+ # Set x-goog-api-client and x-goog-user-project headers
3207
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3208
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3209
+ gapic_version: ::Google::Cloud::ContactCenterInsights::V1::VERSION
3210
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3211
+
3212
+ header_params = {}
3213
+ if request.name
3214
+ header_params["name"] = request.name
3215
+ end
3216
+
3217
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3218
+ metadata[:"x-goog-request-params"] ||= request_params_header
3219
+
3220
+ options.apply_defaults timeout: @config.rpcs.delete_view.timeout,
3221
+ metadata: metadata,
3222
+ retry_policy: @config.rpcs.delete_view.retry_policy
3223
+
3224
+ options.apply_defaults timeout: @config.timeout,
3225
+ metadata: @config.metadata,
3226
+ retry_policy: @config.retry_policy
3227
+
3228
+ @contact_center_insights_stub.call_rpc :delete_view, request, options: options do |response, operation|
3229
+ yield response, operation if block_given?
3230
+ return response
3231
+ end
3232
+ rescue ::GRPC::BadStatus => e
3233
+ raise ::Google::Cloud::Error.from_error(e)
3234
+ end
3235
+
2162
3236
  ##
2163
3237
  # Configuration class for the ContactCenterInsights API.
2164
3238
  #
@@ -2420,6 +3494,11 @@ module Google
2420
3494
  #
2421
3495
  attr_reader :delete_phrase_matcher
2422
3496
  ##
3497
+ # RPC-specific configuration for `update_phrase_matcher`
3498
+ # @return [::Gapic::Config::Method]
3499
+ #
3500
+ attr_reader :update_phrase_matcher
3501
+ ##
2423
3502
  # RPC-specific configuration for `calculate_stats`
2424
3503
  # @return [::Gapic::Config::Method]
2425
3504
  #
@@ -2434,6 +3513,31 @@ module Google
2434
3513
  # @return [::Gapic::Config::Method]
2435
3514
  #
2436
3515
  attr_reader :update_settings
3516
+ ##
3517
+ # RPC-specific configuration for `create_view`
3518
+ # @return [::Gapic::Config::Method]
3519
+ #
3520
+ attr_reader :create_view
3521
+ ##
3522
+ # RPC-specific configuration for `get_view`
3523
+ # @return [::Gapic::Config::Method]
3524
+ #
3525
+ attr_reader :get_view
3526
+ ##
3527
+ # RPC-specific configuration for `list_views`
3528
+ # @return [::Gapic::Config::Method]
3529
+ #
3530
+ attr_reader :list_views
3531
+ ##
3532
+ # RPC-specific configuration for `update_view`
3533
+ # @return [::Gapic::Config::Method]
3534
+ #
3535
+ attr_reader :update_view
3536
+ ##
3537
+ # RPC-specific configuration for `delete_view`
3538
+ # @return [::Gapic::Config::Method]
3539
+ #
3540
+ attr_reader :delete_view
2437
3541
 
2438
3542
  # @private
2439
3543
  def initialize parent_rpcs = nil
@@ -2487,12 +3591,24 @@ module Google
2487
3591
  @list_phrase_matchers = ::Gapic::Config::Method.new list_phrase_matchers_config
2488
3592
  delete_phrase_matcher_config = parent_rpcs.delete_phrase_matcher if parent_rpcs.respond_to? :delete_phrase_matcher
2489
3593
  @delete_phrase_matcher = ::Gapic::Config::Method.new delete_phrase_matcher_config
3594
+ update_phrase_matcher_config = parent_rpcs.update_phrase_matcher if parent_rpcs.respond_to? :update_phrase_matcher
3595
+ @update_phrase_matcher = ::Gapic::Config::Method.new update_phrase_matcher_config
2490
3596
  calculate_stats_config = parent_rpcs.calculate_stats if parent_rpcs.respond_to? :calculate_stats
2491
3597
  @calculate_stats = ::Gapic::Config::Method.new calculate_stats_config
2492
3598
  get_settings_config = parent_rpcs.get_settings if parent_rpcs.respond_to? :get_settings
2493
3599
  @get_settings = ::Gapic::Config::Method.new get_settings_config
2494
3600
  update_settings_config = parent_rpcs.update_settings if parent_rpcs.respond_to? :update_settings
2495
3601
  @update_settings = ::Gapic::Config::Method.new update_settings_config
3602
+ create_view_config = parent_rpcs.create_view if parent_rpcs.respond_to? :create_view
3603
+ @create_view = ::Gapic::Config::Method.new create_view_config
3604
+ get_view_config = parent_rpcs.get_view if parent_rpcs.respond_to? :get_view
3605
+ @get_view = ::Gapic::Config::Method.new get_view_config
3606
+ list_views_config = parent_rpcs.list_views if parent_rpcs.respond_to? :list_views
3607
+ @list_views = ::Gapic::Config::Method.new list_views_config
3608
+ update_view_config = parent_rpcs.update_view if parent_rpcs.respond_to? :update_view
3609
+ @update_view = ::Gapic::Config::Method.new update_view_config
3610
+ delete_view_config = parent_rpcs.delete_view if parent_rpcs.respond_to? :delete_view
3611
+ @delete_view = ::Gapic::Config::Method.new delete_view_config
2496
3612
 
2497
3613
  yield self if block_given?
2498
3614
  end