google-cloud-contact_center_insights-v1 1.2.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -213,7 +213,7 @@ module Google
213
213
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
214
214
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
215
215
  yield response, operation if block_given?
216
- return response
216
+ throw :response, response
217
217
  end
218
218
  rescue ::GRPC::BadStatus => e
219
219
  raise ::Google::Cloud::Error.from_error(e)
@@ -309,7 +309,7 @@ module Google
309
309
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
310
310
  response = ::Gapic::Operation.new response, @operations_client, options: options
311
311
  yield response, operation if block_given?
312
- return response
312
+ throw :response, response
313
313
  end
314
314
  rescue ::GRPC::BadStatus => e
315
315
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +398,6 @@ module Google
398
398
 
399
399
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
400
400
  yield response, operation if block_given?
401
- return response
402
401
  end
403
402
  rescue ::GRPC::BadStatus => e
404
403
  raise ::Google::Cloud::Error.from_error(e)
@@ -494,7 +493,6 @@ module Google
494
493
 
495
494
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
496
495
  yield response, operation if block_given?
497
- return response
498
496
  end
499
497
  rescue ::GRPC::BadStatus => e
500
498
  raise ::Google::Cloud::Error.from_error(e)
@@ -592,7 +590,7 @@ module Google
592
590
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
593
591
  response = ::Gapic::Operation.new response, @operations_client, options: options
594
592
  yield response, operation if block_given?
595
- return response
593
+ throw :response, response
596
594
  end
597
595
  rescue ::GRPC::BadStatus => e
598
596
  raise ::Google::Cloud::Error.from_error(e)
@@ -681,6 +679,11 @@ module Google
681
679
  # default endpoint URL. The default value of nil uses the environment
682
680
  # universe (usually the default "googleapis.com" universe).
683
681
  # @return [::String,nil]
682
+ # @!attribute [rw] logger
683
+ # A custom logger to use for request/response debug logging, or the value
684
+ # `:default` (the default) to construct a default logger, or `nil` to
685
+ # explicitly disable logging.
686
+ # @return [::Logger,:default,nil]
684
687
  #
685
688
  class Configuration
686
689
  extend ::Gapic::Config
@@ -705,6 +708,7 @@ module Google
705
708
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
706
709
  config_attr :quota_project, nil, ::String, nil
707
710
  config_attr :universe_domain, nil, ::String, nil
711
+ config_attr :logger, :default, ::Logger, nil, :default
708
712
 
709
713
  # @private
710
714
  def initialize parent_config = nil
@@ -27,22 +27,52 @@ module Google
27
27
  ##
28
28
  # Create a fully-qualified Analysis resource string.
29
29
  #
30
- # The resource will be in the following format:
30
+ # @overload analysis_path(project:, location:, conversation:, analysis:)
31
+ # The resource will be in the following format:
31
32
  #
32
- # `projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}`
33
+ # `projects/{project}/locations/{location}/conversations/{conversation}/analyses/{analysis}`
33
34
  #
34
- # @param project [String]
35
- # @param location [String]
36
- # @param conversation [String]
37
- # @param analysis [String]
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param conversation [String]
38
+ # @param analysis [String]
39
+ #
40
+ # @overload analysis_path(project:, location:, authorized_view_set:, authorized_view:, conversation:, analysis:)
41
+ # The resource will be in the following format:
42
+ #
43
+ # `projects/{project}/locations/{location}/authorizedViewSets/{authorized_view_set}/authorizedViews/{authorized_view}/conversations/{conversation}/analyses/{analysis}`
44
+ #
45
+ # @param project [String]
46
+ # @param location [String]
47
+ # @param authorized_view_set [String]
48
+ # @param authorized_view [String]
49
+ # @param conversation [String]
50
+ # @param analysis [String]
38
51
  #
39
52
  # @return [::String]
40
- def analysis_path project:, location:, conversation:, analysis:
41
- raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
42
- raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
43
- raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
53
+ def analysis_path **args
54
+ resources = {
55
+ "analysis:conversation:location:project" => (proc do |project:, location:, conversation:, analysis:|
56
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
57
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
58
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
59
+
60
+ "projects/#{project}/locations/#{location}/conversations/#{conversation}/analyses/#{analysis}"
61
+ end),
62
+ "analysis:authorized_view:authorized_view_set:conversation:location:project" => (proc do |project:, location:, authorized_view_set:, authorized_view:, conversation:, analysis:|
63
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
64
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
65
+ raise ::ArgumentError, "authorized_view_set cannot contain /" if authorized_view_set.to_s.include? "/"
66
+ raise ::ArgumentError, "authorized_view cannot contain /" if authorized_view.to_s.include? "/"
67
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
68
+
69
+ "projects/#{project}/locations/#{location}/authorizedViewSets/#{authorized_view_set}/authorizedViews/#{authorized_view}/conversations/#{conversation}/analyses/#{analysis}"
70
+ end)
71
+ }
44
72
 
45
- "projects/#{project}/locations/#{location}/conversations/#{conversation}/analyses/#{analysis}"
73
+ resource = resources[args.keys.sort.join(":")]
74
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
75
+ resource.call(**args)
46
76
  end
47
77
 
48
78
  ##
@@ -67,20 +97,48 @@ module Google
67
97
  ##
68
98
  # Create a fully-qualified Conversation resource string.
69
99
  #
70
- # The resource will be in the following format:
100
+ # @overload conversation_path(project:, location:, conversation:)
101
+ # The resource will be in the following format:
71
102
  #
72
- # `projects/{project}/locations/{location}/conversations/{conversation}`
103
+ # `projects/{project}/locations/{location}/conversations/{conversation}`
73
104
  #
74
- # @param project [String]
75
- # @param location [String]
76
- # @param conversation [String]
105
+ # @param project [String]
106
+ # @param location [String]
107
+ # @param conversation [String]
108
+ #
109
+ # @overload conversation_path(project:, location:, authorized_view_set:, authorized_view:, conversation:)
110
+ # The resource will be in the following format:
111
+ #
112
+ # `projects/{project}/locations/{location}/authorizedViewSets/{authorized_view_set}/authorizedViews/{authorized_view}/conversations/{conversation}`
113
+ #
114
+ # @param project [String]
115
+ # @param location [String]
116
+ # @param authorized_view_set [String]
117
+ # @param authorized_view [String]
118
+ # @param conversation [String]
77
119
  #
78
120
  # @return [::String]
79
- def conversation_path project:, location:, conversation:
80
- raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
81
- raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
121
+ def conversation_path **args
122
+ resources = {
123
+ "conversation:location:project" => (proc do |project:, location:, conversation:|
124
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
125
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
126
+
127
+ "projects/#{project}/locations/#{location}/conversations/#{conversation}"
128
+ end),
129
+ "authorized_view:authorized_view_set:conversation:location:project" => (proc do |project:, location:, authorized_view_set:, authorized_view:, conversation:|
130
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
131
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
132
+ raise ::ArgumentError, "authorized_view_set cannot contain /" if authorized_view_set.to_s.include? "/"
133
+ raise ::ArgumentError, "authorized_view cannot contain /" if authorized_view.to_s.include? "/"
134
+
135
+ "projects/#{project}/locations/#{location}/authorizedViewSets/#{authorized_view_set}/authorizedViews/#{authorized_view}/conversations/#{conversation}"
136
+ end)
137
+ }
82
138
 
83
- "projects/#{project}/locations/#{location}/conversations/#{conversation}"
139
+ resource = resources[args.keys.sort.join(":")]
140
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
141
+ resource.call(**args)
84
142
  end
85
143
 
86
144
  ##
@@ -122,22 +180,52 @@ module Google
122
180
  ##
123
181
  # Create a fully-qualified FeedbackLabel resource string.
124
182
  #
125
- # The resource will be in the following format:
183
+ # @overload feedback_label_path(project:, location:, conversation:, feedback_label:)
184
+ # The resource will be in the following format:
126
185
  #
127
- # `projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label}`
186
+ # `projects/{project}/locations/{location}/conversations/{conversation}/feedbackLabels/{feedback_label}`
128
187
  #
129
- # @param project [String]
130
- # @param location [String]
131
- # @param conversation [String]
132
- # @param feedback_label [String]
188
+ # @param project [String]
189
+ # @param location [String]
190
+ # @param conversation [String]
191
+ # @param feedback_label [String]
192
+ #
193
+ # @overload feedback_label_path(project:, location:, authorized_view_set:, authorized_view:, conversation:, feedback_label:)
194
+ # The resource will be in the following format:
195
+ #
196
+ # `projects/{project}/locations/{location}/authorizedViewSets/{authorized_view_set}/authorizedViews/{authorized_view}/conversations/{conversation}/feedbackLabels/{feedback_label}`
197
+ #
198
+ # @param project [String]
199
+ # @param location [String]
200
+ # @param authorized_view_set [String]
201
+ # @param authorized_view [String]
202
+ # @param conversation [String]
203
+ # @param feedback_label [String]
133
204
  #
134
205
  # @return [::String]
135
- def feedback_label_path project:, location:, conversation:, feedback_label:
136
- raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
137
- raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
138
- raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
206
+ def feedback_label_path **args
207
+ resources = {
208
+ "conversation:feedback_label:location:project" => (proc do |project:, location:, conversation:, feedback_label:|
209
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
210
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
211
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
139
212
 
140
- "projects/#{project}/locations/#{location}/conversations/#{conversation}/feedbackLabels/#{feedback_label}"
213
+ "projects/#{project}/locations/#{location}/conversations/#{conversation}/feedbackLabels/#{feedback_label}"
214
+ end),
215
+ "authorized_view:authorized_view_set:conversation:feedback_label:location:project" => (proc do |project:, location:, authorized_view_set:, authorized_view:, conversation:, feedback_label:|
216
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
217
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
218
+ raise ::ArgumentError, "authorized_view_set cannot contain /" if authorized_view_set.to_s.include? "/"
219
+ raise ::ArgumentError, "authorized_view cannot contain /" if authorized_view.to_s.include? "/"
220
+ raise ::ArgumentError, "conversation cannot contain /" if conversation.to_s.include? "/"
221
+
222
+ "projects/#{project}/locations/#{location}/authorizedViewSets/#{authorized_view_set}/authorizedViews/#{authorized_view}/conversations/#{conversation}/feedbackLabels/#{feedback_label}"
223
+ end)
224
+ }
225
+
226
+ resource = resources[args.keys.sort.join(":")]
227
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
228
+ resource.call(**args)
141
229
  end
142
230
 
143
231
  ##