=begin
#Klaviyo API
#The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
The version of the OpenAPI document: 2024-07-15
Contact: developers@klaviyo.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.2.1
=end
require 'cgi'
module KlaviyoAPI
class DataPrivacyApi
attr_accessor :api_client
def initialize(api_client = ApiClient.default)
@api_client = api_client
end
# Request Profile Deletion
# Request a deletion for the profiles corresponding to one of the following identifiers: `email`, `phone_number`, or `id`. If multiple identifiers are provided, we will return an error. All profiles that match the provided identifier will be deleted. The deletion occurs asynchronously; however, once it has completed, the deleted profile will appear on the [Deleted Profiles page](https://www.klaviyo.com/account/deleted). For more information on the deletion process, please refer to our [Help Center docs on how to handle GDPR and CCPA deletion requests](https://help.klaviyo.com/hc/en-us/articles/360004217631-How-to-Handle-GDPR-Requests#record-gdpr-and-ccpa%20%20-deletion-requests2).
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `data-privacy:write`
# @param data_privacy_create_deletion_job_query [DataPrivacyCreateDeletionJobQuery]
# @param [Hash] opts the optional parameters
# @return [nil]
def request_profile_deletion(data_privacy_create_deletion_job_query, opts = {})
request_profile_deletion_with_http_info(data_privacy_create_deletion_job_query, opts)
nil
end
# alias of `request_profile_deletion`
alias create_data_privacy_deletion_job request_profile_deletion
# Request Profile Deletion
# Request a deletion for the profiles corresponding to one of the following identifiers: `email`, `phone_number`, or `id`. If multiple identifiers are provided, we will return an error. All profiles that match the provided identifier will be deleted. The deletion occurs asynchronously; however, once it has completed, the deleted profile will appear on the [Deleted Profiles page](https://www.klaviyo.com/account/deleted). For more information on the deletion process, please refer to our [Help Center docs on how to handle GDPR and CCPA deletion requests](https://help.klaviyo.com/hc/en-us/articles/360004217631-How-to-Handle-GDPR-Requests#record-gdpr-and-ccpa%20%20-deletion-requests2).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `data-privacy:write`
# @param data_privacy_create_deletion_job_query [DataPrivacyCreateDeletionJobQuery]
# @param [Hash] opts the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def request_profile_deletion_with_http_info(data_privacy_create_deletion_job_query, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: DataPrivacyApi.request_profile_deletion ...'
end
# verify the required parameter 'data_privacy_create_deletion_job_query' is set
if @api_client.config.client_side_validation && data_privacy_create_deletion_job_query.nil?
fail ArgumentError, "Missing the required parameter 'data_privacy_create_deletion_job_query' when calling DataPrivacyApi.request_profile_deletion"
end
# resource path
local_var_path = '/api/data-privacy-deletion-jobs/'
# query parameters
query_params = opts[:query_params] || {}
# header parameters
header_params = opts[:header_params] || {}
# klaviyo api revision
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-07-15"
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/json'])
if !content_type.nil?
header_params['Content-Type'] = content_type
end
# form parameters
form_params = opts[:form_params] || {}
# http body (model)
post_body = opts[:debug_body] || @api_client.object_to_http_body(data_privacy_create_deletion_job_query)
# return_type
return_type = opts[:debug_return_type]
# auth_names
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
new_options = opts.merge(
:operation => :"DataPrivacyApi.request_profile_deletion",
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => post_body,
:auth_names => auth_names,
:return_type => return_type
)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: DataPrivacyApi#request_profile_deletion\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
# alias of `request_profile_deletion_with_http_info`
alias create_data_privacy_deletion_job_with_http_info request_profile_deletion_with_http_info
end
end