google-cloud-data_labeling-v1beta1 0.3.0 → 0.3.4

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