lib/oci/key_management/kms_crypto_client.rb
# Encrypts data using the given EncryptDataDetails resource.
# Plaintext included in the example request is a base64-encoded value
# of a UTF-8 string.
#
# @param [OCI::KeyManagement::Models::EncryptDataDetails] encrypt_data_details EncryptDataDetails
# @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 Unique identifier for the request. If provided, the returned request ID
#   will include this value. Otherwise, a random request ID will be
#   generated by the service.
#
# @return [Response] A Response object with data of type {OCI::KeyManagement::Models::EncryptedData EncryptedData}
Encrypts data using the given EncryptDataDetails resource.
Plaintext included in the example request is a base64-encoded value
of a UTF-8 string.
Encrypts data using the given EncryptDataDetails resource . Plaintext included in the example request is a base64 - encoded value of a UTF - 8 string .
def encrypt(encrypt_data_details, opts = {})
      logger.debug 'Calling operation KmsCryptoClient#encrypt.' if logger
      raise "Missing the required parameter 'encrypt_data_details' when calling encrypt." if encrypt_data_details.nil?
      path = '/20180608/encrypt'
      operation_signing_strategy = :standard
      query_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]
      post_body = @api_client.object_to_http_body(encrypt_data_details)
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'KmsCryptoClient#encrypt') 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::KeyManagement::Models::EncryptedData'
        )
      end
    end
def encrypt ( encrypt_data_details , opts = { } ) logger . debug 'Calling operation KmsCryptoClient#encrypt.' if logger raise "Missing the required parameter 'encrypt_data_details' when calling encrypt." if encrypt_data_details . nil? path = '/20180608/encrypt' operation_signing_strategy = :standard query_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 ] post_body = @api_client . object_to_http_body ( encrypt_data_details ) OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'KmsCryptoClient#encrypt' ) 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::KeyManagement::Models::EncryptedData' ) end end
Encrypts data using the given EncryptDataDetails resource.
Encrypts data using the given EncryptDataDetails resource .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type {OCI::KeyManagement::Models::EncryptedData EncryptedData}
A Response object with data of type { OCI :: KeyManagement :: Models :: EncryptedData EncryptedData }
Response
encrypt_data_details
opts
:opc_request_id Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service.
: opc_request_id Unique identifier for the request . If provided the returned request ID will include this value . Otherwise a random request ID will be generated by the service .
opts the optional parameters
opts the optional parameters