Class: OCI::DataLabelingServiceDataplane::DataLabelingClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_labeling_service_dataplane/data_labeling_client.rb

Overview

Use Data Labeling API to create Annotations on Images, Texts & Documents, and generate snapshots.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ DataLabelingClient

Creates a new DataLabelingClient. Notes: If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 55

def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config = OCI::Config.validate_and_build_config_with_signer(config, signer)

  signer = OCI::Signer.config_file_auth_builder(config) if signer.nil?

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20211001'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "DataLabelingClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



15
16
17
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 19

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


29
30
31
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 29

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



25
26
27
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#create_annotation(create_annotation_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_annotation API.

Creates an annotation.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried, without risk of executing that same action again, if there is a timeout or server error. Retry tokens expire after 24 hours, but can be invalidated before then if there are conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 118

def create_annotation(create_annotation_details, opts = {})
  logger.debug 'Calling operation DataLabelingClient#create_annotation.' if logger

  raise "Missing the required parameter 'create_annotation_details' when calling create_annotation." if create_annotation_details.nil?

  path = '/annotations'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_annotation_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#create_annotation') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::Annotation'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_record(create_record_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_record API.

Creates a record.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried, without risk of executing that same action again, if there is a timeout or server error. Retry tokens expire after 24 hours, but can be invalidated before then if there are conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 180

def create_record(create_record_details, opts = {})
  logger.debug 'Calling operation DataLabelingClient#create_record.' if logger

  raise "Missing the required parameter 'create_record_details' when calling create_record." if create_record_details.nil?

  path = '/records'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_record_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#create_record') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::Record'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_annotation(annotation_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_annotation API.

It deletes an annotation resource by identifier.

Parameters:

  • annotation_id (String)

    A unique annotation identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 242

def delete_annotation(annotation_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#delete_annotation.' if logger

  raise "Missing the required parameter 'annotation_id' when calling delete_annotation." if annotation_id.nil?
  raise "Parameter value for 'annotation_id' must not be blank" if OCI::Internal::Util.blank_string?(annotation_id)

  path = '/annotations/{annotationId}'.sub('{annotationId}', annotation_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#delete_annotation') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_record(record_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_record API.

Deletes a record resource by identifier.

Parameters:

  • record_id (String)

    The OCID of the record annotated.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:

  • (Response)

    A Response object with data of type nil



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 303

def delete_record(record_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#delete_record.' if logger

  raise "Missing the required parameter 'record_id' when calling delete_record." if record_id.nil?
  raise "Parameter value for 'record_id' must not be blank" if OCI::Internal::Util.blank_string?(record_id)

  path = '/records/{recordId}'.sub('{recordId}', record_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#delete_record') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_annotation(annotation_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_annotation API.

Gets an annotation.

Parameters:

  • annotation_id (String)

    A unique annotation identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 358

def get_annotation(annotation_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#get_annotation.' if logger

  raise "Missing the required parameter 'annotation_id' when calling get_annotation." if annotation_id.nil?
  raise "Parameter value for 'annotation_id' must not be blank" if OCI::Internal::Util.blank_string?(annotation_id)

  path = '/annotations/{annotationId}'.sub('{annotationId}', annotation_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#get_annotation') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::Annotation'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_dataset(dataset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_dataset API.

Gets a dataset by identifier.

Parameters:

  • dataset_id (String)

    A unique dataset OCID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 412

def get_dataset(dataset_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#get_dataset.' if logger

  raise "Missing the required parameter 'dataset_id' when calling get_dataset." if dataset_id.nil?
  raise "Parameter value for 'dataset_id' must not be blank" if OCI::Internal::Util.blank_string?(dataset_id)

  path = '/datasets/{datasetId}'.sub('{datasetId}', dataset_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#get_dataset') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::Dataset'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_record(record_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_record API.

Gets a record.

Parameters:

  • record_id (String)

    The OCID of the record annotated.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 467

def get_record(record_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#get_record.' if logger

  raise "Missing the required parameter 'record_id' when calling get_record." if record_id.nil?
  raise "Parameter value for 'record_id' must not be blank" if OCI::Internal::Util.blank_string?(record_id)

  path = '/records/{recordId}'.sub('{recordId}', record_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#get_record') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::Record'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_record_content(record_id, opts = {}, &block) ⇒ Response

Note:

Click here to see an example of how to use get_record_content API.

Retrieves the content of the record from the dataset source.

Parameters:

  • record_id (String)

    The OCID of the record annotated.

  • opts (Hash) (defaults to: {})

    the optional parameters

  • [Block] (Hash)

    a customizable set of options

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :if_none_match (String)

    For optimistic concurrency control. In the GET call for a resource, set the if-none-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be fetched only if the etag you provide does not match the resource's current etag value.

  • :response_target (String, IO)

    Streaming http body into a file (specified by file name or File object) or IO object if the block is not given

Returns:

  • (Response)

    A Response object with data of type String if response_target and block are not given, otherwise with nil data



530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 530

def get_record_content(record_id, opts = {}, &block)
  logger.debug 'Calling operation DataLabelingClient#get_record_content.' if logger

  raise "Missing the required parameter 'record_id' when calling get_record_content." if record_id.nil?
  raise "Parameter value for 'record_id' must not be blank" if OCI::Internal::Util.blank_string?(record_id)

  path = '/records/{recordId}/content'.sub('{recordId}', record_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = opts[:accept] if opts[:accept]
  header_params[:accept] ||= 'application/octet-stream'
  header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding]
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#get_record_content') do
    if !block.nil?
      @api_client.call_api(
        :GET,
        path,
        endpoint,
        header_params: header_params,
        query_params: query_params,
        operation_signing_strategy: operation_signing_strategy,
        body: post_body,
        return_type: 'Stream',
        &block
      )
    elsif opts[:response_target]
      if opts[:response_target].respond_to? :write
        @api_client.call_api(
          :GET,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'Stream',
          &proc { |chunk, _response| opts[:response_target].write(chunk) }
        )
      elsif opts[:response_target].is_a?(String)
        File.open(opts[:response_target], 'wb') do |output|
          return @api_client.call_api(
            :GET,
            path,
            endpoint,
            header_params: header_params,
            query_params: query_params,
            operation_signing_strategy: operation_signing_strategy,
            body: post_body,
            return_type: 'Stream',
            &proc { |chunk, _response| output.write(chunk) }
          )
        end
      end
    else
      @api_client.call_api(
        :GET,
        path,
        endpoint,
        header_params: header_params,
        query_params: query_params,
        operation_signing_strategy: operation_signing_strategy,
        body: post_body,
        return_type: 'String'
      )
    end
  end
  # rubocop:enable Metrics/BlockLength
end

#get_record_preview_content(record_id, opts = {}, &block) ⇒ Response

Note:

Click here to see an example of how to use get_record_preview_content API.

Retrieves the preview of the record content from the dataset source.

Parameters:

  • record_id (String)

    The OCID of the record annotated.

  • opts (Hash) (defaults to: {})

    the optional parameters

  • [Block] (Hash)

    a customizable set of options

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    The client request ID for tracing.

  • :if_none_match (String)

    For optimistic concurrency control. In the GET call for a resource, set the if-none-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be fetched only if the etag you provide does not match the resource's current etag value.

  • :response_target (String, IO)

    Streaming http body into a file (specified by file name or File object) or IO object if the block is not given

Returns:

  • (Response)

    A Response object with data of type String if response_target and block are not given, otherwise with nil data



638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 638

def get_record_preview_content(record_id, opts = {}, &block)
  logger.debug 'Calling operation DataLabelingClient#get_record_preview_content.' if logger

  raise "Missing the required parameter 'record_id' when calling get_record_preview_content." if record_id.nil?
  raise "Parameter value for 'record_id' must not be blank" if OCI::Internal::Util.blank_string?(record_id)

  path = '/records/{recordId}/preview/content'.sub('{recordId}', record_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = opts[:accept] if opts[:accept]
  header_params[:accept] ||= 'application/octet-stream'
  header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding]
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-none-match'] = opts[:if_none_match] if opts[:if_none_match]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#get_record_preview_content') do
    if !block.nil?
      @api_client.call_api(
        :GET,
        path,
        endpoint,
        header_params: header_params,
        query_params: query_params,
        operation_signing_strategy: operation_signing_strategy,
        body: post_body,
        return_type: 'Stream',
        &block
      )
    elsif opts[:response_target]
      if opts[:response_target].respond_to? :write
        @api_client.call_api(
          :GET,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'Stream',
          &proc { |chunk, _response| opts[:response_target].write(chunk) }
        )
      elsif opts[:response_target].is_a?(String)
        File.open(opts[:response_target], 'wb') do |output|
          return @api_client.call_api(
            :GET,
            path,
            endpoint,
            header_params: header_params,
            query_params: query_params,
            operation_signing_strategy: operation_signing_strategy,
            body: post_body,
            return_type: 'Stream',
            &proc { |chunk, _response| output.write(chunk) }
          )
        end
      end
    else
      @api_client.call_api(
        :GET,
        path,
        endpoint,
        header_params: header_params,
        query_params: query_params,
        operation_signing_strategy: operation_signing_strategy,
        body: post_body,
        return_type: 'String'
      )
    end
  end
  # rubocop:enable Metrics/BlockLength
end

#list_annotations(compartment_id, dataset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_annotations API.

Returns a list of annotations.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • dataset_id (String)

    Filter the results by the OCID of the dataset.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :lifecycle_state (String)

    A filter to return only resources whose lifecycleState matches the given lifecycleState.

  • :id (String)

    The unique OCID identifier.

  • :updated_by (String)

    The OCID of the principal which updated the annotation.

  • :record_id (String)

    The OCID of the record annotated.

  • :time_created_greater_than_or_equal_to (DateTime)

    The date and time the resource was created, in the timestamp format defined by RFC3339.

  • :time_created_less_than_or_equal_to (DateTime)

    The date and time the resource was created, in the timestamp format defined by RFC3339.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'. (default to ASC)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. The default order for timeCreated is descending. If no value is specified timeCreated is used by default. (default to timeCreated) Allowed values are: timeCreated, label

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 752

def list_annotations(compartment_id, dataset_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#list_annotations.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_annotations." if compartment_id.nil?
  raise "Missing the required parameter 'dataset_id' when calling list_annotations." if dataset_id.nil?

  if opts[:lifecycle_state] && !OCI::DataLabelingServiceDataplane::Models::Annotation::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::DataLabelingServiceDataplane::Models::Annotation::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_order] && !OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated label].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, label.'
  end

  path = '/annotations'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:datasetId] = dataset_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:updatedBy] = opts[:updated_by] if opts[:updated_by]
  query_params[:recordId] = opts[:record_id] if opts[:record_id]
  query_params[:timeCreatedGreaterThanOrEqualTo] = opts[:time_created_greater_than_or_equal_to] if opts[:time_created_greater_than_or_equal_to]
  query_params[:timeCreatedLessThanOrEqualTo] = opts[:time_created_less_than_or_equal_to] if opts[:time_created_less_than_or_equal_to]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#list_annotations') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::AnnotationCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_records(compartment_id, dataset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_records API.

The list of records in the specified compartment.

Allowed values are: timeCreated, name

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • dataset_id (String)

    Filter the results by the OCID of the dataset.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :lifecycle_state (String)

    A filter to return only resources whose lifecycleState matches the given lifecycleState.

  • :name (String)

    The name of the record.

  • :id (String)

    The unique OCID identifier.

  • :is_labeled (BOOLEAN)

    Whether the record has been labeled and has associated annotations.

  • :annotation_labels_contains (Array<String>)

    Lets the user filter records based on the related annotations.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'. (default to ASC)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. The default order for timeCreated is descending. The default order for name is ascending. If no value is specified, timeCreated is used by default. (default to timeCreated)

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 844

def list_records(compartment_id, dataset_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#list_records.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_records." if compartment_id.nil?
  raise "Missing the required parameter 'dataset_id' when calling list_records." if dataset_id.nil?

  if opts[:lifecycle_state] && !OCI::DataLabelingServiceDataplane::Models::Record::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::DataLabelingServiceDataplane::Models::Record::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_order] && !OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated name].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, name.'
  end

  path = '/records'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:datasetId] = dataset_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:name] = opts[:name] if opts[:name]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:isLabeled] = opts[:is_labeled] if !opts[:is_labeled].nil?
  query_params[:annotationLabelsContains] = OCI::ApiClient.build_collection_params(opts[:annotation_labels_contains], :multi) if opts[:annotation_labels_contains] && !opts[:annotation_labels_contains].empty?
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#list_records') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::RecordCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



94
95
96
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 94

def logger
  @api_client.config.logger
end

#summarize_annotation_analytics(compartment_id, dataset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use summarize_annotation_analytics API.

Summarize the annotations created for a given dataset.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • dataset_id (String)

    Filter the results by the OCID of the dataset.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :lifecycle_state (String)

    A filter to return only resources whose lifecycleState matches the given lifecycleState.

  • :label (String)

    It summarizes annotations with the specified label.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'. (default to ASC)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. The default order is descending. If no value is specified, updatedBy is used by default. (default to updatedBy) Allowed values are: count, label, updatedBy

  • :annotation_group_by (String)

    The field to group by. If no value is specified, updatedBy is used by default. (default to updatedBy) Allowed values are: updatedBy, label

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 932

def summarize_annotation_analytics(compartment_id, dataset_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#summarize_annotation_analytics.' if logger

  raise "Missing the required parameter 'compartment_id' when calling summarize_annotation_analytics." if compartment_id.nil?
  raise "Missing the required parameter 'dataset_id' when calling summarize_annotation_analytics." if dataset_id.nil?

  if opts[:lifecycle_state] && !OCI::DataLabelingServiceDataplane::Models::Annotation::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::DataLabelingServiceDataplane::Models::Annotation::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_order] && !OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:sort_by] && !%w[count label updatedBy].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of count, label, updatedBy.'
  end

  if opts[:annotation_group_by] && !%w[updatedBy label].include?(opts[:annotation_group_by])
    raise 'Invalid value for "annotation_group_by", must be one of updatedBy, label.'
  end

  path = '/annotationAnalytics'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:datasetId] = dataset_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:label] = opts[:label] if opts[:label]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:annotationGroupBy] = opts[:annotation_group_by] if opts[:annotation_group_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#summarize_annotation_analytics') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::AnnotationAnalyticsAggregationCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#summarize_record_analytics(compartment_id, dataset_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use summarize_record_analytics API.

Summarize the records created for a given dataset.

Allowed values are: isLabeled, annotationLabelContains

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • dataset_id (String)

    Filter the results by the OCID of the dataset.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :lifecycle_state (String)

    A filter to return only resources whose lifecycleState matches the given lifecycleState.

  • :limit (Integer)

    The maximum number of items to return. (default to 10)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either 'asc' or 'desc'. (default to ASC)

  • :record_group_by (String)

    The field to group by. If no value is specified isLabeled is used by default. (default to isLabeled)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. The default order is descending. If no value is specified, count is used by default. (default to count) Allowed values are: count, isLabeled

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 1022

def summarize_record_analytics(compartment_id, dataset_id, opts = {})
  logger.debug 'Calling operation DataLabelingClient#summarize_record_analytics.' if logger

  raise "Missing the required parameter 'compartment_id' when calling summarize_record_analytics." if compartment_id.nil?
  raise "Missing the required parameter 'dataset_id' when calling summarize_record_analytics." if dataset_id.nil?

  if opts[:lifecycle_state] && !OCI::DataLabelingServiceDataplane::Models::Record::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::DataLabelingServiceDataplane::Models::Record::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_order] && !OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::DataLabelingServiceDataplane::Models::SORT_ORDERS_ENUM.'
  end

  if opts[:record_group_by] && !%w[isLabeled annotationLabelContains].include?(opts[:record_group_by])
    raise 'Invalid value for "record_group_by", must be one of isLabeled, annotationLabelContains.'
  end

  if opts[:sort_by] && !%w[count isLabeled].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of count, isLabeled.'
  end

  path = '/recordAnalytics'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:datasetId] = dataset_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:recordGroupBy] = opts[:record_group_by] if opts[:record_group_by]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#summarize_record_analytics') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::RecordAnalyticsAggregationCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_annotation(annotation_id, update_annotation_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_annotation API.

Updates an annotation.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 1108

def update_annotation(annotation_id, update_annotation_details, opts = {})
  logger.debug 'Calling operation DataLabelingClient#update_annotation.' if logger

  raise "Missing the required parameter 'annotation_id' when calling update_annotation." if annotation_id.nil?
  raise "Missing the required parameter 'update_annotation_details' when calling update_annotation." if update_annotation_details.nil?
  raise "Parameter value for 'annotation_id' must not be blank" if OCI::Internal::Util.blank_string?(annotation_id)

  path = '/annotations/{annotationId}'.sub('{annotationId}', annotation_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_annotation_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#update_annotation') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::Annotation'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_record(record_id, update_record_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_record API.

Updates a record.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource is updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
# File 'lib/oci/data_labeling_service_dataplane/data_labeling_client.rb', line 1172

def update_record(record_id, update_record_details, opts = {})
  logger.debug 'Calling operation DataLabelingClient#update_record.' if logger

  raise "Missing the required parameter 'record_id' when calling update_record." if record_id.nil?
  raise "Missing the required parameter 'update_record_details' when calling update_record." if update_record_details.nil?
  raise "Parameter value for 'record_id' must not be blank" if OCI::Internal::Util.blank_string?(record_id)

  path = '/records/{recordId}'.sub('{recordId}', record_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_record_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DataLabelingClient#update_record') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::DataLabelingServiceDataplane::Models::Record'
    )
  end
  # rubocop:enable Metrics/BlockLength
end