class OCI::Email::EmailClient
API for the Email
Delivery service. Use this API to send high-volume, application-generated emails. For more information, see [Overview of the Email
Delivery Service](/iaas/Content/Email/Concepts/overview.htm).
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.
Attributes
Client used to make HTTP requests. @return [OCI::ApiClient]
Fully qualified endpoint URL @return [String]
The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}. @return [String]
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 @return [OCI::Retry::RetryConfig]
Public Class Methods
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.
@param [Config] config A Config
object. @param [String] region A region used to determine the service endpoint. This will usually
correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
@param [String] endpoint The fully qualified endpoint URL @param [OCI::BaseSigner] signer 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
@param [OCI::ApiClientProxySettings] proxy_settings 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
@param [OCI::Retry::RetryConfig] retry_config
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
# File lib/oci/email/email_client.rb, line 58 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
Public Instance Methods
Moves a 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](docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
Note: All Dkim objects associated with this email domain will also be moved into the provided compartment.
@param [String] email_domain_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this email domain. @param [OCI::Email::Models::ChangeEmailDomainCompartmentDetails] change_email_domain_compartment_details The configuration details for the move operation. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :opc_retry_token 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.
@return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/change_email_domain_compartment.rb.html) to see an example of how to use change_email_domain_compartment
API.
# File lib/oci/email/email_client.rb, line 131 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
Moves a sender into a different compartment. When provided, If-Match is checked against ETag values of the resource. @param [String] sender_id The unique OCID of the sender. @param [OCI::Email::Models::ChangeSenderCompartmentDetails] change_sender_compartment_details Details for moving a sender into a different compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/change_sender_compartment.rb.html) to see an example of how to use change_sender_compartment
API.
# File lib/oci/email/email_client.rb, line 193 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
Creates a new DKIM for a email domain. This DKIM will sign 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 will seamlessly pick up the new key without interruption in signing.
@param [OCI::Email::Models::CreateDkimDetails] create_dkim_details The DKIM details. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_retry_token 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::Dkim Dkim} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/create_dkim.rb.html) to see an example of how to use create_dkim
API.
# File lib/oci/email/email_client.rb, line 259 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
Creates a new email domain. Avoid entering confidential information. @param [OCI::Email::Models::CreateEmailDomainDetails] create_email_domain_details The email domain to create. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :opc_retry_token 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.
@return [Response] A Response
object with data of type {OCI::Email::Models::EmailDomain EmailDomain} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/create_email_domain.rb.html) to see an example of how to use create_email_domain
API.
# File lib/oci/email/email_client.rb, line 320 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
Creates a sender for a tenancy in a given compartment. @param [OCI::Email::Models::CreateSenderDetails] create_sender_details Create a sender. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::Sender Sender} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/create_sender.rb.html) to see an example of how to use create_sender
API.
# File lib/oci/email/email_client.rb, line 375 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
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.
@param [OCI::Email::Models::CreateSuppressionDetails] create_suppression_details Adds a single email address to the suppression list for a compartment's tenancy.
@param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::Suppression Suppression} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/create_suppression.rb.html) to see an example of how to use create_suppression
API.
# File lib/oci/email/email_client.rb, line 433 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
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 instead of deletion creating a new DKIM for this domain so the signing can be rotated to it.
@param [String] dkim_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this DKIM. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/delete_dkim.rb.html) to see an example of how to use delete_dkim
API.
# File lib/oci/email/email_client.rb, line 496 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
Deletes a email domain. @param [String] email_domain_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this email domain. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/delete_email_domain.rb.html) to see an example of how to use delete_email_domain
API.
# File lib/oci/email/email_client.rb, line 554 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
Deletes an approved sender for a tenancy in a given compartment for a provided `senderId`.
@param [String] sender_id The unique OCID of the sender. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/delete_sender.rb.html) to see an example of how to use delete_sender
API.
# File lib/oci/email/email_client.rb, line 614 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
Removes a suppressed recipient email address from the suppression list for a tenancy in a given compartment for a provided `suppressionId`.
@param [String] suppression_id The unique OCID of the suppression. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/delete_suppression.rb.html) to see an example of how to use delete_suppression
API.
# File lib/oci/email/email_client.rb, line 670 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
Retrieves the specified DKIM. @param [String] dkim_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this DKIM. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::Dkim Dkim} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/get_dkim.rb.html) to see an example of how to use get_dkim
API.
# File lib/oci/email/email_client.rb, line 723 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
Retrieves the specified email domain. @param [String] email_domain_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this email domain. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::EmailDomain EmailDomain} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/get_email_domain.rb.html) to see an example of how to use get_email_domain
API.
# File lib/oci/email/email_client.rb, line 777 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
Gets an approved sender for a given `senderId`. @param [String] sender_id The unique OCID of the sender. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::Sender Sender} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/get_sender.rb.html) to see an example of how to use get_sender
API.
# File lib/oci/email/email_client.rb, line 831 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
Gets the details of a suppressed recipient email address for a given `suppressionId`. Each suppression is given a unique OCID.
@param [String] suppression_id The unique OCID of the suppression. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::Suppression Suppression} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/get_suppression.rb.html) to see an example of how to use get_suppression
API.
# File lib/oci/email/email_client.rb, line 887 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
Gets the status of the work request with the given ID. @param [String] work_request_id The ID of the asynchronous request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::WorkRequest WorkRequest} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/get_work_request.rb.html) to see an example of how to use get_work_request
API.
# File lib/oci/email/email_client.rb, line 941 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
Lists DKIMs for a email domain. @param [String] email_domain_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the email domain to which this DKIM belongs.
@param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :id A filter to only return resources that match the given id exactly.
@option opts [String] :name A filter to only return resources that match the given name exactly.
@option opts [Integer] :limit 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [String] :page 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [String] :sort_order The sort order to use, either ascending or descending order.
@option opts [String] :lifecycle_state Filter returned list by specified lifecycle state. This parameter is case-insensitive.
@option opts [String] :sort_by 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
@return [Response] A Response
object with data of type {OCI::Email::Models::DkimCollection DkimCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/list_dkims.rb.html) to see an example of how to use list_dkims
API.
# File lib/oci/email/email_client.rb, line 1021 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
Lists email domains in the specified compartment. @param [String] compartment_id The OCID for the compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :id A filter to only return resources that match the given id exactly.
@option opts [String] :name A filter to only return resources that match the given name exactly.
@option opts [Integer] :limit 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [String] :page 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [String] :sort_order The sort order to use, either ascending or descending order.
@option opts [String] :lifecycle_state Filter returned list by specified lifecycle state. This parameter is case-insensitive.
@option opts [String] :sort_by 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
@return [Response] A Response
object with data of type {OCI::Email::Models::EmailDomainCollection EmailDomainCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/list_email_domains.rb.html) to see an example of how to use list_email_domains
API.
# File lib/oci/email/email_client.rb, line 1119 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
Gets a collection of approved sender email addresses and sender IDs.
@param [String] compartment_id The OCID for the compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :lifecycle_state The current state of a sender. @option opts [String] :domain A filter to only return resources that match the given domain exactly. @option opts [String] :email_address The email address of the approved sender. @option opts [String] :page 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [Integer] :limit 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [String] :sort_by 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
@option opts [String] :sort_order The sort order to use, either ascending or descending order.
@return [Response] A Response
object with data of type Array<{OCI::Email::Models::SenderSummary SenderSummary}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/list_senders.rb.html) to see an example of how to use list_senders
API.
# File lib/oci/email/email_client.rb, line 1212 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
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.
@param [String] compartment_id The OCID for the compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :email_address The email address of the suppression. @option opts [DateTime] :time_created_greater_than_or_equal_to 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
@option opts [DateTime] :time_created_less_than 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
@option opts [String] :page 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [Integer] :limit 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [String] :sort_by 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
@option opts [String] :sort_order The sort order to use, either ascending or descending order.
@return [Response] A Response
object with data of type Array<{OCI::Email::Models::SuppressionSummary SuppressionSummary}> @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/list_suppressions.rb.html) to see an example of how to use list_suppressions
API.
# File lib/oci/email/email_client.rb, line 1323 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
Return a (paginated) list of errors for a given work request.
@param [String] work_request_id The ID of the asynchronous request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :page 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [Integer] :limit 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@return [Response] A Response
object with data of type {OCI::Email::Models::WorkRequestErrorCollection WorkRequestErrorCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/list_work_request_errors.rb.html) to see an example of how to use list_work_request_errors
API.
# File lib/oci/email/email_client.rb, line 1401 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
Return a (paginated) list of logs for a given work request.
@param [String] work_request_id The ID of the asynchronous request. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :page 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [Integer] :limit 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@return [Response] A Response
object with data of type {OCI::Email::Models::WorkRequestLogEntryCollection WorkRequestLogEntryCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/list_work_request_logs.rb.html) to see an example of how to use list_work_request_logs
API.
# File lib/oci/email/email_client.rb, line 1466 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
Lists the work requests in a compartment.
@param [String] compartment_id The OCID for the compartment. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :work_request_id The ID of the asynchronous work request. @option opts [String] :opc_request_id The request ID for tracing from the system @option opts [String] :page 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@option opts [Integer] :limit 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](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
@return [Response] A Response
object with data of type {OCI::Email::Models::WorkRequestSummaryCollection WorkRequestSummaryCollection} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/list_work_requests.rb.html) to see an example of how to use list_work_requests
API.
# File lib/oci/email/email_client.rb, line 1532 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
@return [Logger] The logger for this client. May be nil.
# File lib/oci/email/email_client.rb, line 97 def logger @api_client.config.logger end
Set the region that will be used to determine the service endpoint. This will usually correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
# File lib/oci/email/email_client.rb, line 87 def region=(new_region) @region = new_region raise 'A region must be specified.' unless @region @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://ctrl.email.{region}.oci.{secondLevelDomain}') + '/20170907' logger.info "EmailClient endpoint set to '#{@endpoint} from region #{@region}'." if logger end
Modifies a DKIM. @param [String] dkim_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this DKIM. @param [OCI::Email::Models::UpdateDkimDetails] update_dkim_details The new DKIM attributes to apply. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/update_dkim.rb.html) to see an example of how to use update_dkim
API.
# File lib/oci/email/email_client.rb, line 1594 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
Modifies a email domain. @param [String] email_domain_id The [OCID](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this email domain. @param [OCI::Email::Models::UpdateEmailDomainDetails] update_email_domain_details The new email domain attributes to apply. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type nil @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/update_email_domain.rb.html) to see an example of how to use update_email_domain
API.
# File lib/oci/email/email_client.rb, line 1654 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
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](docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
@param [String] sender_id The unique OCID of the sender. @param [OCI::Email::Models::UpdateSenderDetails] update_sender_details update details for sender. @param [Hash] opts the optional parameters @option opts [OCI::Retry::RetryConfig] :retry_config 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
@option opts [String] :if_match 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.
@option opts [String] :opc_request_id The request ID for tracing from the system @return [Response] A Response
object with data of type {OCI::Email::Models::Sender Sender} @note Click [here](docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/email/update_sender.rb.html) to see an example of how to use update_sender
API.
# File lib/oci/email/email_client.rb, line 1718 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
Private Instance Methods
rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists rubocop:enable Metrics/MethodLength, Layout/EmptyLines
# File lib/oci/email/email_client.rb, line 1763 def applicable_retry_config(opts = {}) return @retry_config unless opts.key?(:retry_config) opts[:retry_config] end