// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../core/resource'; import { APIPromise } from '../../../../core/api-promise'; import { buildHeaders } from '../../../../internal/headers'; import { RequestOptions } from '../../../../internal/request-options'; import { path } from '../../../../internal/utils/path'; export class RectificationRequest extends APIResource { /** * Get decrypted rectification request details. Only the configured Data Protection * Officer account can access this. */ retrieve( requestID: string, params: RectificationRequestRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.get(path`/users/privacy/rectification-request/${requestID}`, { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } /** * Submit a formal data rectification request to the Data Protection Officer. */ rectificationRequest( params: RectificationRequestRectificationRequestParams, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat, ...body } = params; return this._client.post('/users/privacy/rectification-request', { body, ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Enum for data rectification request status. */ export type DataRectificationRequestStatus = 'PENDING'; /** * Schema for DPO-visible data rectification request details. * * Attributes: id (str): The unique identifier for the request. user_id (str): ID * of the user who submitted the request. field (str): The decrypted field to be * corrected. description (str): The decrypted description of the inaccuracy. * supporting_details (str | None): The decrypted supporting details. status * (DataRectificationRequestStatus): Current status of the request. created_at * (datetime): UTC timestamp when the request was submitted. updated_at (datetime): * UTC timestamp when the request was last updated. */ export interface RectificationRequestRetrieveResponse { /** * Unique request ID */ id: string; /** * Creation timestamp in UTC */ created_at: string; /** * Description of the inaccuracy and correct information */ description: string; /** * Field to be corrected */ field: string; /** * Current status of the request */ status: DataRectificationRequestStatus; /** * Last update timestamp in UTC */ updated_at: string; /** * ID of the user who submitted the request */ user_id: string; /** * Supporting details */ supporting_details?: string | null; } /** * Schema for data rectification request response. * * Attributes: id (str): The unique identifier for the request, also acts as the * reference number. status (str): Current status of the request (e.g., PENDING). * created_at (datetime): UTC (GMT+0) timestamp when the request was submitted. */ export interface RectificationRequestRectificationRequestResponse { /** * Unique request ID */ id: string; /** * Creation timestamp in UTC (GMT+0) */ created_at: string; /** * Current status of the request */ status: DataRectificationRequestStatus; } export interface RectificationRequestRetrieveParams { 'Accept-Language'?: string; /** * Set to `structured` to receive errors in the structured envelope. Omit it to * keep the legacy error body. */ 'X-Error-Format'?: string; } export interface RectificationRequestRectificationRequestParams { /** * Body param: Description of the inaccuracy and correct information (max 1000 * chars) */ description: string; /** * Body param: Field to be corrected (max 100 chars) */ field: string; /** * Body param: Supporting details (max 100 chars, optional) */ supporting_details?: string | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace RectificationRequest { export { type DataRectificationRequestStatus as DataRectificationRequestStatus, type RectificationRequestRetrieveResponse as RectificationRequestRetrieveResponse, type RectificationRequestRectificationRequestResponse as RectificationRequestRectificationRequestResponse, type RectificationRequestRetrieveParams as RectificationRequestRetrieveParams, type RectificationRequestRectificationRequestParams as RectificationRequestRectificationRequestParams, }; }