Class: OCI::AiLanguage::AIServiceLanguageClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/ai_language/ai_service_language_client.rb

Overview

OCI Language Service solutions can help enterprise customers integrate AI into their products immediately using our proven, pre-trained and custom models or containers, without a need to set up an house team of AI and ML experts. This allows enterprises to focus on business drivers and development work rather than AI and ML operations, which shortens the time to market.

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) ⇒ AIServiceLanguageClient

Creates a new AIServiceLanguageClient. 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



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

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 + '/20221001'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "AIServiceLanguageClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



17
18
19
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 17

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


21
22
23
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 21

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


31
32
33
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 31

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



27
28
29
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 27

def retry_config
  @retry_config
end

Instance Method Details

#batch_detect_dominant_language(batch_detect_dominant_language_details, opts = {}) ⇒ Response

Note:

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

The API returns the detected language and a related confidence score (between 0 and 1). It supports passing a batch of records.

List of supported languages.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

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:



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
156
157
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 122

def batch_detect_dominant_language(batch_detect_dominant_language_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#batch_detect_dominant_language.' if logger

  raise "Missing the required parameter 'batch_detect_dominant_language_details' when calling batch_detect_dominant_language." if batch_detect_dominant_language_details.nil?

  path = '/actions/batchDetectDominantLanguage'
  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 = @api_client.object_to_http_body(batch_detect_dominant_language_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#batch_detect_dominant_language') 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::AiLanguage::Models::BatchDetectDominantLanguageResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#batch_detect_language_entities(batch_detect_language_entities_details, opts = {}) ⇒ Response

Note:

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

The API extracts entities in text records. For each entity, its type/subtype and confidence score (between 0 and 1) is returned. It supports passing a batch of records.

List of supported entities.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

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:



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
218
219
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 184

def batch_detect_language_entities(batch_detect_language_entities_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#batch_detect_language_entities.' if logger

  raise "Missing the required parameter 'batch_detect_language_entities_details' when calling batch_detect_language_entities." if batch_detect_language_entities_details.nil?

  path = '/actions/batchDetectLanguageEntities'
  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 = @api_client.object_to_http_body(batch_detect_language_entities_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#batch_detect_language_entities') 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::AiLanguage::Models::BatchDetectLanguageEntitiesResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#batch_detect_language_key_phrases(batch_detect_language_key_phrases_details, opts = {}) ⇒ Response

Note:

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

The API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text. It supports passing a batch of records.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

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:



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
279
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 244

def batch_detect_language_key_phrases(batch_detect_language_key_phrases_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#batch_detect_language_key_phrases.' if logger

  raise "Missing the required parameter 'batch_detect_language_key_phrases_details' when calling batch_detect_language_key_phrases." if batch_detect_language_key_phrases_details.nil?

  path = '/actions/batchDetectLanguageKeyPhrases'
  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 = @api_client.object_to_http_body(batch_detect_language_key_phrases_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#batch_detect_language_key_phrases') 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::AiLanguage::Models::BatchDetectLanguageKeyPhrasesResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#batch_detect_language_pii_entities(batch_detect_language_pii_entities_details, opts = {}) ⇒ Response

Note:

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

The API extracts pii entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned. It supports passing a batch of records.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

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:



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/ai_language/ai_service_language_client.rb', line 304

def batch_detect_language_pii_entities(batch_detect_language_pii_entities_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#batch_detect_language_pii_entities.' if logger

  raise "Missing the required parameter 'batch_detect_language_pii_entities_details' when calling batch_detect_language_pii_entities." if batch_detect_language_pii_entities_details.nil?

  path = '/actions/batchDetectLanguagePiiEntities'
  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 = @api_client.object_to_http_body(batch_detect_language_pii_entities_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#batch_detect_language_pii_entities') 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::AiLanguage::Models::BatchDetectLanguagePiiEntitiesResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#batch_detect_language_sentiments(batch_detect_language_sentiments_details, opts = {}) ⇒ Response

Note:

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

The API extracts aspect-based and sentence level sentiment in text records.

For aspect-based sentiment analysis, a set of aspects and their respective sentiment is returned for each record. Similarly, for sentence-level sentiment analysis, the sentiment is returned at the sentence level.

For sentiment analysis, confidence scores are provided for each of the classes (positive, negative, neutral and mixed).

Learn more about sentiment analysis here.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

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.

  • :level (Array<String>)

    Set this parameter for sentence and aspect level sentiment analysis. Allowed values are: - ASPECT - SENTENCE

    Allowed values are: ASPECT, SENTENCE

Returns:



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 376

def batch_detect_language_sentiments(batch_detect_language_sentiments_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#batch_detect_language_sentiments.' if logger

  raise "Missing the required parameter 'batch_detect_language_sentiments_details' when calling batch_detect_language_sentiments." if batch_detect_language_sentiments_details.nil?


  level_allowable_values = %w[ASPECT SENTENCE]
  if opts[:level] && !opts[:level].empty?
    opts[:level].each do |val_to_check|
      unless level_allowable_values.include?(val_to_check)
        raise 'Invalid value for "level", must be one of ASPECT, SENTENCE.'
      end
    end
  end

  path = '/actions/batchDetectLanguageSentiments'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:level] = OCI::ApiClient.build_collection_params(opts[:level], :multi) if opts[:level] && !opts[:level].empty?

  # 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 = @api_client.object_to_http_body(batch_detect_language_sentiments_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#batch_detect_language_sentiments') 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::AiLanguage::Models::BatchDetectLanguageSentimentsResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#batch_detect_language_text_classification(batch_detect_language_text_classification_details, opts = {}) ⇒ Response

Note:

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

The API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified.

It supports passing a batch of records.

Learn more about text classification here.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

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:



451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 451

def batch_detect_language_text_classification(batch_detect_language_text_classification_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#batch_detect_language_text_classification.' if logger

  raise "Missing the required parameter 'batch_detect_language_text_classification_details' when calling batch_detect_language_text_classification." if batch_detect_language_text_classification_details.nil?

  path = '/actions/batchDetectLanguageTextClassification'
  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 = @api_client.object_to_http_body(batch_detect_language_text_classification_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#batch_detect_language_text_classification') 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::AiLanguage::Models::BatchDetectLanguageTextClassificationResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#batch_language_translation(batch_language_translation_details, opts = {}) ⇒ Response

Note:

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

Translate text to other language over pre-deployed model. Use state of the art neural machine translation to translate text between more than 15 languages. Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

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:



511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 511

def batch_language_translation(batch_language_translation_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#batch_language_translation.' if logger

  raise "Missing the required parameter 'batch_language_translation_details' when calling batch_language_translation." if batch_language_translation_details.nil?

  path = '/actions/batchLanguageTranslation'
  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 = @api_client.object_to_http_body(batch_language_translation_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#batch_language_translation') 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::AiLanguage::Models::BatchLanguageTranslationResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_endpoint_compartment(endpoint_id, change_endpoint_compartment_details, opts = {}) ⇒ Response

Note:

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

Moves a Endpoint into a different compartment. When provided, If-Match is checked against ETag values of the resource.

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)

    Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :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 will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



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
612
613
614
615
616
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 577

def change_endpoint_compartment(endpoint_id, change_endpoint_compartment_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#change_endpoint_compartment.' if logger

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

  path = '/endpoints/{endpointId}/actions/changeCompartment'.sub('{endpointId}', endpoint_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]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_endpoint_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#change_endpoint_compartment') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_model_compartment(model_id, change_model_compartment_details, opts = {}) ⇒ Response

Note:

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

Moves a Model into a different compartment. When provided, If-Match is checked against ETag values of the resource.

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)

    Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :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 will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



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
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 647

def change_model_compartment(model_id, change_model_compartment_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#change_model_compartment.' if logger

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

  path = '/models/{modelId}/actions/changeCompartment'.sub('{modelId}', model_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]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_model_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#change_model_compartment') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_project_compartment(project_id, change_project_compartment_details, opts = {}) ⇒ Response

Note:

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

Moves a Project into a different compartment. When provided, If-Match is checked against ETag values of the resource.

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)

    Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :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 will be updated or deleted only if the etag you provide matches the resource's current etag value.

  • :opc_retry_token (String)

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

Returns:

  • (Response)

    A Response object with data of type nil



717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 717

def change_project_compartment(project_id, change_project_compartment_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#change_project_compartment.' if logger

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

  path = '/projects/{projectId}/actions/changeCompartment'.sub('{projectId}', project_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]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_project_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#change_project_compartment') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_endpoint(create_endpoint_details, opts = {}) ⇒ Response

Note:

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

Creates a new endpoint and deploy the trained model

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 in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to 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:



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
813
814
815
816
817
818
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 781

def create_endpoint(create_endpoint_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#create_endpoint.' if logger

  raise "Missing the required parameter 'create_endpoint_details' when calling create_endpoint." if create_endpoint_details.nil?

  path = '/endpoints'
  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_endpoint_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#create_endpoint') 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::AiLanguage::Models::Endpoint'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_model(create_model_details, opts = {}) ⇒ Response

Note:

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

Creates a new model for training and train the model with date provided.

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 in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to 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:



843
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
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 843

def create_model(create_model_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#create_model.' if logger

  raise "Missing the required parameter 'create_model_details' when calling create_model." if create_model_details.nil?

  path = '/models'
  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_model_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#create_model') 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::AiLanguage::Models::Model'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_project(create_project_details, opts = {}) ⇒ Response

Note:

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

Creates a new Project.

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 in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to 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:



905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 905

def create_project(create_project_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#create_project.' if logger

  raise "Missing the required parameter 'create_project_details' when calling create_project." if create_project_details.nil?

  path = '/projects'
  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_project_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#create_project') 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::AiLanguage::Models::Project'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_endpoint(endpoint_id, opts = {}) ⇒ Response

Note:

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

Deletes a provisioned endpoint resource by identifier. This operation fails with a 409 error unless all associated resources are in a DELETED state. You must delete all associated resources before deleting a model.

Parameters:

  • endpoint_id (String)

    The OCID of the endpoint.

  • 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 will be 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



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
994
995
996
997
998
999
1000
1001
1002
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 966

def delete_endpoint(endpoint_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#delete_endpoint.' if logger

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

  path = '/endpoints/{endpointId}'.sub('{endpointId}', endpoint_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: 'AIServiceLanguageClient#delete_endpoint') 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_model(model_id, opts = {}) ⇒ Response

Note:

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

Deletes a provisioned model resource by identifier. This operation fails with a 409 error unless all associated resources are in a DELETED state. You must delete all associated resources before deleting a model.

Parameters:

  • model_id (String)

    unique model 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

  • :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 will be 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



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
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1026

def delete_model(model_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#delete_model.' if logger

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

  path = '/models/{modelId}'.sub('{modelId}', model_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: 'AIServiceLanguageClient#delete_model') 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_project(project_id, opts = {}) ⇒ Response

Note:

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

Deletes a Project resource by identifier. This operation fails with a 409 error unless all associated resources (models deployments or data assets) are in a DELETED state. You must delete all associated resources before deleting a project.

Parameters:

  • project_id (String)

    The OCID of the project.

  • 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 will be 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



1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1086

def delete_project(project_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#delete_project.' if logger

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

  path = '/projects/{projectId}'.sub('{projectId}', project_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: 'AIServiceLanguageClient#delete_project') 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

#detect_dominant_language(detect_dominant_language_details, opts = {}) ⇒ Response

Note:

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

This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT The API returns the detected language and a related confidence score (between 0 and 1).

List of supported languages.

Limitations: - A record may be up to 1000 characters long.

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:



1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1148

def detect_dominant_language(detect_dominant_language_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#detect_dominant_language.' if logger

  raise "Missing the required parameter 'detect_dominant_language_details' when calling detect_dominant_language." if detect_dominant_language_details.nil?

  path = '/actions/detectDominantLanguage'
  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 = @api_client.object_to_http_body(detect_dominant_language_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#detect_dominant_language') 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::AiLanguage::Models::DetectDominantLanguageResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#detect_language_entities(detect_language_entities_details, opts = {}) ⇒ Response

Note:

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

This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT The API extracts entities in text records. For each entity, its type and confidence score (between 0 and 1) is returned.

Limitations: - A text may be up to 1000 characters long.

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.

  • :model_version (String)

    Named Entity Recognition model versions. By default user will get output from V2.1 implementation. (default to V2_1)

  • :is_pii (BOOLEAN)

    If this parameter is set to true, you only get PII (Personally identifiable information) entities like PhoneNumber, Email, Person, and so on. Default value is false. (default to false)

Returns:



1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1211

def detect_language_entities(detect_language_entities_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#detect_language_entities.' if logger

  raise "Missing the required parameter 'detect_language_entities_details' when calling detect_language_entities." if detect_language_entities_details.nil?

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

  path = '/actions/detectLanguageEntities'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:modelVersion] = opts[:model_version] if opts[:model_version]
  query_params[:isPii] = opts[:is_pii] if !opts[:is_pii].nil?

  # 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 = @api_client.object_to_http_body(detect_language_entities_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#detect_language_entities') 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::AiLanguage::Models::DetectLanguageEntitiesResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#detect_language_key_phrases(detect_language_key_phrases_details, opts = {}) ⇒ Response

Note:

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

This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT The API extracts key-phrases in text records. For each key-phrase, a score (between 0 and 1) is returned that highlights the importance of the key-phrase in the context of the text.

Limitations: - A record may be up to 1000 characters long.

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:



1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1276

def detect_language_key_phrases(detect_language_key_phrases_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#detect_language_key_phrases.' if logger

  raise "Missing the required parameter 'detect_language_key_phrases_details' when calling detect_language_key_phrases." if detect_language_key_phrases_details.nil?

  path = '/actions/detectLanguageKeyPhrases'
  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 = @api_client.object_to_http_body(detect_language_key_phrases_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#detect_language_key_phrases') 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::AiLanguage::Models::DetectLanguageKeyPhrasesResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#detect_language_sentiments(detect_language_sentiments_details, opts = {}) ⇒ Response

Note:

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

This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT The API extracts aspect-based in text records.

For aspect-based sentiment analysis, a set of aspects and their respective sentiment is returned.

For sentiment analysis, confidence scores are provided for each of the classes (positive, negative, neutral).

Learn more about sentiment analysis here.

Limitations: - A record may be up to 1000 characters long.

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:



1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1341

def detect_language_sentiments(detect_language_sentiments_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#detect_language_sentiments.' if logger

  raise "Missing the required parameter 'detect_language_sentiments_details' when calling detect_language_sentiments." if detect_language_sentiments_details.nil?

  path = '/actions/detectLanguageSentiments'
  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 = @api_client.object_to_http_body(detect_language_sentiments_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#detect_language_sentiments') 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::AiLanguage::Models::DetectLanguageSentimentsResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#detect_language_text_classification(detect_language_text_classification_details, opts = {}) ⇒ Response

Note:

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

This API will be retired on Monday, 10 Oct 2023 00:00:00 GMT The API automatically classifies text into a set of pre-determined classes and sub-classes. A single class/subclass is returned for each record classified.

Learn more about text classification here.

Limitations: - A record may be up to 1000 characters long.

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:



1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1402

def detect_language_text_classification(detect_language_text_classification_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#detect_language_text_classification.' if logger

  raise "Missing the required parameter 'detect_language_text_classification_details' when calling detect_language_text_classification." if detect_language_text_classification_details.nil?

  path = '/actions/detectLanguageTextClassification'
  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 = @api_client.object_to_http_body(detect_language_text_classification_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#detect_language_text_classification') 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::AiLanguage::Models::DetectLanguageTextClassificationResult'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_endpoint(endpoint_id, opts = {}) ⇒ Response

Note:

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

Gets an endpoint by identifier

Parameters:

  • endpoint_id (String)

    The OCID of the endpoint.

  • 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:



1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1455

def get_endpoint(endpoint_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#get_endpoint.' if logger

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

  path = '/endpoints/{endpointId}'.sub('{endpointId}', endpoint_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: 'AIServiceLanguageClient#get_endpoint') 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::AiLanguage::Models::Endpoint'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_model(model_id, opts = {}) ⇒ Response

Note:

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

Gets a model by identifier

Parameters:

  • model_id (String)

    unique model 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:



1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1509

def get_model(model_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#get_model.' if logger

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

  path = '/models/{modelId}'.sub('{modelId}', model_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: 'AIServiceLanguageClient#get_model') 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::AiLanguage::Models::Model'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_model_type(model_type, opts = {}) ⇒ Response

Note:

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

Gets model capabilities

Parameters:

  • model_type (String)

    Results like version and model supported info by specifying model type

  • 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:



1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1563

def get_model_type(model_type, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#get_model_type.' if logger

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

  path = '/modelTypes/{modelType}'.sub('{modelType}', model_type.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: 'AIServiceLanguageClient#get_model_type') 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::AiLanguage::Models::ModelTypeInfo'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_project(project_id, opts = {}) ⇒ Response

Note:

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

Gets a Project by identifier

Parameters:

  • project_id (String)

    The OCID of the project.

  • 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:



1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1617

def get_project(project_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#get_project.' if logger

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

  path = '/projects/{projectId}'.sub('{projectId}', project_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: 'AIServiceLanguageClient#get_project') 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::AiLanguage::Models::Project'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_work_request(work_request_id, opts = {}) ⇒ Response

Note:

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

Gets the status of the work request with the given ID.

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

  • 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:



1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1671

def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#get_work_request.' if logger

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

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_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: 'AIServiceLanguageClient#get_work_request') 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::AiLanguage::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_endpoints(compartment_id, opts = {}) ⇒ Response

Note:

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

Returns a list of Endpoints.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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

  • :endpoint_id (String)

    The OCID of the endpoint.

  • :project_id (String)

    The ID of the project for which to list the objects.

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :model_id (String)

    The ID of the trained model for which to list the endpoints.

  • :lifecycle_state (String)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

  • :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)

    Specifies the field to sort by. Accepts only one field. By default, when you sort by timeCreated, the results are shown in descending order. When you sort by displayName, the results are shown in ascending order. Sort order for the displayName field is case sensitive. (default to timeCreated) Allowed values are: timeCreated, displayName

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1742

def list_endpoints(compartment_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#list_endpoints.' if logger

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

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

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

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

  path = '/endpoints'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:endpointId] = opts[:endpoint_id] if opts[:endpoint_id]
  query_params[:projectId] = opts[:project_id] if opts[:project_id]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:modelId] = opts[:model_id] if opts[:model_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[: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: 'AIServiceLanguageClient#list_endpoints') 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::AiLanguage::Models::EndpointCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_evaluation_results(model_id, opts = {}) ⇒ Response

Note:

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

Get a (paginated) list of evaluation results for a given model.

Parameters:

  • model_id (String)

    unique model 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.

  • :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.

Returns:



1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1819

def list_evaluation_results(model_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#list_evaluation_results.' if logger

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

  path = '/models/{modelId}/evaluationResults'.sub('{modelId}', model_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # 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: 'AIServiceLanguageClient#list_evaluation_results') 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::AiLanguage::Models::EvaluationResultCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_models(compartment_id, opts = {}) ⇒ Response

Note:

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

Returns a list of models.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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

  • :model_id (String)

    unique model OCID.

  • :project_id (String)

    The ID of the project for which to list the objects.

  • :lifecycle_state (String)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :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)

    Specifies the field to sort by. Accepts only one field. By default, when you sort by timeCreated, the results are shown in descending order. When you sort by displayName, the results are shown in ascending order. Sort order for the displayName field is case sensitive. (default to timeCreated) Allowed values are: timeCreated, displayName

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1891

def list_models(compartment_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#list_models.' if logger

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

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

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

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

  path = '/models'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:modelId] = opts[:model_id] if opts[:model_id]
  query_params[:projectId] = opts[:project_id] if opts[:project_id]
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  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: 'AIServiceLanguageClient#list_models') 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::AiLanguage::Models::ModelCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_projects(compartment_id, opts = {}) ⇒ Response

Note:

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

Returns a list of Projects.

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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)

    Filter results by the specified lifecycle state. Must be a valid state for the resource type.

  • :display_name (String)

    A filter to return only resources that match the entire display name given.

  • :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.

  • :project_id (String)

    The ID of the project for which to list the objects.

  • :sort_order (String)

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

  • :sort_by (String)

    Specifies the field to sort by. Accepts only one field. By default, when you sort by timeCreated, the results are shown in descending order. When you sort by displayName, the results are shown in ascending order. Sort order for the displayName field is case sensitive. (default to timeCreated) Allowed values are: timeCreated, displayName

  • :opc_request_id (String)

    The client request ID for tracing.

Returns:



1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 1980

def list_projects(compartment_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#list_projects.' if logger

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

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

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

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

  path = '/projects'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:projectId] = opts[:project_id] if opts[:project_id]
  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: 'AIServiceLanguageClient#list_projects') 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::AiLanguage::Models::ProjectCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_errors(work_request_id, opts = {}) ⇒ Response

Note:

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

Return a (paginated) list of errors for a given work request.

Allowed values are: timeCreated, displayName

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

  • 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.

  • :page (String)

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

  • :limit (Integer)

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

  • :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. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. (default to timeCreated)

Returns:



2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 2060

def list_work_request_errors(work_request_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#list_work_request_errors.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_errors." if work_request_id.nil?

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

  if opts[:sort_by] && !%w[timeCreated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  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: 'AIServiceLanguageClient#list_work_request_errors') 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::AiLanguage::Models::WorkRequestErrorCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_logs(work_request_id, opts = {}) ⇒ Response

Note:

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

Return a (paginated) list of logs for a given work request.

Allowed values are: timeCreated, displayName

Parameters:

  • work_request_id (String)

    The ID of the asynchronous request.

  • 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.

  • :page (String)

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

  • :limit (Integer)

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

  • :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. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. (default to timeCreated)

Returns:



2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 2133

def list_work_request_logs(work_request_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#list_work_request_logs.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_logs." if work_request_id.nil?

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

  if opts[:sort_by] && !%w[timeCreated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  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: 'AIServiceLanguageClient#list_work_request_logs') 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::AiLanguage::Models::WorkRequestLogCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_requests(compartment_id, opts = {}) ⇒ Response

Note:

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

Lists the work requests in a compartment.

Allowed values are: timeCreated, displayName

Parameters:

  • compartment_id (String)

    The ID of the compartment in which to list resources.

  • 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

  • :work_request_id (String)

    The ID of the asynchronous work request.

  • :opc_request_id (String)

    The client request ID for tracing.

  • :page (String)

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

  • :limit (Integer)

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

  • :resource_id (String)

    The ID of the resource for which list workrequests.

  • :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. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default. (default to timeCreated)

Returns:



2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 2208

def list_work_requests(compartment_id, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#list_work_requests.' if logger

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

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

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

  path = '/workRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:workRequestId] = opts[:work_request_id] if opts[:work_request_id]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:resourceId] = opts[:resource_id] if opts[:resource_id]
  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: 'AIServiceLanguageClient#list_work_requests') 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::AiLanguage::Models::WorkRequestSummaryCollection'
    )
  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.



96
97
98
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 96

def logger
  @api_client.config.logger
end

#update_endpoint(endpoint_id, update_endpoint_details, opts = {}) ⇒ Response

Note:

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

Update the Endpoint identified by the id

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 will be 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



2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 2283

def update_endpoint(endpoint_id, update_endpoint_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#update_endpoint.' if logger

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

  path = '/endpoints/{endpointId}'.sub('{endpointId}', endpoint_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_endpoint_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#update_endpoint') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_model(model_id, update_model_details, opts = {}) ⇒ Response

Note:

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

Updates the model

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 will be 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



2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 2345

def update_model(model_id, update_model_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#update_model.' if logger

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

  path = '/models/{modelId}'.sub('{modelId}', model_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_model_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#update_model') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_project(project_id, update_project_details, opts = {}) ⇒ Response

Note:

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

Updates the Project

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 will be 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



2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
# File 'lib/oci/ai_language/ai_service_language_client.rb', line 2407

def update_project(project_id, update_project_details, opts = {})
  logger.debug 'Calling operation AIServiceLanguageClient#update_project.' if logger

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

  path = '/projects/{projectId}'.sub('{projectId}', project_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_project_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'AIServiceLanguageClient#update_project') 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
    )
  end
  # rubocop:enable Metrics/BlockLength
end