// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../core/resource'; import * as RectificationRequestAPI from './rectification-request'; import { DataRectificationRequestStatus, RectificationRequest, RectificationRequestRectificationRequestParams, RectificationRequestRectificationRequestResponse, RectificationRequestRetrieveParams, RectificationRequestRetrieveResponse, } from './rectification-request'; import { APIPromise } from '../../../../core/api-promise'; import { buildHeaders } from '../../../../internal/headers'; import { RequestOptions } from '../../../../internal/request-options'; export class PersonalDataSummary extends APIResource { rectificationRequest: RectificationRequestAPI.RectificationRequest = new RectificationRequestAPI.RectificationRequest(this._client); /** * Return a read-only consolidated summary of personal data held for the * authenticated user, including account creation date and usage statistics for the * current organization. */ retrieve( params: PersonalDataSummaryRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat } = params ?? {}; return this._client.get('/users/privacy/personal-data-summary', { ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Read-only summary of personal data held on behalf of the authenticated user. * * Attributes: account_created_at (datetime | None): UTC timestamp when the user * signed up. Sourced from StackAuth; None if unavailable. total_chat_sessions * (int): Count of the user's active conversations in the current organization. * total_uploaded_files (int): Count of documents the user uploaded in the current * organization. */ export interface PersonalDataSummaryRetrieveResponse { /** * Total active conversations in the current organization */ total_chat_sessions: number; /** * Total uploaded documents in the current organization */ total_uploaded_files: number; /** * UTC timestamp when the user account was created */ account_created_at?: string | null; } export interface PersonalDataSummaryRetrieveParams { '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; } PersonalDataSummary.RectificationRequest = RectificationRequest; export declare namespace PersonalDataSummary { export { type PersonalDataSummaryRetrieveResponse as PersonalDataSummaryRetrieveResponse, type PersonalDataSummaryRetrieveParams as PersonalDataSummaryRetrieveParams, }; export { RectificationRequest as RectificationRequest, type DataRectificationRequestStatus as DataRectificationRequestStatus, type RectificationRequestRetrieveResponse as RectificationRequestRetrieveResponse, type RectificationRequestRectificationRequestResponse as RectificationRequestRectificationRequestResponse, type RectificationRequestRetrieveParams as RectificationRequestRetrieveParams, type RectificationRequestRectificationRequestParams as RectificationRequestRectificationRequestParams, }; }