Class: OCI::Email::EmailClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/email/email_client.rb

Overview

Use the Email Delivery API to do the necessary set up to send high-volume and application-generated emails through the OCI Email Delivery service. For more information, see Overview of the Email Delivery Service.

Note: Write actions (POST, UPDATE, DELETE) may take several minutes to propagate and be reflected by the API. If a subsequent read request fails to reflect your changes, wait a few minutes and try again.

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

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



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

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

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



19
20
21
# File 'lib/oci/email/email_client.rb', line 19

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


23
24
25
# File 'lib/oci/email/email_client.rb', line 23

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


33
34
35
# File 'lib/oci/email/email_client.rb', line 33

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



29
30
31
# File 'lib/oci/email/email_client.rb', line 29

def retry_config
  @retry_config
end

Instance Method Details

#change_email_domain_compartment(email_domain_id, change_email_domain_compartment_details, opts = {}) ⇒ Response

Note:

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

Moves an email domain into a different compartment. When provided, If-Match is checked against ETag value of the resource. For information about moving resources between compartments, see Moving Resources to a Different Compartment.

Note: All DKIM objects associated with this email domain will also be moved into the provided compartment.

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)

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

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

Returns:

  • (Response)

    A Response object with data of type nil



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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/oci/email/email_client.rb', line 132

def change_email_domain_compartment(email_domain_id, change_email_domain_compartment_details, opts = {})
  logger.debug 'Calling operation EmailClient#change_email_domain_compartment.' if logger

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

  path = '/emailDomains/{emailDomainId}/actions/changeCompartment'.sub('{emailDomainId}', email_domain_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]
  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_email_domain_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EmailClient#change_email_domain_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_sender_compartment(sender_id, change_sender_compartment_details, opts = {}) ⇒ Response

Note:

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

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

Parameters:

  • sender_id (String)

    The unique OCID of the sender.

  • change_sender_compartment_details (OCI::Email::Models::ChangeSenderCompartmentDetails)

    Details for moving a sender into a different compartment.

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

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

Returns:

  • (Response)

    A Response object with data of type nil



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
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/oci/email/email_client.rb', line 194

def change_sender_compartment(sender_id, change_sender_compartment_details, opts = {})
  logger.debug 'Calling operation EmailClient#change_sender_compartment.' if logger

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

  path = '/senders/{senderId}/actions/changeCompartment'.sub('{senderId}', sender_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(change_sender_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EmailClient#change_sender_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_dkim(create_dkim_details, opts = {}) ⇒ Response

Note:

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

Creates a new DKIM for an email domain. This DKIM signs all approved senders in the tenancy that are in this email domain. Best security practices indicate to periodically rotate the DKIM that is doing the signing. When a second DKIM is applied, all senders seamlessly pick up the new key without interruption in signing.

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 request ID for tracing from the system

Returns:



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/oci/email/email_client.rb', line 260

def create_dkim(create_dkim_details, opts = {})
  logger.debug 'Calling operation EmailClient#create_dkim.' if logger

  raise "Missing the required parameter 'create_dkim_details' when calling create_dkim." if create_dkim_details.nil?

  path = '/dkims'
  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_dkim_details)

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

#create_email_domain(create_email_domain_details, opts = {}) ⇒ Response

Note:

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

Creates a new email domain. Avoid entering confidential information.

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 request ID for tracing from the system

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

Returns:



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/oci/email/email_client.rb', line 321

def create_email_domain(create_email_domain_details, opts = {})
  logger.debug 'Calling operation EmailClient#create_email_domain.' if logger

  raise "Missing the required parameter 'create_email_domain_details' when calling create_email_domain." if create_email_domain_details.nil?

  path = '/emailDomains'
  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[:'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(create_email_domain_details)

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

#create_sender(create_sender_details, opts = {}) ⇒ Response

Note:

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

Creates a sender for a tenancy in a given compartment.

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 request ID for tracing from the system

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
# File 'lib/oci/email/email_client.rb', line 376

def create_sender(create_sender_details, opts = {})
  logger.debug 'Calling operation EmailClient#create_sender.' if logger

  raise "Missing the required parameter 'create_sender_details' when calling create_sender." if create_sender_details.nil?

  path = '/senders'
  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(create_sender_details)

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

#create_suppression(create_suppression_details, opts = {}) ⇒ Response

Note:

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

Adds recipient email addresses to the suppression list for a tenancy. Addresses added to the suppression list via the API are denoted as "MANUAL" in the reason field. Note: All email addresses added to the suppression list are normalized to include only lowercase letters.

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 request ID for tracing from the system

Returns:



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/oci/email/email_client.rb', line 434

def create_suppression(create_suppression_details, opts = {})
  logger.debug 'Calling operation EmailClient#create_suppression.' if logger

  raise "Missing the required parameter 'create_suppression_details' when calling create_suppression." if create_suppression_details.nil?

  path = '/suppressions'
  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(create_suppression_details)

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

#delete_dkim(dkim_id, opts = {}) ⇒ Response

Note:

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

Deletes a DKIM. If this key is currently the active key for the email domain, deleting the key will stop signing the domain's outgoing mail. DKIM keys are left in DELETING state for about a day to allow DKIM signatures on in-transit mail to be validated. Consider creating a new DKIM for this domain so the signing can be rotated to it instead of deletion.

Parameters:

  • dkim_id (String)

    The OCID of this DKIM.

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

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

Returns:

  • (Response)

    A Response object with data of type nil



497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File 'lib/oci/email/email_client.rb', line 497

def delete_dkim(dkim_id, opts = {})
  logger.debug 'Calling operation EmailClient#delete_dkim.' if logger

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

  path = '/dkims/{dkimId}'.sub('{dkimId}', dkim_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: 'EmailClient#delete_dkim') 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_email_domain(email_domain_id, opts = {}) ⇒ Response

Note:

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

Deletes an email domain.

Parameters:

  • email_domain_id (String)

    The OCID of this email domain.

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

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

Returns:

  • (Response)

    A Response object with data of type nil



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/oci/email/email_client.rb', line 555

def delete_email_domain(email_domain_id, opts = {})
  logger.debug 'Calling operation EmailClient#delete_email_domain.' if logger

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

  path = '/emailDomains/{emailDomainId}'.sub('{emailDomainId}', email_domain_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: 'EmailClient#delete_email_domain') 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_sender(sender_id, opts = {}) ⇒ Response

Note:

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

Deletes an approved sender for a tenancy in a given compartment for a provided senderId.

Parameters:

  • sender_id (String)

    The unique OCID of the sender.

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

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

Returns:

  • (Response)

    A Response object with data of type nil



615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'lib/oci/email/email_client.rb', line 615

def delete_sender(sender_id, opts = {})
  logger.debug 'Calling operation EmailClient#delete_sender.' if logger

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

  path = '/senders/{senderId}'.sub('{senderId}', sender_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: 'EmailClient#delete_sender') 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_suppression(suppression_id, opts = {}) ⇒ Response

Note:

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

Removes a suppressed recipient email address from the suppression list for a tenancy in a given compartment for a provided suppressionId.

Parameters:

  • suppression_id (String)

    The unique OCID of the suppression.

  • 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 request ID for tracing from the system

Returns:

  • (Response)

    A Response object with data of type nil



671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
# File 'lib/oci/email/email_client.rb', line 671

def delete_suppression(suppression_id, opts = {})
  logger.debug 'Calling operation EmailClient#delete_suppression.' if logger

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

  path = '/suppressions/{suppressionId}'.sub('{suppressionId}', suppression_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: 'EmailClient#delete_suppression') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_dkim(dkim_id, opts = {}) ⇒ Response

Note:

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

Retrieves the specified DKIM.

Parameters:

  • dkim_id (String)

    The OCID of this DKIM.

  • 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 request ID for tracing from the system

Returns:



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
757
758
759
760
# File 'lib/oci/email/email_client.rb', line 724

def get_dkim(dkim_id, opts = {})
  logger.debug 'Calling operation EmailClient#get_dkim.' if logger

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

  path = '/dkims/{dkimId}'.sub('{dkimId}', dkim_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: 'EmailClient#get_dkim') 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::Email::Models::Dkim'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Returns email configuration associated with the specified compartment.

Parameters:

  • compartment_id (String)

    The OCID for the compartment.

  • 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 request ID for tracing from the system

Returns:



779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/oci/email/email_client.rb', line 779

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

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

  path = '/configuration'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id

  # 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: 'EmailClient#get_email_configuration') 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::Email::Models::Configuration'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_email_domain(email_domain_id, opts = {}) ⇒ Response

Note:

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

Retrieves the specified email domain.

Parameters:

  • email_domain_id (String)

    The OCID of this email domain.

  • 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 request ID for tracing from the system

Returns:



833
834
835
836
837
838
839
840
841
842
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
# File 'lib/oci/email/email_client.rb', line 833

def get_email_domain(email_domain_id, opts = {})
  logger.debug 'Calling operation EmailClient#get_email_domain.' if logger

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

  path = '/emailDomains/{emailDomainId}'.sub('{emailDomainId}', email_domain_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: 'EmailClient#get_email_domain') 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::Email::Models::EmailDomain'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_sender(sender_id, opts = {}) ⇒ Response

Note:

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

Gets an approved sender for a given senderId.

Parameters:

  • sender_id (String)

    The unique OCID of the sender.

  • 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 request ID for tracing from the system

Returns:



887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/oci/email/email_client.rb', line 887

def get_sender(sender_id, opts = {})
  logger.debug 'Calling operation EmailClient#get_sender.' if logger

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

  path = '/senders/{senderId}'.sub('{senderId}', sender_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: 'EmailClient#get_sender') 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::Email::Models::Sender'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_suppression(suppression_id, opts = {}) ⇒ Response

Note:

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

Gets the details of a suppressed recipient email address for a given suppressionId. Each suppression is given a unique OCID.

Parameters:

  • suppression_id (String)

    The unique OCID of the suppression.

  • 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 request ID for tracing from the system

Returns:



943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'lib/oci/email/email_client.rb', line 943

def get_suppression(suppression_id, opts = {})
  logger.debug 'Calling operation EmailClient#get_suppression.' if logger

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

  path = '/suppressions/{suppressionId}'.sub('{suppressionId}', suppression_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: 'EmailClient#get_suppression') 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::Email::Models::Suppression'
    )
  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 request ID for tracing from the system

Returns:



997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
# File 'lib/oci/email/email_client.rb', line 997

def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation EmailClient#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: 'EmailClient#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::Email::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_dkims(email_domain_id, opts = {}) ⇒ Response

Note:

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

Lists DKIMs for an email domain.

Parameters:

  • email_domain_id (String)

    The OCID of the email domain to which this DKIM belongs.

  • 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 request ID for tracing from the system

  • :id (String)

    A filter to only return resources that match the given id exactly.

  • :name (String)

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

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :sort_order (String)

    The sort order to use, either ascending or descending order.

  • :lifecycle_state (String)

    Filter returned list by specified lifecycle state. This parameter is case-insensitive.

  • :sort_by (String)

    Specifies the attribute with which to sort the DKIMs.

    Default: TIMECREATED

    • TIMECREATED: Sorts by timeCreated.

    • NAME: Sorts by name.

    • ID: Sorts by id. (default to TIMECREATED) Allowed values are: TIMECREATED, ID, NAME

Returns:



1077
1078
1079
1080
1081
1082
1083
1084
1085
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
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
# File 'lib/oci/email/email_client.rb', line 1077

def list_dkims(email_domain_id, opts = {})
  logger.debug 'Calling operation EmailClient#list_dkims.' if logger

  raise "Missing the required parameter 'email_domain_id' when calling list_dkims." if email_domain_id.nil?

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

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

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

  path = '/dkims'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:emailDomainId] = email_domain_id
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:name] = opts[:name] if opts[: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[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  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: 'EmailClient#list_dkims') 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::Email::Models::DkimCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Lists email domains in the specified compartment.

Parameters:

  • compartment_id (String)

    The OCID for the compartment.

  • 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 request ID for tracing from the system

  • :id (String)

    A filter to only return resources that match the given id exactly.

  • :name (String)

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

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :sort_order (String)

    The sort order to use, either ascending or descending order.

  • :lifecycle_state (String)

    Filter returned list by specified lifecycle state. This parameter is case-insensitive.

  • :sort_by (String)

    Specifies the attribute with which to sort the email domains.

    Default: TIMECREATED

    • TIMECREATED: Sorts by timeCreated.

    • NAME: Sorts by name.

    • ID: Sorts by id. (default to TIMECREATED) Allowed values are: TIMECREATED, ID, NAME

Returns:



1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
# File 'lib/oci/email/email_client.rb', line 1175

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

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

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

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

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

  path = '/emailDomains'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:name] = opts[:name] if opts[: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[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  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: 'EmailClient#list_email_domains') 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::Email::Models::EmailDomainCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Gets a collection of approved sender email addresses and sender IDs.

Parameters:

  • compartment_id (String)

    The OCID for the compartment.

  • 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 request ID for tracing from the system

  • :lifecycle_state (String)

    The current state of a sender.

  • :domain (String)

    A filter to only return resources that match the given domain exactly.

  • :email_address (String)

    The email address of the approved sender.

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

  • :sort_by (String)

    The field to sort by. The TIMECREATED value returns the list in in descending order by default. The EMAILADDRESS value returns the list in ascending order by default. Use the SortOrderQueryParam to change the direction of the returned list of items.

    Allowed values are: TIMECREATED, EMAILADDRESS

  • :sort_order (String)

    The sort order to use, either ascending or descending order.

Returns:



1268
1269
1270
1271
1272
1273
1274
1275
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
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
# File 'lib/oci/email/email_client.rb', line 1268

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

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

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

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

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

  path = '/senders'
  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[:domain] = opts[:domain] if opts[:domain]
  query_params[:emailAddress] = opts[:email_address] if opts[:email_address]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # 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: 'EmailClient#list_senders') 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: 'Array<OCI::Email::Models::SenderSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

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

Gets a list of suppressed recipient email addresses for a user. The compartmentId for suppressions must be a tenancy OCID. The returned list is sorted by creation time in descending order.

Parameters:

  • compartment_id (String)

    The OCID for the compartment.

  • 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 request ID for tracing from the system

  • :email_address (String)

    The email address of the suppression.

  • :time_created_greater_than_or_equal_to (DateTime)

    Search for suppressions that were created within a specific date range, using this parameter to specify the earliest creation date for the returned list (inclusive). Specifying this parameter without the corresponding timeCreatedLessThan parameter will retrieve suppressions created from the given timeCreatedGreaterThanOrEqualTo to the current time, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

    Example: 2016-12-19T16:39:57.600Z

  • :time_created_less_than (DateTime)

    Search for suppressions that were created within a specific date range, using this parameter to specify the latest creation date for the returned list (exclusive). Specifying this parameter without the corresponding timeCreatedGreaterThanOrEqualTo parameter will retrieve all suppressions created before the specified end date, in "YYYY-MM-ddThh:mmZ" format with a Z offset, as defined by RFC 3339.

    Example: 2016-12-19T16:39:57.600Z

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

  • :sort_by (String)

    The field to sort by. The TIMECREATED value returns the list in in descending order by default. The EMAILADDRESS value returns the list in ascending order by default. Use the SortOrderQueryParam to change the direction of the returned list of items.

    Allowed values are: TIMECREATED, EMAILADDRESS

  • :sort_order (String)

    The sort order to use, either ascending or descending order.

Returns:



1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
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
# File 'lib/oci/email/email_client.rb', line 1379

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

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

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

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

  path = '/suppressions'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:emailAddress] = opts[:email_address] if opts[:email_address]
  query_params[:timeCreatedGreaterThanOrEqualTo] = opts[:time_created_greater_than_or_equal_to] if opts[:time_created_greater_than_or_equal_to]
  query_params[:timeCreatedLessThan] = opts[:time_created_less_than] if opts[:time_created_less_than]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # 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: 'EmailClient#list_suppressions') 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: 'Array<OCI::Email::Models::SuppressionSummary>'
    )
  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.

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 request ID for tracing from the system

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

Returns:



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
1492
1493
1494
1495
# File 'lib/oci/email/email_client.rb', line 1457

def list_work_request_errors(work_request_id, opts = {})
  logger.debug 'Calling operation EmailClient#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?
  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]

  # 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: 'EmailClient#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::Email::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.

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 request ID for tracing from the system

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

Returns:



1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
# File 'lib/oci/email/email_client.rb', line 1522

def list_work_request_logs(work_request_id, opts = {})
  logger.debug 'Calling operation EmailClient#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?
  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]

  # 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: 'EmailClient#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::Email::Models::WorkRequestLogEntryCollection'
    )
  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.

Parameters:

  • compartment_id (String)

    The OCID for the compartment.

  • 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 request ID for tracing from the system

  • :page (String)

    For list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see List Pagination.

  • :limit (Integer)

    For list pagination. The maximum number of results per page, or items to return in a paginated "List" call. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see List Pagination.

Returns:



1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
# File 'lib/oci/email/email_client.rb', line 1588

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

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

  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]

  # 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: 'EmailClient#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::Email::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.



98
99
100
# File 'lib/oci/email/email_client.rb', line 98

def logger
  @api_client.config.logger
end

#update_dkim(dkim_id, update_dkim_details, opts = {}) ⇒ Response

Note:

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

Modifies a DKIM.

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)

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

Returns:

  • (Response)

    A Response object with data of type nil



1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
# File 'lib/oci/email/email_client.rb', line 1650

def update_dkim(dkim_id, update_dkim_details, opts = {})
  logger.debug 'Calling operation EmailClient#update_dkim.' if logger

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

  path = '/dkims/{dkimId}'.sub('{dkimId}', dkim_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_dkim_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EmailClient#update_dkim') 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_email_domain(email_domain_id, update_email_domain_details, opts = {}) ⇒ Response

Note:

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

Modifies an email domain.

Parameters:

  • email_domain_id (String)

    The OCID of this email domain.

  • update_email_domain_details (OCI::Email::Models::UpdateEmailDomainDetails)

    The new email domain attributes to apply.

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

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

Returns:

  • (Response)

    A Response object with data of type nil



1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
# File 'lib/oci/email/email_client.rb', line 1710

def update_email_domain(email_domain_id, update_email_domain_details, opts = {})
  logger.debug 'Calling operation EmailClient#update_email_domain.' if logger

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

  path = '/emailDomains/{emailDomainId}'.sub('{emailDomainId}', email_domain_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_email_domain_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EmailClient#update_email_domain') 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_sender(sender_id, update_sender_details, opts = {}) ⇒ Response

Note:

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

Replaces the set of tags for a sender with the tags provided. If either freeform or defined tags are omitted, the tags for that set remain the same. Each set must include the full set of tags for the sender, partial updates are not permitted. For more information about tagging, see Resource Tags.

Parameters:

  • sender_id (String)

    The unique OCID of the sender.

  • update_sender_details (OCI::Email::Models::UpdateSenderDetails)

    update details for sender.

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

    Used for optimistic concurrency control. In the update or delete call for a resource, set the if-match parameter to the value of the etag from a previous get, create, or update 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 request ID for tracing from the system

Returns:



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
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
# File 'lib/oci/email/email_client.rb', line 1774

def update_sender(sender_id, update_sender_details, opts = {})
  logger.debug 'Calling operation EmailClient#update_sender.' if logger

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

  path = '/senders/{senderId}'.sub('{senderId}', sender_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_sender_details)

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