google-cloud-data_labeling-v1beta1 0.3.1 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all DataLabelingService clients:
47
- #
48
- # ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all DataLabelingService clients
47
+ # ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -69,68 +68,44 @@ module Google
69
68
 
70
69
  default_config.rpcs.get_dataset.timeout = 30.0
71
70
  default_config.rpcs.get_dataset.retry_policy = {
72
- initial_delay: 0.1,
73
- max_delay: 30.0,
74
- multiplier: 1.3,
75
- retry_codes: [4, 14]
71
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
76
72
  }
77
73
 
78
74
  default_config.rpcs.list_datasets.timeout = 30.0
79
75
  default_config.rpcs.list_datasets.retry_policy = {
80
- initial_delay: 0.1,
81
- max_delay: 30.0,
82
- multiplier: 1.3,
83
- retry_codes: [4, 14]
76
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
84
77
  }
85
78
 
86
79
  default_config.rpcs.delete_dataset.timeout = 30.0
87
80
  default_config.rpcs.delete_dataset.retry_policy = {
88
- initial_delay: 0.1,
89
- max_delay: 30.0,
90
- multiplier: 1.3,
91
- retry_codes: [4, 14]
81
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
92
82
  }
93
83
 
94
84
  default_config.rpcs.import_data.timeout = 30.0
95
85
 
96
86
  default_config.rpcs.export_data.timeout = 30.0
97
87
  default_config.rpcs.export_data.retry_policy = {
98
- initial_delay: 0.1,
99
- max_delay: 30.0,
100
- multiplier: 1.3,
101
- retry_codes: [4, 14]
88
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
102
89
  }
103
90
 
104
91
  default_config.rpcs.get_data_item.timeout = 30.0
105
92
  default_config.rpcs.get_data_item.retry_policy = {
106
- initial_delay: 0.1,
107
- max_delay: 30.0,
108
- multiplier: 1.3,
109
- retry_codes: [4, 14]
93
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
110
94
  }
111
95
 
112
96
  default_config.rpcs.list_data_items.timeout = 30.0
113
97
  default_config.rpcs.list_data_items.retry_policy = {
114
- initial_delay: 0.1,
115
- max_delay: 30.0,
116
- multiplier: 1.3,
117
- retry_codes: [4, 14]
98
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
118
99
  }
119
100
 
120
101
  default_config.rpcs.get_annotated_dataset.timeout = 30.0
121
102
  default_config.rpcs.get_annotated_dataset.retry_policy = {
122
- initial_delay: 0.1,
123
- max_delay: 30.0,
124
- multiplier: 1.3,
125
- retry_codes: [4, 14]
103
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
126
104
  }
127
105
 
128
106
  default_config.rpcs.list_annotated_datasets.timeout = 30.0
129
107
  default_config.rpcs.list_annotated_datasets.retry_policy = {
130
- initial_delay: 0.1,
131
- max_delay: 30.0,
132
- multiplier: 1.3,
133
- retry_codes: [4, 14]
108
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
134
109
  }
135
110
 
136
111
  default_config.rpcs.label_image.timeout = 30.0
@@ -141,86 +116,56 @@ module Google
141
116
 
142
117
  default_config.rpcs.get_example.timeout = 30.0
143
118
  default_config.rpcs.get_example.retry_policy = {
144
- initial_delay: 0.1,
145
- max_delay: 30.0,
146
- multiplier: 1.3,
147
- retry_codes: [4, 14]
119
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
148
120
  }
149
121
 
150
122
  default_config.rpcs.list_examples.timeout = 30.0
151
123
  default_config.rpcs.list_examples.retry_policy = {
152
- initial_delay: 0.1,
153
- max_delay: 30.0,
154
- multiplier: 1.3,
155
- retry_codes: [4, 14]
124
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
156
125
  }
157
126
 
158
127
  default_config.rpcs.create_annotation_spec_set.timeout = 30.0
159
128
 
160
129
  default_config.rpcs.get_annotation_spec_set.timeout = 30.0
161
130
  default_config.rpcs.get_annotation_spec_set.retry_policy = {
162
- initial_delay: 0.1,
163
- max_delay: 30.0,
164
- multiplier: 1.3,
165
- retry_codes: [4, 14]
131
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
166
132
  }
167
133
 
168
134
  default_config.rpcs.list_annotation_spec_sets.timeout = 30.0
169
135
  default_config.rpcs.list_annotation_spec_sets.retry_policy = {
170
- initial_delay: 0.1,
171
- max_delay: 30.0,
172
- multiplier: 1.3,
173
- retry_codes: [4, 14]
136
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
174
137
  }
175
138
 
176
139
  default_config.rpcs.delete_annotation_spec_set.timeout = 30.0
177
140
  default_config.rpcs.delete_annotation_spec_set.retry_policy = {
178
- initial_delay: 0.1,
179
- max_delay: 30.0,
180
- multiplier: 1.3,
181
- retry_codes: [4, 14]
141
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
182
142
  }
183
143
 
184
144
  default_config.rpcs.create_instruction.timeout = 30.0
185
145
 
186
146
  default_config.rpcs.get_instruction.timeout = 30.0
187
147
  default_config.rpcs.get_instruction.retry_policy = {
188
- initial_delay: 0.1,
189
- max_delay: 30.0,
190
- multiplier: 1.3,
191
- retry_codes: [4, 14]
148
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
192
149
  }
193
150
 
194
151
  default_config.rpcs.list_instructions.timeout = 30.0
195
152
  default_config.rpcs.list_instructions.retry_policy = {
196
- initial_delay: 0.1,
197
- max_delay: 30.0,
198
- multiplier: 1.3,
199
- retry_codes: [4, 14]
153
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
200
154
  }
201
155
 
202
156
  default_config.rpcs.delete_instruction.timeout = 30.0
203
157
  default_config.rpcs.delete_instruction.retry_policy = {
204
- initial_delay: 0.1,
205
- max_delay: 30.0,
206
- multiplier: 1.3,
207
- retry_codes: [4, 14]
158
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
208
159
  }
209
160
 
210
161
  default_config.rpcs.get_evaluation.timeout = 30.0
211
162
  default_config.rpcs.get_evaluation.retry_policy = {
212
- initial_delay: 0.1,
213
- max_delay: 30.0,
214
- multiplier: 1.3,
215
- retry_codes: [4, 14]
163
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
216
164
  }
217
165
 
218
166
  default_config.rpcs.search_evaluations.timeout = 30.0
219
167
  default_config.rpcs.search_evaluations.retry_policy = {
220
- initial_delay: 0.1,
221
- max_delay: 30.0,
222
- multiplier: 1.3,
223
- retry_codes: [4, 14]
168
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
224
169
  }
225
170
 
226
171
  default_config.rpcs.search_example_comparisons.timeout = 30.0
@@ -231,10 +176,7 @@ module Google
231
176
 
232
177
  default_config.rpcs.get_evaluation_job.timeout = 30.0
233
178
  default_config.rpcs.get_evaluation_job.retry_policy = {
234
- initial_delay: 0.1,
235
- max_delay: 30.0,
236
- multiplier: 1.3,
237
- retry_codes: [4, 14]
179
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
238
180
  }
239
181
 
240
182
  default_config.rpcs.pause_evaluation_job.timeout = 30.0
@@ -243,18 +185,12 @@ module Google
243
185
 
244
186
  default_config.rpcs.delete_evaluation_job.timeout = 30.0
245
187
  default_config.rpcs.delete_evaluation_job.retry_policy = {
246
- initial_delay: 0.1,
247
- max_delay: 30.0,
248
- multiplier: 1.3,
249
- retry_codes: [4, 14]
188
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
250
189
  }
251
190
 
252
191
  default_config.rpcs.list_evaluation_jobs.timeout = 30.0
253
192
  default_config.rpcs.list_evaluation_jobs.retry_policy = {
254
- initial_delay: 0.1,
255
- max_delay: 30.0,
256
- multiplier: 1.3,
257
- retry_codes: [4, 14]
193
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [4, 14]
258
194
  }
259
195
 
260
196
  default_config
@@ -286,19 +222,15 @@ module Google
286
222
  ##
287
223
  # Create a new DataLabelingService client object.
288
224
  #
289
- # ## Examples
290
- #
291
- # To create a new DataLabelingService client with the default
292
- # configuration:
293
- #
294
- # client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
225
+ # @example
295
226
  #
296
- # To create a new DataLabelingService client with a custom
297
- # configuration:
227
+ # # Create a client using the default configuration
228
+ # client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
298
229
  #
299
- # client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config|
300
- # config.timeout = 10.0
301
- # end
230
+ # # Create a client using a custom configuration
231
+ # client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config|
232
+ # config.timeout = 10.0
233
+ # end
302
234
  #
303
235
  # @yield [config] Configure the DataLabelingService client.
304
236
  # @yieldparam config [Client::Configuration]
@@ -318,14 +250,13 @@ module Google
318
250
 
319
251
  # Create credentials
320
252
  credentials = @config.credentials
321
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
253
+ # Use self-signed JWT if the endpoint is unchanged from default,
322
254
  # but only if the default endpoint does not have a region prefix.
323
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
324
- @config.endpoint == Client.configure.endpoint &&
255
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
325
256
  !@config.endpoint.split(".").first.include?("-")
326
257
  credentials ||= Credentials.default scope: @config.scope,
327
258
  enable_self_signed_jwt: enable_self_signed_jwt
328
- if credentials.is_a?(String) || credentials.is_a?(Hash)
259
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
329
260
  credentials = Credentials.new credentials, scope: @config.scope
330
261
  end
331
262
  @quota_project_id = @config.quota_project
@@ -333,6 +264,7 @@ module Google
333
264
 
334
265
  @operations_client = Operations.new do |config|
335
266
  config.credentials = credentials
267
+ config.quota_project = @quota_project_id
336
268
  config.endpoint = @config.endpoint
337
269
  end
338
270
 
@@ -386,6 +318,21 @@ module Google
386
318
  #
387
319
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
388
320
  #
321
+ # @example Basic example
322
+ # require "google/cloud/data_labeling/v1beta1"
323
+ #
324
+ # # Create a client object. The client can be reused for multiple calls.
325
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
326
+ #
327
+ # # Create a request. To set request fields, pass in keyword arguments.
328
+ # request = Google::Cloud::DataLabeling::V1beta1::CreateDatasetRequest.new
329
+ #
330
+ # # Call the create_dataset method.
331
+ # result = client.create_dataset request
332
+ #
333
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Dataset.
334
+ # p result
335
+ #
389
336
  def create_dataset request, options = nil
390
337
  raise ::ArgumentError, "request must be provided" if request.nil?
391
338
 
@@ -403,16 +350,20 @@ module Google
403
350
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
404
351
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
405
352
 
406
- header_params = {
407
- "parent" => request.parent
408
- }
353
+ header_params = {}
354
+ if request.parent
355
+ header_params["parent"] = request.parent
356
+ end
357
+
409
358
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
410
359
  metadata[:"x-goog-request-params"] ||= request_params_header
411
360
 
412
361
  options.apply_defaults timeout: @config.rpcs.create_dataset.timeout,
413
362
  metadata: metadata,
414
363
  retry_policy: @config.rpcs.create_dataset.retry_policy
415
- options.apply_defaults metadata: @config.metadata,
364
+
365
+ options.apply_defaults timeout: @config.timeout,
366
+ metadata: @config.metadata,
416
367
  retry_policy: @config.retry_policy
417
368
 
418
369
  @data_labeling_service_stub.call_rpc :create_dataset, request, options: options do |response, operation|
@@ -453,6 +404,21 @@ module Google
453
404
  #
454
405
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
455
406
  #
407
+ # @example Basic example
408
+ # require "google/cloud/data_labeling/v1beta1"
409
+ #
410
+ # # Create a client object. The client can be reused for multiple calls.
411
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
412
+ #
413
+ # # Create a request. To set request fields, pass in keyword arguments.
414
+ # request = Google::Cloud::DataLabeling::V1beta1::GetDatasetRequest.new
415
+ #
416
+ # # Call the get_dataset method.
417
+ # result = client.get_dataset request
418
+ #
419
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Dataset.
420
+ # p result
421
+ #
456
422
  def get_dataset request, options = nil
457
423
  raise ::ArgumentError, "request must be provided" if request.nil?
458
424
 
@@ -470,16 +436,20 @@ module Google
470
436
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
471
437
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
472
438
 
473
- header_params = {
474
- "name" => request.name
475
- }
439
+ header_params = {}
440
+ if request.name
441
+ header_params["name"] = request.name
442
+ end
443
+
476
444
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
477
445
  metadata[:"x-goog-request-params"] ||= request_params_header
478
446
 
479
447
  options.apply_defaults timeout: @config.rpcs.get_dataset.timeout,
480
448
  metadata: metadata,
481
449
  retry_policy: @config.rpcs.get_dataset.retry_policy
482
- options.apply_defaults metadata: @config.metadata,
450
+
451
+ options.apply_defaults timeout: @config.timeout,
452
+ metadata: @config.metadata,
483
453
  retry_policy: @config.retry_policy
484
454
 
485
455
  @data_labeling_service_stub.call_rpc :get_dataset, request, options: options do |response, operation|
@@ -531,6 +501,27 @@ module Google
531
501
  #
532
502
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
533
503
  #
504
+ # @example Basic example
505
+ # require "google/cloud/data_labeling/v1beta1"
506
+ #
507
+ # # Create a client object. The client can be reused for multiple calls.
508
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
509
+ #
510
+ # # Create a request. To set request fields, pass in keyword arguments.
511
+ # request = Google::Cloud::DataLabeling::V1beta1::ListDatasetsRequest.new
512
+ #
513
+ # # Call the list_datasets method.
514
+ # result = client.list_datasets request
515
+ #
516
+ # # The returned object is of type Gapic::PagedEnumerable. You can
517
+ # # iterate over all elements by calling #each, and the enumerable
518
+ # # will lazily make API calls to fetch subsequent pages. Other
519
+ # # methods are also available for managing paging directly.
520
+ # result.each do |response|
521
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Dataset.
522
+ # p response
523
+ # end
524
+ #
534
525
  def list_datasets request, options = nil
535
526
  raise ::ArgumentError, "request must be provided" if request.nil?
536
527
 
@@ -548,16 +539,20 @@ module Google
548
539
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
549
540
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
550
541
 
551
- header_params = {
552
- "parent" => request.parent
553
- }
542
+ header_params = {}
543
+ if request.parent
544
+ header_params["parent"] = request.parent
545
+ end
546
+
554
547
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
555
548
  metadata[:"x-goog-request-params"] ||= request_params_header
556
549
 
557
550
  options.apply_defaults timeout: @config.rpcs.list_datasets.timeout,
558
551
  metadata: metadata,
559
552
  retry_policy: @config.rpcs.list_datasets.retry_policy
560
- options.apply_defaults metadata: @config.metadata,
553
+
554
+ options.apply_defaults timeout: @config.timeout,
555
+ metadata: @config.metadata,
561
556
  retry_policy: @config.retry_policy
562
557
 
563
558
  @data_labeling_service_stub.call_rpc :list_datasets, request, options: options do |response, operation|
@@ -599,6 +594,21 @@ module Google
599
594
  #
600
595
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
601
596
  #
597
+ # @example Basic example
598
+ # require "google/cloud/data_labeling/v1beta1"
599
+ #
600
+ # # Create a client object. The client can be reused for multiple calls.
601
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
602
+ #
603
+ # # Create a request. To set request fields, pass in keyword arguments.
604
+ # request = Google::Cloud::DataLabeling::V1beta1::DeleteDatasetRequest.new
605
+ #
606
+ # # Call the delete_dataset method.
607
+ # result = client.delete_dataset request
608
+ #
609
+ # # The returned object is of type Google::Protobuf::Empty.
610
+ # p result
611
+ #
602
612
  def delete_dataset request, options = nil
603
613
  raise ::ArgumentError, "request must be provided" if request.nil?
604
614
 
@@ -616,16 +626,20 @@ module Google
616
626
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
617
627
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
618
628
 
619
- header_params = {
620
- "name" => request.name
621
- }
629
+ header_params = {}
630
+ if request.name
631
+ header_params["name"] = request.name
632
+ end
633
+
622
634
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
623
635
  metadata[:"x-goog-request-params"] ||= request_params_header
624
636
 
625
637
  options.apply_defaults timeout: @config.rpcs.delete_dataset.timeout,
626
638
  metadata: metadata,
627
639
  retry_policy: @config.rpcs.delete_dataset.retry_policy
628
- options.apply_defaults metadata: @config.metadata,
640
+
641
+ options.apply_defaults timeout: @config.timeout,
642
+ metadata: @config.metadata,
629
643
  retry_policy: @config.retry_policy
630
644
 
631
645
  @data_labeling_service_stub.call_rpc :delete_dataset, request, options: options do |response, operation|
@@ -675,6 +689,28 @@ module Google
675
689
  #
676
690
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
677
691
  #
692
+ # @example Basic example
693
+ # require "google/cloud/data_labeling/v1beta1"
694
+ #
695
+ # # Create a client object. The client can be reused for multiple calls.
696
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
697
+ #
698
+ # # Create a request. To set request fields, pass in keyword arguments.
699
+ # request = Google::Cloud::DataLabeling::V1beta1::ImportDataRequest.new
700
+ #
701
+ # # Call the import_data method.
702
+ # result = client.import_data request
703
+ #
704
+ # # The returned object is of type Gapic::Operation. You can use this
705
+ # # object to check the status of an operation, cancel it, or wait
706
+ # # for results. Here is how to block until completion:
707
+ # result.wait_until_done! timeout: 60
708
+ # if result.response?
709
+ # p result.response
710
+ # else
711
+ # puts "Error!"
712
+ # end
713
+ #
678
714
  def import_data request, options = nil
679
715
  raise ::ArgumentError, "request must be provided" if request.nil?
680
716
 
@@ -692,16 +728,20 @@ module Google
692
728
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
693
729
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
694
730
 
695
- header_params = {
696
- "name" => request.name
697
- }
731
+ header_params = {}
732
+ if request.name
733
+ header_params["name"] = request.name
734
+ end
735
+
698
736
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
699
737
  metadata[:"x-goog-request-params"] ||= request_params_header
700
738
 
701
739
  options.apply_defaults timeout: @config.rpcs.import_data.timeout,
702
740
  metadata: metadata,
703
741
  retry_policy: @config.rpcs.import_data.retry_policy
704
- options.apply_defaults metadata: @config.metadata,
742
+
743
+ options.apply_defaults timeout: @config.timeout,
744
+ metadata: @config.metadata,
705
745
  retry_policy: @config.retry_policy
706
746
 
707
747
  @data_labeling_service_stub.call_rpc :import_data, request, options: options do |response, operation|
@@ -756,6 +796,28 @@ module Google
756
796
  #
757
797
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
758
798
  #
799
+ # @example Basic example
800
+ # require "google/cloud/data_labeling/v1beta1"
801
+ #
802
+ # # Create a client object. The client can be reused for multiple calls.
803
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
804
+ #
805
+ # # Create a request. To set request fields, pass in keyword arguments.
806
+ # request = Google::Cloud::DataLabeling::V1beta1::ExportDataRequest.new
807
+ #
808
+ # # Call the export_data method.
809
+ # result = client.export_data request
810
+ #
811
+ # # The returned object is of type Gapic::Operation. You can use this
812
+ # # object to check the status of an operation, cancel it, or wait
813
+ # # for results. Here is how to block until completion:
814
+ # result.wait_until_done! timeout: 60
815
+ # if result.response?
816
+ # p result.response
817
+ # else
818
+ # puts "Error!"
819
+ # end
820
+ #
759
821
  def export_data request, options = nil
760
822
  raise ::ArgumentError, "request must be provided" if request.nil?
761
823
 
@@ -773,16 +835,20 @@ module Google
773
835
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
774
836
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
775
837
 
776
- header_params = {
777
- "name" => request.name
778
- }
838
+ header_params = {}
839
+ if request.name
840
+ header_params["name"] = request.name
841
+ end
842
+
779
843
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
780
844
  metadata[:"x-goog-request-params"] ||= request_params_header
781
845
 
782
846
  options.apply_defaults timeout: @config.rpcs.export_data.timeout,
783
847
  metadata: metadata,
784
848
  retry_policy: @config.rpcs.export_data.retry_policy
785
- options.apply_defaults metadata: @config.metadata,
849
+
850
+ options.apply_defaults timeout: @config.timeout,
851
+ metadata: @config.metadata,
786
852
  retry_policy: @config.retry_policy
787
853
 
788
854
  @data_labeling_service_stub.call_rpc :export_data, request, options: options do |response, operation|
@@ -825,6 +891,21 @@ module Google
825
891
  #
826
892
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
827
893
  #
894
+ # @example Basic example
895
+ # require "google/cloud/data_labeling/v1beta1"
896
+ #
897
+ # # Create a client object. The client can be reused for multiple calls.
898
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
899
+ #
900
+ # # Create a request. To set request fields, pass in keyword arguments.
901
+ # request = Google::Cloud::DataLabeling::V1beta1::GetDataItemRequest.new
902
+ #
903
+ # # Call the get_data_item method.
904
+ # result = client.get_data_item request
905
+ #
906
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::DataItem.
907
+ # p result
908
+ #
828
909
  def get_data_item request, options = nil
829
910
  raise ::ArgumentError, "request must be provided" if request.nil?
830
911
 
@@ -842,16 +923,20 @@ module Google
842
923
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
843
924
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
844
925
 
845
- header_params = {
846
- "name" => request.name
847
- }
926
+ header_params = {}
927
+ if request.name
928
+ header_params["name"] = request.name
929
+ end
930
+
848
931
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
849
932
  metadata[:"x-goog-request-params"] ||= request_params_header
850
933
 
851
934
  options.apply_defaults timeout: @config.rpcs.get_data_item.timeout,
852
935
  metadata: metadata,
853
936
  retry_policy: @config.rpcs.get_data_item.retry_policy
854
- options.apply_defaults metadata: @config.metadata,
937
+
938
+ options.apply_defaults timeout: @config.timeout,
939
+ metadata: @config.metadata,
855
940
  retry_policy: @config.retry_policy
856
941
 
857
942
  @data_labeling_service_stub.call_rpc :get_data_item, request, options: options do |response, operation|
@@ -904,6 +989,27 @@ module Google
904
989
  #
905
990
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
906
991
  #
992
+ # @example Basic example
993
+ # require "google/cloud/data_labeling/v1beta1"
994
+ #
995
+ # # Create a client object. The client can be reused for multiple calls.
996
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
997
+ #
998
+ # # Create a request. To set request fields, pass in keyword arguments.
999
+ # request = Google::Cloud::DataLabeling::V1beta1::ListDataItemsRequest.new
1000
+ #
1001
+ # # Call the list_data_items method.
1002
+ # result = client.list_data_items request
1003
+ #
1004
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1005
+ # # iterate over all elements by calling #each, and the enumerable
1006
+ # # will lazily make API calls to fetch subsequent pages. Other
1007
+ # # methods are also available for managing paging directly.
1008
+ # result.each do |response|
1009
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::DataItem.
1010
+ # p response
1011
+ # end
1012
+ #
907
1013
  def list_data_items request, options = nil
908
1014
  raise ::ArgumentError, "request must be provided" if request.nil?
909
1015
 
@@ -921,16 +1027,20 @@ module Google
921
1027
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
922
1028
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
923
1029
 
924
- header_params = {
925
- "parent" => request.parent
926
- }
1030
+ header_params = {}
1031
+ if request.parent
1032
+ header_params["parent"] = request.parent
1033
+ end
1034
+
927
1035
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
928
1036
  metadata[:"x-goog-request-params"] ||= request_params_header
929
1037
 
930
1038
  options.apply_defaults timeout: @config.rpcs.list_data_items.timeout,
931
1039
  metadata: metadata,
932
1040
  retry_policy: @config.rpcs.list_data_items.retry_policy
933
- options.apply_defaults metadata: @config.metadata,
1041
+
1042
+ options.apply_defaults timeout: @config.timeout,
1043
+ metadata: @config.metadata,
934
1044
  retry_policy: @config.retry_policy
935
1045
 
936
1046
  @data_labeling_service_stub.call_rpc :list_data_items, request, options: options do |response, operation|
@@ -973,6 +1083,21 @@ module Google
973
1083
  #
974
1084
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
975
1085
  #
1086
+ # @example Basic example
1087
+ # require "google/cloud/data_labeling/v1beta1"
1088
+ #
1089
+ # # Create a client object. The client can be reused for multiple calls.
1090
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1091
+ #
1092
+ # # Create a request. To set request fields, pass in keyword arguments.
1093
+ # request = Google::Cloud::DataLabeling::V1beta1::GetAnnotatedDatasetRequest.new
1094
+ #
1095
+ # # Call the get_annotated_dataset method.
1096
+ # result = client.get_annotated_dataset request
1097
+ #
1098
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset.
1099
+ # p result
1100
+ #
976
1101
  def get_annotated_dataset request, options = nil
977
1102
  raise ::ArgumentError, "request must be provided" if request.nil?
978
1103
 
@@ -990,16 +1115,20 @@ module Google
990
1115
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
991
1116
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
992
1117
 
993
- header_params = {
994
- "name" => request.name
995
- }
1118
+ header_params = {}
1119
+ if request.name
1120
+ header_params["name"] = request.name
1121
+ end
1122
+
996
1123
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
997
1124
  metadata[:"x-goog-request-params"] ||= request_params_header
998
1125
 
999
1126
  options.apply_defaults timeout: @config.rpcs.get_annotated_dataset.timeout,
1000
1127
  metadata: metadata,
1001
1128
  retry_policy: @config.rpcs.get_annotated_dataset.retry_policy
1002
- options.apply_defaults metadata: @config.metadata,
1129
+
1130
+ options.apply_defaults timeout: @config.timeout,
1131
+ metadata: @config.metadata,
1003
1132
  retry_policy: @config.retry_policy
1004
1133
 
1005
1134
  @data_labeling_service_stub.call_rpc :get_annotated_dataset, request, options: options do |response, operation|
@@ -1051,6 +1180,27 @@ module Google
1051
1180
  #
1052
1181
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1053
1182
  #
1183
+ # @example Basic example
1184
+ # require "google/cloud/data_labeling/v1beta1"
1185
+ #
1186
+ # # Create a client object. The client can be reused for multiple calls.
1187
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1188
+ #
1189
+ # # Create a request. To set request fields, pass in keyword arguments.
1190
+ # request = Google::Cloud::DataLabeling::V1beta1::ListAnnotatedDatasetsRequest.new
1191
+ #
1192
+ # # Call the list_annotated_datasets method.
1193
+ # result = client.list_annotated_datasets request
1194
+ #
1195
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1196
+ # # iterate over all elements by calling #each, and the enumerable
1197
+ # # will lazily make API calls to fetch subsequent pages. Other
1198
+ # # methods are also available for managing paging directly.
1199
+ # result.each do |response|
1200
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset.
1201
+ # p response
1202
+ # end
1203
+ #
1054
1204
  def list_annotated_datasets request, options = nil
1055
1205
  raise ::ArgumentError, "request must be provided" if request.nil?
1056
1206
 
@@ -1068,16 +1218,20 @@ module Google
1068
1218
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1069
1219
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1070
1220
 
1071
- header_params = {
1072
- "parent" => request.parent
1073
- }
1221
+ header_params = {}
1222
+ if request.parent
1223
+ header_params["parent"] = request.parent
1224
+ end
1225
+
1074
1226
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1075
1227
  metadata[:"x-goog-request-params"] ||= request_params_header
1076
1228
 
1077
1229
  options.apply_defaults timeout: @config.rpcs.list_annotated_datasets.timeout,
1078
1230
  metadata: metadata,
1079
1231
  retry_policy: @config.rpcs.list_annotated_datasets.retry_policy
1080
- options.apply_defaults metadata: @config.metadata,
1232
+
1233
+ options.apply_defaults timeout: @config.timeout,
1234
+ metadata: @config.metadata,
1081
1235
  retry_policy: @config.retry_policy
1082
1236
 
1083
1237
  @data_labeling_service_stub.call_rpc :list_annotated_datasets, request, options: options do |response, operation|
@@ -1120,6 +1274,21 @@ module Google
1120
1274
  #
1121
1275
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1122
1276
  #
1277
+ # @example Basic example
1278
+ # require "google/cloud/data_labeling/v1beta1"
1279
+ #
1280
+ # # Create a client object. The client can be reused for multiple calls.
1281
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1282
+ #
1283
+ # # Create a request. To set request fields, pass in keyword arguments.
1284
+ # request = Google::Cloud::DataLabeling::V1beta1::DeleteAnnotatedDatasetRequest.new
1285
+ #
1286
+ # # Call the delete_annotated_dataset method.
1287
+ # result = client.delete_annotated_dataset request
1288
+ #
1289
+ # # The returned object is of type Google::Protobuf::Empty.
1290
+ # p result
1291
+ #
1123
1292
  def delete_annotated_dataset request, options = nil
1124
1293
  raise ::ArgumentError, "request must be provided" if request.nil?
1125
1294
 
@@ -1137,16 +1306,20 @@ module Google
1137
1306
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1138
1307
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1139
1308
 
1140
- header_params = {
1141
- "name" => request.name
1142
- }
1309
+ header_params = {}
1310
+ if request.name
1311
+ header_params["name"] = request.name
1312
+ end
1313
+
1143
1314
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1144
1315
  metadata[:"x-goog-request-params"] ||= request_params_header
1145
1316
 
1146
1317
  options.apply_defaults timeout: @config.rpcs.delete_annotated_dataset.timeout,
1147
1318
  metadata: metadata,
1148
1319
  retry_policy: @config.rpcs.delete_annotated_dataset.retry_policy
1149
- options.apply_defaults metadata: @config.metadata,
1320
+
1321
+ options.apply_defaults timeout: @config.timeout,
1322
+ metadata: @config.metadata,
1150
1323
  retry_policy: @config.retry_policy
1151
1324
 
1152
1325
  @data_labeling_service_stub.call_rpc :delete_annotated_dataset, request, options: options do |response, operation|
@@ -1208,6 +1381,28 @@ module Google
1208
1381
  #
1209
1382
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1210
1383
  #
1384
+ # @example Basic example
1385
+ # require "google/cloud/data_labeling/v1beta1"
1386
+ #
1387
+ # # Create a client object. The client can be reused for multiple calls.
1388
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1389
+ #
1390
+ # # Create a request. To set request fields, pass in keyword arguments.
1391
+ # request = Google::Cloud::DataLabeling::V1beta1::LabelImageRequest.new
1392
+ #
1393
+ # # Call the label_image method.
1394
+ # result = client.label_image request
1395
+ #
1396
+ # # The returned object is of type Gapic::Operation. You can use this
1397
+ # # object to check the status of an operation, cancel it, or wait
1398
+ # # for results. Here is how to block until completion:
1399
+ # result.wait_until_done! timeout: 60
1400
+ # if result.response?
1401
+ # p result.response
1402
+ # else
1403
+ # puts "Error!"
1404
+ # end
1405
+ #
1211
1406
  def label_image request, options = nil
1212
1407
  raise ::ArgumentError, "request must be provided" if request.nil?
1213
1408
 
@@ -1225,16 +1420,20 @@ module Google
1225
1420
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1226
1421
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1227
1422
 
1228
- header_params = {
1229
- "parent" => request.parent
1230
- }
1423
+ header_params = {}
1424
+ if request.parent
1425
+ header_params["parent"] = request.parent
1426
+ end
1427
+
1231
1428
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1232
1429
  metadata[:"x-goog-request-params"] ||= request_params_header
1233
1430
 
1234
1431
  options.apply_defaults timeout: @config.rpcs.label_image.timeout,
1235
1432
  metadata: metadata,
1236
1433
  retry_policy: @config.rpcs.label_image.retry_policy
1237
- options.apply_defaults metadata: @config.metadata,
1434
+
1435
+ options.apply_defaults timeout: @config.timeout,
1436
+ metadata: @config.metadata,
1238
1437
  retry_policy: @config.retry_policy
1239
1438
 
1240
1439
  @data_labeling_service_stub.call_rpc :label_image, request, options: options do |response, operation|
@@ -1297,6 +1496,28 @@ module Google
1297
1496
  #
1298
1497
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1299
1498
  #
1499
+ # @example Basic example
1500
+ # require "google/cloud/data_labeling/v1beta1"
1501
+ #
1502
+ # # Create a client object. The client can be reused for multiple calls.
1503
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1504
+ #
1505
+ # # Create a request. To set request fields, pass in keyword arguments.
1506
+ # request = Google::Cloud::DataLabeling::V1beta1::LabelVideoRequest.new
1507
+ #
1508
+ # # Call the label_video method.
1509
+ # result = client.label_video request
1510
+ #
1511
+ # # The returned object is of type Gapic::Operation. You can use this
1512
+ # # object to check the status of an operation, cancel it, or wait
1513
+ # # for results. Here is how to block until completion:
1514
+ # result.wait_until_done! timeout: 60
1515
+ # if result.response?
1516
+ # p result.response
1517
+ # else
1518
+ # puts "Error!"
1519
+ # end
1520
+ #
1300
1521
  def label_video request, options = nil
1301
1522
  raise ::ArgumentError, "request must be provided" if request.nil?
1302
1523
 
@@ -1314,16 +1535,20 @@ module Google
1314
1535
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1315
1536
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1316
1537
 
1317
- header_params = {
1318
- "parent" => request.parent
1319
- }
1538
+ header_params = {}
1539
+ if request.parent
1540
+ header_params["parent"] = request.parent
1541
+ end
1542
+
1320
1543
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1321
1544
  metadata[:"x-goog-request-params"] ||= request_params_header
1322
1545
 
1323
1546
  options.apply_defaults timeout: @config.rpcs.label_video.timeout,
1324
1547
  metadata: metadata,
1325
1548
  retry_policy: @config.rpcs.label_video.retry_policy
1326
- options.apply_defaults metadata: @config.metadata,
1549
+
1550
+ options.apply_defaults timeout: @config.timeout,
1551
+ metadata: @config.metadata,
1327
1552
  retry_policy: @config.retry_policy
1328
1553
 
1329
1554
  @data_labeling_service_stub.call_rpc :label_video, request, options: options do |response, operation|
@@ -1378,6 +1603,28 @@ module Google
1378
1603
  #
1379
1604
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1380
1605
  #
1606
+ # @example Basic example
1607
+ # require "google/cloud/data_labeling/v1beta1"
1608
+ #
1609
+ # # Create a client object. The client can be reused for multiple calls.
1610
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1611
+ #
1612
+ # # Create a request. To set request fields, pass in keyword arguments.
1613
+ # request = Google::Cloud::DataLabeling::V1beta1::LabelTextRequest.new
1614
+ #
1615
+ # # Call the label_text method.
1616
+ # result = client.label_text request
1617
+ #
1618
+ # # The returned object is of type Gapic::Operation. You can use this
1619
+ # # object to check the status of an operation, cancel it, or wait
1620
+ # # for results. Here is how to block until completion:
1621
+ # result.wait_until_done! timeout: 60
1622
+ # if result.response?
1623
+ # p result.response
1624
+ # else
1625
+ # puts "Error!"
1626
+ # end
1627
+ #
1381
1628
  def label_text request, options = nil
1382
1629
  raise ::ArgumentError, "request must be provided" if request.nil?
1383
1630
 
@@ -1395,16 +1642,20 @@ module Google
1395
1642
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1396
1643
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1397
1644
 
1398
- header_params = {
1399
- "parent" => request.parent
1400
- }
1645
+ header_params = {}
1646
+ if request.parent
1647
+ header_params["parent"] = request.parent
1648
+ end
1649
+
1401
1650
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1402
1651
  metadata[:"x-goog-request-params"] ||= request_params_header
1403
1652
 
1404
1653
  options.apply_defaults timeout: @config.rpcs.label_text.timeout,
1405
1654
  metadata: metadata,
1406
1655
  retry_policy: @config.rpcs.label_text.retry_policy
1407
- options.apply_defaults metadata: @config.metadata,
1656
+
1657
+ options.apply_defaults timeout: @config.timeout,
1658
+ metadata: @config.metadata,
1408
1659
  retry_policy: @config.retry_policy
1409
1660
 
1410
1661
  @data_labeling_service_stub.call_rpc :label_text, request, options: options do |response, operation|
@@ -1451,6 +1702,21 @@ module Google
1451
1702
  #
1452
1703
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1453
1704
  #
1705
+ # @example Basic example
1706
+ # require "google/cloud/data_labeling/v1beta1"
1707
+ #
1708
+ # # Create a client object. The client can be reused for multiple calls.
1709
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1710
+ #
1711
+ # # Create a request. To set request fields, pass in keyword arguments.
1712
+ # request = Google::Cloud::DataLabeling::V1beta1::GetExampleRequest.new
1713
+ #
1714
+ # # Call the get_example method.
1715
+ # result = client.get_example request
1716
+ #
1717
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Example.
1718
+ # p result
1719
+ #
1454
1720
  def get_example request, options = nil
1455
1721
  raise ::ArgumentError, "request must be provided" if request.nil?
1456
1722
 
@@ -1468,16 +1734,20 @@ module Google
1468
1734
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1469
1735
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1470
1736
 
1471
- header_params = {
1472
- "name" => request.name
1473
- }
1737
+ header_params = {}
1738
+ if request.name
1739
+ header_params["name"] = request.name
1740
+ end
1741
+
1474
1742
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1475
1743
  metadata[:"x-goog-request-params"] ||= request_params_header
1476
1744
 
1477
1745
  options.apply_defaults timeout: @config.rpcs.get_example.timeout,
1478
1746
  metadata: metadata,
1479
1747
  retry_policy: @config.rpcs.get_example.retry_policy
1480
- options.apply_defaults metadata: @config.metadata,
1748
+
1749
+ options.apply_defaults timeout: @config.timeout,
1750
+ metadata: @config.metadata,
1481
1751
  retry_policy: @config.retry_policy
1482
1752
 
1483
1753
  @data_labeling_service_stub.call_rpc :get_example, request, options: options do |response, operation|
@@ -1531,6 +1801,27 @@ module Google
1531
1801
  #
1532
1802
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1533
1803
  #
1804
+ # @example Basic example
1805
+ # require "google/cloud/data_labeling/v1beta1"
1806
+ #
1807
+ # # Create a client object. The client can be reused for multiple calls.
1808
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1809
+ #
1810
+ # # Create a request. To set request fields, pass in keyword arguments.
1811
+ # request = Google::Cloud::DataLabeling::V1beta1::ListExamplesRequest.new
1812
+ #
1813
+ # # Call the list_examples method.
1814
+ # result = client.list_examples request
1815
+ #
1816
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1817
+ # # iterate over all elements by calling #each, and the enumerable
1818
+ # # will lazily make API calls to fetch subsequent pages. Other
1819
+ # # methods are also available for managing paging directly.
1820
+ # result.each do |response|
1821
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Example.
1822
+ # p response
1823
+ # end
1824
+ #
1534
1825
  def list_examples request, options = nil
1535
1826
  raise ::ArgumentError, "request must be provided" if request.nil?
1536
1827
 
@@ -1548,16 +1839,20 @@ module Google
1548
1839
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1549
1840
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1550
1841
 
1551
- header_params = {
1552
- "parent" => request.parent
1553
- }
1842
+ header_params = {}
1843
+ if request.parent
1844
+ header_params["parent"] = request.parent
1845
+ end
1846
+
1554
1847
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1555
1848
  metadata[:"x-goog-request-params"] ||= request_params_header
1556
1849
 
1557
1850
  options.apply_defaults timeout: @config.rpcs.list_examples.timeout,
1558
1851
  metadata: metadata,
1559
1852
  retry_policy: @config.rpcs.list_examples.retry_policy
1560
- options.apply_defaults metadata: @config.metadata,
1853
+
1854
+ options.apply_defaults timeout: @config.timeout,
1855
+ metadata: @config.metadata,
1561
1856
  retry_policy: @config.retry_policy
1562
1857
 
1563
1858
  @data_labeling_service_stub.call_rpc :list_examples, request, options: options do |response, operation|
@@ -1603,6 +1898,21 @@ module Google
1603
1898
  #
1604
1899
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1605
1900
  #
1901
+ # @example Basic example
1902
+ # require "google/cloud/data_labeling/v1beta1"
1903
+ #
1904
+ # # Create a client object. The client can be reused for multiple calls.
1905
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1906
+ #
1907
+ # # Create a request. To set request fields, pass in keyword arguments.
1908
+ # request = Google::Cloud::DataLabeling::V1beta1::CreateAnnotationSpecSetRequest.new
1909
+ #
1910
+ # # Call the create_annotation_spec_set method.
1911
+ # result = client.create_annotation_spec_set request
1912
+ #
1913
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet.
1914
+ # p result
1915
+ #
1606
1916
  def create_annotation_spec_set request, options = nil
1607
1917
  raise ::ArgumentError, "request must be provided" if request.nil?
1608
1918
 
@@ -1620,16 +1930,20 @@ module Google
1620
1930
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1621
1931
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1622
1932
 
1623
- header_params = {
1624
- "parent" => request.parent
1625
- }
1933
+ header_params = {}
1934
+ if request.parent
1935
+ header_params["parent"] = request.parent
1936
+ end
1937
+
1626
1938
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1627
1939
  metadata[:"x-goog-request-params"] ||= request_params_header
1628
1940
 
1629
1941
  options.apply_defaults timeout: @config.rpcs.create_annotation_spec_set.timeout,
1630
1942
  metadata: metadata,
1631
1943
  retry_policy: @config.rpcs.create_annotation_spec_set.retry_policy
1632
- options.apply_defaults metadata: @config.metadata,
1944
+
1945
+ options.apply_defaults timeout: @config.timeout,
1946
+ metadata: @config.metadata,
1633
1947
  retry_policy: @config.retry_policy
1634
1948
 
1635
1949
  @data_labeling_service_stub.call_rpc :create_annotation_spec_set, request, options: options do |response, operation|
@@ -1670,6 +1984,21 @@ module Google
1670
1984
  #
1671
1985
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1672
1986
  #
1987
+ # @example Basic example
1988
+ # require "google/cloud/data_labeling/v1beta1"
1989
+ #
1990
+ # # Create a client object. The client can be reused for multiple calls.
1991
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
1992
+ #
1993
+ # # Create a request. To set request fields, pass in keyword arguments.
1994
+ # request = Google::Cloud::DataLabeling::V1beta1::GetAnnotationSpecSetRequest.new
1995
+ #
1996
+ # # Call the get_annotation_spec_set method.
1997
+ # result = client.get_annotation_spec_set request
1998
+ #
1999
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet.
2000
+ # p result
2001
+ #
1673
2002
  def get_annotation_spec_set request, options = nil
1674
2003
  raise ::ArgumentError, "request must be provided" if request.nil?
1675
2004
 
@@ -1687,16 +2016,20 @@ module Google
1687
2016
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1688
2017
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1689
2018
 
1690
- header_params = {
1691
- "name" => request.name
1692
- }
2019
+ header_params = {}
2020
+ if request.name
2021
+ header_params["name"] = request.name
2022
+ end
2023
+
1693
2024
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1694
2025
  metadata[:"x-goog-request-params"] ||= request_params_header
1695
2026
 
1696
2027
  options.apply_defaults timeout: @config.rpcs.get_annotation_spec_set.timeout,
1697
2028
  metadata: metadata,
1698
2029
  retry_policy: @config.rpcs.get_annotation_spec_set.retry_policy
1699
- options.apply_defaults metadata: @config.metadata,
2030
+
2031
+ options.apply_defaults timeout: @config.timeout,
2032
+ metadata: @config.metadata,
1700
2033
  retry_policy: @config.retry_policy
1701
2034
 
1702
2035
  @data_labeling_service_stub.call_rpc :get_annotation_spec_set, request, options: options do |response, operation|
@@ -1748,6 +2081,27 @@ module Google
1748
2081
  #
1749
2082
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1750
2083
  #
2084
+ # @example Basic example
2085
+ # require "google/cloud/data_labeling/v1beta1"
2086
+ #
2087
+ # # Create a client object. The client can be reused for multiple calls.
2088
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2089
+ #
2090
+ # # Create a request. To set request fields, pass in keyword arguments.
2091
+ # request = Google::Cloud::DataLabeling::V1beta1::ListAnnotationSpecSetsRequest.new
2092
+ #
2093
+ # # Call the list_annotation_spec_sets method.
2094
+ # result = client.list_annotation_spec_sets request
2095
+ #
2096
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2097
+ # # iterate over all elements by calling #each, and the enumerable
2098
+ # # will lazily make API calls to fetch subsequent pages. Other
2099
+ # # methods are also available for managing paging directly.
2100
+ # result.each do |response|
2101
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet.
2102
+ # p response
2103
+ # end
2104
+ #
1751
2105
  def list_annotation_spec_sets request, options = nil
1752
2106
  raise ::ArgumentError, "request must be provided" if request.nil?
1753
2107
 
@@ -1765,16 +2119,20 @@ module Google
1765
2119
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1766
2120
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1767
2121
 
1768
- header_params = {
1769
- "parent" => request.parent
1770
- }
2122
+ header_params = {}
2123
+ if request.parent
2124
+ header_params["parent"] = request.parent
2125
+ end
2126
+
1771
2127
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1772
2128
  metadata[:"x-goog-request-params"] ||= request_params_header
1773
2129
 
1774
2130
  options.apply_defaults timeout: @config.rpcs.list_annotation_spec_sets.timeout,
1775
2131
  metadata: metadata,
1776
2132
  retry_policy: @config.rpcs.list_annotation_spec_sets.retry_policy
1777
- options.apply_defaults metadata: @config.metadata,
2133
+
2134
+ options.apply_defaults timeout: @config.timeout,
2135
+ metadata: @config.metadata,
1778
2136
  retry_policy: @config.retry_policy
1779
2137
 
1780
2138
  @data_labeling_service_stub.call_rpc :list_annotation_spec_sets, request, options: options do |response, operation|
@@ -1816,6 +2174,21 @@ module Google
1816
2174
  #
1817
2175
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1818
2176
  #
2177
+ # @example Basic example
2178
+ # require "google/cloud/data_labeling/v1beta1"
2179
+ #
2180
+ # # Create a client object. The client can be reused for multiple calls.
2181
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2182
+ #
2183
+ # # Create a request. To set request fields, pass in keyword arguments.
2184
+ # request = Google::Cloud::DataLabeling::V1beta1::DeleteAnnotationSpecSetRequest.new
2185
+ #
2186
+ # # Call the delete_annotation_spec_set method.
2187
+ # result = client.delete_annotation_spec_set request
2188
+ #
2189
+ # # The returned object is of type Google::Protobuf::Empty.
2190
+ # p result
2191
+ #
1819
2192
  def delete_annotation_spec_set request, options = nil
1820
2193
  raise ::ArgumentError, "request must be provided" if request.nil?
1821
2194
 
@@ -1833,16 +2206,20 @@ module Google
1833
2206
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1834
2207
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1835
2208
 
1836
- header_params = {
1837
- "name" => request.name
1838
- }
2209
+ header_params = {}
2210
+ if request.name
2211
+ header_params["name"] = request.name
2212
+ end
2213
+
1839
2214
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1840
2215
  metadata[:"x-goog-request-params"] ||= request_params_header
1841
2216
 
1842
2217
  options.apply_defaults timeout: @config.rpcs.delete_annotation_spec_set.timeout,
1843
2218
  metadata: metadata,
1844
2219
  retry_policy: @config.rpcs.delete_annotation_spec_set.retry_policy
1845
- options.apply_defaults metadata: @config.metadata,
2220
+
2221
+ options.apply_defaults timeout: @config.timeout,
2222
+ metadata: @config.metadata,
1846
2223
  retry_policy: @config.retry_policy
1847
2224
 
1848
2225
  @data_labeling_service_stub.call_rpc :delete_annotation_spec_set, request, options: options do |response, operation|
@@ -1885,6 +2262,28 @@ module Google
1885
2262
  #
1886
2263
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1887
2264
  #
2265
+ # @example Basic example
2266
+ # require "google/cloud/data_labeling/v1beta1"
2267
+ #
2268
+ # # Create a client object. The client can be reused for multiple calls.
2269
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2270
+ #
2271
+ # # Create a request. To set request fields, pass in keyword arguments.
2272
+ # request = Google::Cloud::DataLabeling::V1beta1::CreateInstructionRequest.new
2273
+ #
2274
+ # # Call the create_instruction method.
2275
+ # result = client.create_instruction request
2276
+ #
2277
+ # # The returned object is of type Gapic::Operation. You can use this
2278
+ # # object to check the status of an operation, cancel it, or wait
2279
+ # # for results. Here is how to block until completion:
2280
+ # result.wait_until_done! timeout: 60
2281
+ # if result.response?
2282
+ # p result.response
2283
+ # else
2284
+ # puts "Error!"
2285
+ # end
2286
+ #
1888
2287
  def create_instruction request, options = nil
1889
2288
  raise ::ArgumentError, "request must be provided" if request.nil?
1890
2289
 
@@ -1902,16 +2301,20 @@ module Google
1902
2301
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1903
2302
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1904
2303
 
1905
- header_params = {
1906
- "parent" => request.parent
1907
- }
2304
+ header_params = {}
2305
+ if request.parent
2306
+ header_params["parent"] = request.parent
2307
+ end
2308
+
1908
2309
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1909
2310
  metadata[:"x-goog-request-params"] ||= request_params_header
1910
2311
 
1911
2312
  options.apply_defaults timeout: @config.rpcs.create_instruction.timeout,
1912
2313
  metadata: metadata,
1913
2314
  retry_policy: @config.rpcs.create_instruction.retry_policy
1914
- options.apply_defaults metadata: @config.metadata,
2315
+
2316
+ options.apply_defaults timeout: @config.timeout,
2317
+ metadata: @config.metadata,
1915
2318
  retry_policy: @config.retry_policy
1916
2319
 
1917
2320
  @data_labeling_service_stub.call_rpc :create_instruction, request, options: options do |response, operation|
@@ -1953,6 +2356,21 @@ module Google
1953
2356
  #
1954
2357
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1955
2358
  #
2359
+ # @example Basic example
2360
+ # require "google/cloud/data_labeling/v1beta1"
2361
+ #
2362
+ # # Create a client object. The client can be reused for multiple calls.
2363
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2364
+ #
2365
+ # # Create a request. To set request fields, pass in keyword arguments.
2366
+ # request = Google::Cloud::DataLabeling::V1beta1::GetInstructionRequest.new
2367
+ #
2368
+ # # Call the get_instruction method.
2369
+ # result = client.get_instruction request
2370
+ #
2371
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Instruction.
2372
+ # p result
2373
+ #
1956
2374
  def get_instruction request, options = nil
1957
2375
  raise ::ArgumentError, "request must be provided" if request.nil?
1958
2376
 
@@ -1970,16 +2388,20 @@ module Google
1970
2388
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
1971
2389
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1972
2390
 
1973
- header_params = {
1974
- "name" => request.name
1975
- }
2391
+ header_params = {}
2392
+ if request.name
2393
+ header_params["name"] = request.name
2394
+ end
2395
+
1976
2396
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1977
2397
  metadata[:"x-goog-request-params"] ||= request_params_header
1978
2398
 
1979
2399
  options.apply_defaults timeout: @config.rpcs.get_instruction.timeout,
1980
2400
  metadata: metadata,
1981
2401
  retry_policy: @config.rpcs.get_instruction.retry_policy
1982
- options.apply_defaults metadata: @config.metadata,
2402
+
2403
+ options.apply_defaults timeout: @config.timeout,
2404
+ metadata: @config.metadata,
1983
2405
  retry_policy: @config.retry_policy
1984
2406
 
1985
2407
  @data_labeling_service_stub.call_rpc :get_instruction, request, options: options do |response, operation|
@@ -2031,6 +2453,27 @@ module Google
2031
2453
  #
2032
2454
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2033
2455
  #
2456
+ # @example Basic example
2457
+ # require "google/cloud/data_labeling/v1beta1"
2458
+ #
2459
+ # # Create a client object. The client can be reused for multiple calls.
2460
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2461
+ #
2462
+ # # Create a request. To set request fields, pass in keyword arguments.
2463
+ # request = Google::Cloud::DataLabeling::V1beta1::ListInstructionsRequest.new
2464
+ #
2465
+ # # Call the list_instructions method.
2466
+ # result = client.list_instructions request
2467
+ #
2468
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2469
+ # # iterate over all elements by calling #each, and the enumerable
2470
+ # # will lazily make API calls to fetch subsequent pages. Other
2471
+ # # methods are also available for managing paging directly.
2472
+ # result.each do |response|
2473
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Instruction.
2474
+ # p response
2475
+ # end
2476
+ #
2034
2477
  def list_instructions request, options = nil
2035
2478
  raise ::ArgumentError, "request must be provided" if request.nil?
2036
2479
 
@@ -2048,16 +2491,20 @@ module Google
2048
2491
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2049
2492
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2050
2493
 
2051
- header_params = {
2052
- "parent" => request.parent
2053
- }
2494
+ header_params = {}
2495
+ if request.parent
2496
+ header_params["parent"] = request.parent
2497
+ end
2498
+
2054
2499
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2055
2500
  metadata[:"x-goog-request-params"] ||= request_params_header
2056
2501
 
2057
2502
  options.apply_defaults timeout: @config.rpcs.list_instructions.timeout,
2058
2503
  metadata: metadata,
2059
2504
  retry_policy: @config.rpcs.list_instructions.retry_policy
2060
- options.apply_defaults metadata: @config.metadata,
2505
+
2506
+ options.apply_defaults timeout: @config.timeout,
2507
+ metadata: @config.metadata,
2061
2508
  retry_policy: @config.retry_policy
2062
2509
 
2063
2510
  @data_labeling_service_stub.call_rpc :list_instructions, request, options: options do |response, operation|
@@ -2099,6 +2546,21 @@ module Google
2099
2546
  #
2100
2547
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2101
2548
  #
2549
+ # @example Basic example
2550
+ # require "google/cloud/data_labeling/v1beta1"
2551
+ #
2552
+ # # Create a client object. The client can be reused for multiple calls.
2553
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2554
+ #
2555
+ # # Create a request. To set request fields, pass in keyword arguments.
2556
+ # request = Google::Cloud::DataLabeling::V1beta1::DeleteInstructionRequest.new
2557
+ #
2558
+ # # Call the delete_instruction method.
2559
+ # result = client.delete_instruction request
2560
+ #
2561
+ # # The returned object is of type Google::Protobuf::Empty.
2562
+ # p result
2563
+ #
2102
2564
  def delete_instruction request, options = nil
2103
2565
  raise ::ArgumentError, "request must be provided" if request.nil?
2104
2566
 
@@ -2116,16 +2578,20 @@ module Google
2116
2578
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2117
2579
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2118
2580
 
2119
- header_params = {
2120
- "name" => request.name
2121
- }
2581
+ header_params = {}
2582
+ if request.name
2583
+ header_params["name"] = request.name
2584
+ end
2585
+
2122
2586
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2123
2587
  metadata[:"x-goog-request-params"] ||= request_params_header
2124
2588
 
2125
2589
  options.apply_defaults timeout: @config.rpcs.delete_instruction.timeout,
2126
2590
  metadata: metadata,
2127
2591
  retry_policy: @config.rpcs.delete_instruction.retry_policy
2128
- options.apply_defaults metadata: @config.metadata,
2592
+
2593
+ options.apply_defaults timeout: @config.timeout,
2594
+ metadata: @config.metadata,
2129
2595
  retry_policy: @config.retry_policy
2130
2596
 
2131
2597
  @data_labeling_service_stub.call_rpc :delete_instruction, request, options: options do |response, operation|
@@ -2168,6 +2634,21 @@ module Google
2168
2634
  #
2169
2635
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2170
2636
  #
2637
+ # @example Basic example
2638
+ # require "google/cloud/data_labeling/v1beta1"
2639
+ #
2640
+ # # Create a client object. The client can be reused for multiple calls.
2641
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2642
+ #
2643
+ # # Create a request. To set request fields, pass in keyword arguments.
2644
+ # request = Google::Cloud::DataLabeling::V1beta1::GetEvaluationRequest.new
2645
+ #
2646
+ # # Call the get_evaluation method.
2647
+ # result = client.get_evaluation request
2648
+ #
2649
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Evaluation.
2650
+ # p result
2651
+ #
2171
2652
  def get_evaluation request, options = nil
2172
2653
  raise ::ArgumentError, "request must be provided" if request.nil?
2173
2654
 
@@ -2185,16 +2666,20 @@ module Google
2185
2666
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2186
2667
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2187
2668
 
2188
- header_params = {
2189
- "name" => request.name
2190
- }
2669
+ header_params = {}
2670
+ if request.name
2671
+ header_params["name"] = request.name
2672
+ end
2673
+
2191
2674
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2192
2675
  metadata[:"x-goog-request-params"] ||= request_params_header
2193
2676
 
2194
2677
  options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout,
2195
2678
  metadata: metadata,
2196
2679
  retry_policy: @config.rpcs.get_evaluation.retry_policy
2197
- options.apply_defaults metadata: @config.metadata,
2680
+
2681
+ options.apply_defaults timeout: @config.timeout,
2682
+ metadata: @config.metadata,
2198
2683
  retry_policy: @config.retry_policy
2199
2684
 
2200
2685
  @data_labeling_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation|
@@ -2278,6 +2763,27 @@ module Google
2278
2763
  #
2279
2764
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2280
2765
  #
2766
+ # @example Basic example
2767
+ # require "google/cloud/data_labeling/v1beta1"
2768
+ #
2769
+ # # Create a client object. The client can be reused for multiple calls.
2770
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2771
+ #
2772
+ # # Create a request. To set request fields, pass in keyword arguments.
2773
+ # request = Google::Cloud::DataLabeling::V1beta1::SearchEvaluationsRequest.new
2774
+ #
2775
+ # # Call the search_evaluations method.
2776
+ # result = client.search_evaluations request
2777
+ #
2778
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2779
+ # # iterate over all elements by calling #each, and the enumerable
2780
+ # # will lazily make API calls to fetch subsequent pages. Other
2781
+ # # methods are also available for managing paging directly.
2782
+ # result.each do |response|
2783
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Evaluation.
2784
+ # p response
2785
+ # end
2786
+ #
2281
2787
  def search_evaluations request, options = nil
2282
2788
  raise ::ArgumentError, "request must be provided" if request.nil?
2283
2789
 
@@ -2295,16 +2801,20 @@ module Google
2295
2801
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2296
2802
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2297
2803
 
2298
- header_params = {
2299
- "parent" => request.parent
2300
- }
2804
+ header_params = {}
2805
+ if request.parent
2806
+ header_params["parent"] = request.parent
2807
+ end
2808
+
2301
2809
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2302
2810
  metadata[:"x-goog-request-params"] ||= request_params_header
2303
2811
 
2304
2812
  options.apply_defaults timeout: @config.rpcs.search_evaluations.timeout,
2305
2813
  metadata: metadata,
2306
2814
  retry_policy: @config.rpcs.search_evaluations.retry_policy
2307
- options.apply_defaults metadata: @config.metadata,
2815
+
2816
+ options.apply_defaults timeout: @config.timeout,
2817
+ metadata: @config.metadata,
2308
2818
  retry_policy: @config.retry_policy
2309
2819
 
2310
2820
  @data_labeling_service_stub.call_rpc :search_evaluations, request, options: options do |response, operation|
@@ -2361,6 +2871,27 @@ module Google
2361
2871
  #
2362
2872
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2363
2873
  #
2874
+ # @example Basic example
2875
+ # require "google/cloud/data_labeling/v1beta1"
2876
+ #
2877
+ # # Create a client object. The client can be reused for multiple calls.
2878
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2879
+ #
2880
+ # # Create a request. To set request fields, pass in keyword arguments.
2881
+ # request = Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsRequest.new
2882
+ #
2883
+ # # Call the search_example_comparisons method.
2884
+ # result = client.search_example_comparisons request
2885
+ #
2886
+ # # The returned object is of type Gapic::PagedEnumerable. You can
2887
+ # # iterate over all elements by calling #each, and the enumerable
2888
+ # # will lazily make API calls to fetch subsequent pages. Other
2889
+ # # methods are also available for managing paging directly.
2890
+ # result.each do |response|
2891
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsResponse::ExampleComparison.
2892
+ # p response
2893
+ # end
2894
+ #
2364
2895
  def search_example_comparisons request, options = nil
2365
2896
  raise ::ArgumentError, "request must be provided" if request.nil?
2366
2897
 
@@ -2378,16 +2909,20 @@ module Google
2378
2909
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2379
2910
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2380
2911
 
2381
- header_params = {
2382
- "parent" => request.parent
2383
- }
2912
+ header_params = {}
2913
+ if request.parent
2914
+ header_params["parent"] = request.parent
2915
+ end
2916
+
2384
2917
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2385
2918
  metadata[:"x-goog-request-params"] ||= request_params_header
2386
2919
 
2387
2920
  options.apply_defaults timeout: @config.rpcs.search_example_comparisons.timeout,
2388
2921
  metadata: metadata,
2389
2922
  retry_policy: @config.rpcs.search_example_comparisons.retry_policy
2390
- options.apply_defaults metadata: @config.metadata,
2923
+
2924
+ options.apply_defaults timeout: @config.timeout,
2925
+ metadata: @config.metadata,
2391
2926
  retry_policy: @config.retry_policy
2392
2927
 
2393
2928
  @data_labeling_service_stub.call_rpc :search_example_comparisons, request, options: options do |response, operation|
@@ -2431,6 +2966,21 @@ module Google
2431
2966
  #
2432
2967
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2433
2968
  #
2969
+ # @example Basic example
2970
+ # require "google/cloud/data_labeling/v1beta1"
2971
+ #
2972
+ # # Create a client object. The client can be reused for multiple calls.
2973
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
2974
+ #
2975
+ # # Create a request. To set request fields, pass in keyword arguments.
2976
+ # request = Google::Cloud::DataLabeling::V1beta1::CreateEvaluationJobRequest.new
2977
+ #
2978
+ # # Call the create_evaluation_job method.
2979
+ # result = client.create_evaluation_job request
2980
+ #
2981
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob.
2982
+ # p result
2983
+ #
2434
2984
  def create_evaluation_job request, options = nil
2435
2985
  raise ::ArgumentError, "request must be provided" if request.nil?
2436
2986
 
@@ -2448,16 +2998,20 @@ module Google
2448
2998
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2449
2999
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2450
3000
 
2451
- header_params = {
2452
- "parent" => request.parent
2453
- }
3001
+ header_params = {}
3002
+ if request.parent
3003
+ header_params["parent"] = request.parent
3004
+ end
3005
+
2454
3006
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2455
3007
  metadata[:"x-goog-request-params"] ||= request_params_header
2456
3008
 
2457
3009
  options.apply_defaults timeout: @config.rpcs.create_evaluation_job.timeout,
2458
3010
  metadata: metadata,
2459
3011
  retry_policy: @config.rpcs.create_evaluation_job.retry_policy
2460
- options.apply_defaults metadata: @config.metadata,
3012
+
3013
+ options.apply_defaults timeout: @config.timeout,
3014
+ metadata: @config.metadata,
2461
3015
  retry_policy: @config.retry_policy
2462
3016
 
2463
3017
  @data_labeling_service_stub.call_rpc :create_evaluation_job, request, options: options do |response, operation|
@@ -2512,6 +3066,21 @@ module Google
2512
3066
  #
2513
3067
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2514
3068
  #
3069
+ # @example Basic example
3070
+ # require "google/cloud/data_labeling/v1beta1"
3071
+ #
3072
+ # # Create a client object. The client can be reused for multiple calls.
3073
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
3074
+ #
3075
+ # # Create a request. To set request fields, pass in keyword arguments.
3076
+ # request = Google::Cloud::DataLabeling::V1beta1::UpdateEvaluationJobRequest.new
3077
+ #
3078
+ # # Call the update_evaluation_job method.
3079
+ # result = client.update_evaluation_job request
3080
+ #
3081
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob.
3082
+ # p result
3083
+ #
2515
3084
  def update_evaluation_job request, options = nil
2516
3085
  raise ::ArgumentError, "request must be provided" if request.nil?
2517
3086
 
@@ -2529,16 +3098,20 @@ module Google
2529
3098
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2530
3099
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2531
3100
 
2532
- header_params = {
2533
- "evaluation_job.name" => request.evaluation_job.name
2534
- }
3101
+ header_params = {}
3102
+ if request.evaluation_job&.name
3103
+ header_params["evaluation_job.name"] = request.evaluation_job.name
3104
+ end
3105
+
2535
3106
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2536
3107
  metadata[:"x-goog-request-params"] ||= request_params_header
2537
3108
 
2538
3109
  options.apply_defaults timeout: @config.rpcs.update_evaluation_job.timeout,
2539
3110
  metadata: metadata,
2540
3111
  retry_policy: @config.rpcs.update_evaluation_job.retry_policy
2541
- options.apply_defaults metadata: @config.metadata,
3112
+
3113
+ options.apply_defaults timeout: @config.timeout,
3114
+ metadata: @config.metadata,
2542
3115
  retry_policy: @config.retry_policy
2543
3116
 
2544
3117
  @data_labeling_service_stub.call_rpc :update_evaluation_job, request, options: options do |response, operation|
@@ -2580,6 +3153,21 @@ module Google
2580
3153
  #
2581
3154
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2582
3155
  #
3156
+ # @example Basic example
3157
+ # require "google/cloud/data_labeling/v1beta1"
3158
+ #
3159
+ # # Create a client object. The client can be reused for multiple calls.
3160
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
3161
+ #
3162
+ # # Create a request. To set request fields, pass in keyword arguments.
3163
+ # request = Google::Cloud::DataLabeling::V1beta1::GetEvaluationJobRequest.new
3164
+ #
3165
+ # # Call the get_evaluation_job method.
3166
+ # result = client.get_evaluation_job request
3167
+ #
3168
+ # # The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob.
3169
+ # p result
3170
+ #
2583
3171
  def get_evaluation_job request, options = nil
2584
3172
  raise ::ArgumentError, "request must be provided" if request.nil?
2585
3173
 
@@ -2597,16 +3185,20 @@ module Google
2597
3185
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2598
3186
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2599
3187
 
2600
- header_params = {
2601
- "name" => request.name
2602
- }
3188
+ header_params = {}
3189
+ if request.name
3190
+ header_params["name"] = request.name
3191
+ end
3192
+
2603
3193
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2604
3194
  metadata[:"x-goog-request-params"] ||= request_params_header
2605
3195
 
2606
3196
  options.apply_defaults timeout: @config.rpcs.get_evaluation_job.timeout,
2607
3197
  metadata: metadata,
2608
3198
  retry_policy: @config.rpcs.get_evaluation_job.retry_policy
2609
- options.apply_defaults metadata: @config.metadata,
3199
+
3200
+ options.apply_defaults timeout: @config.timeout,
3201
+ metadata: @config.metadata,
2610
3202
  retry_policy: @config.retry_policy
2611
3203
 
2612
3204
  @data_labeling_service_stub.call_rpc :get_evaluation_job, request, options: options do |response, operation|
@@ -2649,6 +3241,21 @@ module Google
2649
3241
  #
2650
3242
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2651
3243
  #
3244
+ # @example Basic example
3245
+ # require "google/cloud/data_labeling/v1beta1"
3246
+ #
3247
+ # # Create a client object. The client can be reused for multiple calls.
3248
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
3249
+ #
3250
+ # # Create a request. To set request fields, pass in keyword arguments.
3251
+ # request = Google::Cloud::DataLabeling::V1beta1::PauseEvaluationJobRequest.new
3252
+ #
3253
+ # # Call the pause_evaluation_job method.
3254
+ # result = client.pause_evaluation_job request
3255
+ #
3256
+ # # The returned object is of type Google::Protobuf::Empty.
3257
+ # p result
3258
+ #
2652
3259
  def pause_evaluation_job request, options = nil
2653
3260
  raise ::ArgumentError, "request must be provided" if request.nil?
2654
3261
 
@@ -2666,16 +3273,20 @@ module Google
2666
3273
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2667
3274
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2668
3275
 
2669
- header_params = {
2670
- "name" => request.name
2671
- }
3276
+ header_params = {}
3277
+ if request.name
3278
+ header_params["name"] = request.name
3279
+ end
3280
+
2672
3281
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2673
3282
  metadata[:"x-goog-request-params"] ||= request_params_header
2674
3283
 
2675
3284
  options.apply_defaults timeout: @config.rpcs.pause_evaluation_job.timeout,
2676
3285
  metadata: metadata,
2677
3286
  retry_policy: @config.rpcs.pause_evaluation_job.retry_policy
2678
- options.apply_defaults metadata: @config.metadata,
3287
+
3288
+ options.apply_defaults timeout: @config.timeout,
3289
+ metadata: @config.metadata,
2679
3290
  retry_policy: @config.retry_policy
2680
3291
 
2681
3292
  @data_labeling_service_stub.call_rpc :pause_evaluation_job, request, options: options do |response, operation|
@@ -2718,6 +3329,21 @@ module Google
2718
3329
  #
2719
3330
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2720
3331
  #
3332
+ # @example Basic example
3333
+ # require "google/cloud/data_labeling/v1beta1"
3334
+ #
3335
+ # # Create a client object. The client can be reused for multiple calls.
3336
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
3337
+ #
3338
+ # # Create a request. To set request fields, pass in keyword arguments.
3339
+ # request = Google::Cloud::DataLabeling::V1beta1::ResumeEvaluationJobRequest.new
3340
+ #
3341
+ # # Call the resume_evaluation_job method.
3342
+ # result = client.resume_evaluation_job request
3343
+ #
3344
+ # # The returned object is of type Google::Protobuf::Empty.
3345
+ # p result
3346
+ #
2721
3347
  def resume_evaluation_job request, options = nil
2722
3348
  raise ::ArgumentError, "request must be provided" if request.nil?
2723
3349
 
@@ -2735,16 +3361,20 @@ module Google
2735
3361
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2736
3362
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2737
3363
 
2738
- header_params = {
2739
- "name" => request.name
2740
- }
3364
+ header_params = {}
3365
+ if request.name
3366
+ header_params["name"] = request.name
3367
+ end
3368
+
2741
3369
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2742
3370
  metadata[:"x-goog-request-params"] ||= request_params_header
2743
3371
 
2744
3372
  options.apply_defaults timeout: @config.rpcs.resume_evaluation_job.timeout,
2745
3373
  metadata: metadata,
2746
3374
  retry_policy: @config.rpcs.resume_evaluation_job.retry_policy
2747
- options.apply_defaults metadata: @config.metadata,
3375
+
3376
+ options.apply_defaults timeout: @config.timeout,
3377
+ metadata: @config.metadata,
2748
3378
  retry_policy: @config.retry_policy
2749
3379
 
2750
3380
  @data_labeling_service_stub.call_rpc :resume_evaluation_job, request, options: options do |response, operation|
@@ -2786,6 +3416,21 @@ module Google
2786
3416
  #
2787
3417
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2788
3418
  #
3419
+ # @example Basic example
3420
+ # require "google/cloud/data_labeling/v1beta1"
3421
+ #
3422
+ # # Create a client object. The client can be reused for multiple calls.
3423
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
3424
+ #
3425
+ # # Create a request. To set request fields, pass in keyword arguments.
3426
+ # request = Google::Cloud::DataLabeling::V1beta1::DeleteEvaluationJobRequest.new
3427
+ #
3428
+ # # Call the delete_evaluation_job method.
3429
+ # result = client.delete_evaluation_job request
3430
+ #
3431
+ # # The returned object is of type Google::Protobuf::Empty.
3432
+ # p result
3433
+ #
2789
3434
  def delete_evaluation_job request, options = nil
2790
3435
  raise ::ArgumentError, "request must be provided" if request.nil?
2791
3436
 
@@ -2803,16 +3448,20 @@ module Google
2803
3448
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2804
3449
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2805
3450
 
2806
- header_params = {
2807
- "name" => request.name
2808
- }
3451
+ header_params = {}
3452
+ if request.name
3453
+ header_params["name"] = request.name
3454
+ end
3455
+
2809
3456
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2810
3457
  metadata[:"x-goog-request-params"] ||= request_params_header
2811
3458
 
2812
3459
  options.apply_defaults timeout: @config.rpcs.delete_evaluation_job.timeout,
2813
3460
  metadata: metadata,
2814
3461
  retry_policy: @config.rpcs.delete_evaluation_job.retry_policy
2815
- options.apply_defaults metadata: @config.metadata,
3462
+
3463
+ options.apply_defaults timeout: @config.timeout,
3464
+ metadata: @config.metadata,
2816
3465
  retry_policy: @config.retry_policy
2817
3466
 
2818
3467
  @data_labeling_service_stub.call_rpc :delete_evaluation_job, request, options: options do |response, operation|
@@ -2872,6 +3521,27 @@ module Google
2872
3521
  #
2873
3522
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
2874
3523
  #
3524
+ # @example Basic example
3525
+ # require "google/cloud/data_labeling/v1beta1"
3526
+ #
3527
+ # # Create a client object. The client can be reused for multiple calls.
3528
+ # client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new
3529
+ #
3530
+ # # Create a request. To set request fields, pass in keyword arguments.
3531
+ # request = Google::Cloud::DataLabeling::V1beta1::ListEvaluationJobsRequest.new
3532
+ #
3533
+ # # Call the list_evaluation_jobs method.
3534
+ # result = client.list_evaluation_jobs request
3535
+ #
3536
+ # # The returned object is of type Gapic::PagedEnumerable. You can
3537
+ # # iterate over all elements by calling #each, and the enumerable
3538
+ # # will lazily make API calls to fetch subsequent pages. Other
3539
+ # # methods are also available for managing paging directly.
3540
+ # result.each do |response|
3541
+ # # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::EvaluationJob.
3542
+ # p response
3543
+ # end
3544
+ #
2875
3545
  def list_evaluation_jobs request, options = nil
2876
3546
  raise ::ArgumentError, "request must be provided" if request.nil?
2877
3547
 
@@ -2889,16 +3559,20 @@ module Google
2889
3559
  gapic_version: ::Google::Cloud::DataLabeling::V1beta1::VERSION
2890
3560
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2891
3561
 
2892
- header_params = {
2893
- "parent" => request.parent
2894
- }
3562
+ header_params = {}
3563
+ if request.parent
3564
+ header_params["parent"] = request.parent
3565
+ end
3566
+
2895
3567
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2896
3568
  metadata[:"x-goog-request-params"] ||= request_params_header
2897
3569
 
2898
3570
  options.apply_defaults timeout: @config.rpcs.list_evaluation_jobs.timeout,
2899
3571
  metadata: metadata,
2900
3572
  retry_policy: @config.rpcs.list_evaluation_jobs.retry_policy
2901
- options.apply_defaults metadata: @config.metadata,
3573
+
3574
+ options.apply_defaults timeout: @config.timeout,
3575
+ metadata: @config.metadata,
2902
3576
  retry_policy: @config.retry_policy
2903
3577
 
2904
3578
  @data_labeling_service_stub.call_rpc :list_evaluation_jobs, request, options: options do |response, operation|
@@ -2923,22 +3597,21 @@ module Google
2923
3597
  # Configuration can be applied globally to all clients, or to a single client
2924
3598
  # on construction.
2925
3599
  #
2926
- # # Examples
2927
- #
2928
- # To modify the global config, setting the timeout for create_dataset
2929
- # to 20 seconds, and all remaining timeouts to 10 seconds:
2930
- #
2931
- # ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.configure do |config|
2932
- # config.timeout = 10.0
2933
- # config.rpcs.create_dataset.timeout = 20.0
2934
- # end
2935
- #
2936
- # To apply the above configuration only to a new client:
2937
- #
2938
- # client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config|
2939
- # config.timeout = 10.0
2940
- # config.rpcs.create_dataset.timeout = 20.0
2941
- # end
3600
+ # @example
3601
+ #
3602
+ # # Modify the global config, setting the timeout for
3603
+ # # create_dataset to 20 seconds,
3604
+ # # and all remaining timeouts to 10 seconds.
3605
+ # ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.configure do |config|
3606
+ # config.timeout = 10.0
3607
+ # config.rpcs.create_dataset.timeout = 20.0
3608
+ # end
3609
+ #
3610
+ # # Apply the above configuration only to a new client.
3611
+ # client = ::Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new do |config|
3612
+ # config.timeout = 10.0
3613
+ # config.rpcs.create_dataset.timeout = 20.0
3614
+ # end
2942
3615
  #
2943
3616
  # @!attribute [rw] endpoint
2944
3617
  # The hostname or hostname:port of the service endpoint.