Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

117 KB
Raw Blame
/**
 * Auto-generated Zod validation schemas from the Django backend OpenAPI schema.
 * To modify these schemas, update the Django serializers or views, then run:
 *   hogli build:openapi
 * Questions or issues? #team-devex on Slack
 *
 * PostHog API - core
 * OpenAPI spec version: 1.0.0
 */
import * as zod from 'zod'

/**
 * Approve a device grant for one project. The token gets the requested scopes the person kept.
 */
export const oauthDeviceApproveCreateBodyUserCodeMax = 20

export const OauthDeviceApproveCreateBody = /* @__PURE__ */ zod.object({
    user_code: zod
        .string()
        .max(oauthDeviceApproveCreateBodyUserCodeMax)
        .describe("The code the device shows, as the person typed it. Case and dashes don't matter."),
    project_id: zod.number().describe('The project the token is scoped to.'),
    scopes: zod
        .array(zod.string())
        .optional()
        .describe(
            'The requested scopes the person kept. Leave it out to grant every requested scope. It must include every scope in `required_scopes`, and nothing outside the requested scopes.'
        ),
})

/**
 * Refuse a device grant, so the client's next poll gets `access_denied`.
 */
export const oauthDeviceDenyCreateBodyUserCodeMax = 20

export const OauthDeviceDenyCreateBody = /* @__PURE__ */ zod.object({
    user_code: zod
        .string()
        .max(oauthDeviceDenyCreateBodyUserCodeMax)
        .describe("The code the device shows, as the person typed it. Case and dashes don't matter."),
})

/**
 * Show what a device code asks for, so the person can check it before approving.
 */
export const oauthDeviceLookupCreateBodyUserCodeMax = 20

export const OauthDeviceLookupCreateBody = /* @__PURE__ */ zod.object({
    user_code: zod
        .string()
        .max(oauthDeviceLookupCreateBodyUserCodeMax)
        .describe("The code the device shows, as the person typed it. Case and dashes don't matter."),
})

/**
 * Manage CIMD verification tokens for an organization.
 *
 * A partner embeds the plaintext token in their CIMD metadata document as
 * `verification_token` inside the `com.posthog` object (the legacy top-level
 * `posthog_verification_token` field still works as a fallback). When PostHog fetches
 * the metadata, matching the token links the partner app to this organization and
 * grants a higher default rate limit for account provisioning.
 *
 * Each token is scoped at creation to the one `cimd_url` it will be published at,
 * and verifies nowhere else. Two organizations may name the same URL; only the one
 * whose token is actually served there verifies, so claiming a URL cannot be used
 * to block a partner from verifying theirs.
 *
 * The plaintext value is only available on creation; we store a hash.
 */
export const cimdVerificationTokensCreateBodyLabelMax = 40

export const cimdVerificationTokensCreateBodyCimdUrlMax = 2048

export const CimdVerificationTokensCreateBody = /* @__PURE__ */ zod
    .object({
        label: zod
            .string()
            .max(cimdVerificationTokensCreateBodyLabelMax)
            .describe("Human-readable name to identify this token later, e.g. 'Production CIMD partner'."),
        cimd_url: zod
            .string()
            .max(cimdVerificationTokensCreateBodyCimdUrlMax)
            .describe(
                'HTTPS URL of the CIMD metadata document this token will be published in. The token only verifies at this URL, so a copy hosted anywhere else is rejected. Host case, an explicit :443 and a trailing slash are normalized away; the path is case-sensitive.'
            ),
    })
    .describe(
        'Write shape for `create`. `cimd_url` is required and non-null: only tokens\nissued before URL binding existed are nullable, not new ones.'
    )

/**
 * Manage CIMD verification tokens for an organization.
 *
 * A partner embeds the plaintext token in their CIMD metadata document as
 * `verification_token` inside the `com.posthog` object (the legacy top-level
 * `posthog_verification_token` field still works as a fallback). When PostHog fetches
 * the metadata, matching the token links the partner app to this organization and
 * grants a higher default rate limit for account provisioning.
 *
 * Each token is scoped at creation to the one `cimd_url` it will be published at,
 * and verifies nowhere else. Two organizations may name the same URL; only the one
 * whose token is actually served there verifies, so claiming a URL cannot be used
 * to block a partner from verifying theirs.
 *
 * The plaintext value is only available on creation; we store a hash.
 */
export const cimdVerificationTokensPartialUpdateBodyCimdUrlMax = 2048

export const CimdVerificationTokensPartialUpdateBody = /* @__PURE__ */ zod
    .object({
        cimd_url: zod
            .string()
            .max(cimdVerificationTokensPartialUpdateBodyCimdUrlMax)
            .optional()
            .describe(
                'HTTPS URL of the CIMD metadata document to bind this token to. Only settable once, on a token with no existing binding; an already-bound token must be reissued instead.'
            ),
    })
    .describe(
        'Write shape for `partial_update` (PATCH). Exposes only `cimd_url`, and only ever\nperforms a null -> value transition: `validate` rejects any instance whose `cimd_url`\nis already set, so an existing binding can never be re-pointed through this endpoint.'
    )

export const domainsCreateBodyDomainMax = 128

export const domainsCreateBodySsoEnforcementMax = 28

export const DomainsCreateBody = /* @__PURE__ */ zod.object({
    domain: zod.string().max(domainsCreateBodyDomainMax),
    jit_provisioning_enabled: zod.boolean().optional(),
    sso_enforcement: zod.string().max(domainsCreateBodySsoEnforcementMax).optional(),
})

export const domainsUpdateBodyDomainMax = 128

export const domainsUpdateBodySsoEnforcementMax = 28

export const DomainsUpdateBody = /* @__PURE__ */ zod.object({
    domain: zod.string().max(domainsUpdateBodyDomainMax),
    jit_provisioning_enabled: zod.boolean().optional(),
    sso_enforcement: zod.string().max(domainsUpdateBodySsoEnforcementMax).optional(),
})

export const domainsPartialUpdateBodyDomainMax = 128

export const domainsPartialUpdateBodySsoEnforcementMax = 28

export const DomainsPartialUpdateBody = /* @__PURE__ */ zod.object({
    domain: zod.string().max(domainsPartialUpdateBodyDomainMax).optional(),
    jit_provisioning_enabled: zod.boolean().optional(),
    sso_enforcement: zod.string().max(domainsPartialUpdateBodySsoEnforcementMax).optional(),
})

export const domainsVerifyCreateBodyDomainMax = 128

export const domainsVerifyCreateBodySsoEnforcementMax = 28

export const DomainsVerifyCreateBody = /* @__PURE__ */ zod.object({
    domain: zod.string().max(domainsVerifyCreateBodyDomainMax),
    jit_provisioning_enabled: zod.boolean().optional(),
    sso_enforcement: zod.string().max(domainsVerifyCreateBodySsoEnforcementMax).optional(),
})

export const identityProviderConfigsCreateBodyNameMax = 255

export const identityProviderConfigsCreateBodyOidcIssuerUrlOneMax = 512

export const identityProviderConfigsCreateBodyOidcIssuerUrlTwoMax = 0

export const identityProviderConfigsCreateBodyOidcClientIdMax = 512

export const identityProviderConfigsCreateBodyOidcClientSecretMax = 4096

export const identityProviderConfigsCreateBodySamlEntityIdMax = 512

export const identityProviderConfigsCreateBodySamlAcsUrlMax = 512

export const identityProviderConfigsCreateBodyIdJagIssuerUrlMax = 512

export const identityProviderConfigsCreateBodyIdJagJwksUrlMax = 512

export const identityProviderConfigsCreateBodyIdJagAllowedClientsItemMax = 256

export const IdentityProviderConfigsCreateBody = /* @__PURE__ */ zod.object({
    name: zod
        .string()
        .max(identityProviderConfigsCreateBodyNameMax)
        .optional()
        .describe("Display name for this IdP configuration (e.g. 'Okta production')."),
    domain_scope: zod
        .union([
            zod.enum(['all', 'selected']).describe('\* `all` - All\n\* `selected` - Selected'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional()
        .describe(
            'Domains this configuration applies to. An unset value behaves like selected domains.\n\n\* `all` - All\n\* `selected` - Selected'
        ),
    config_scope: zod
        .union([
            zod
                .enum(['saml', 'oidc', 'scim', 'xaa'])
                .describe('\* `saml` - Saml\n\* `oidc` - Oidc\n\* `scim` - Scim\n\* `xaa` - Xaa'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional()
        .describe(
            'Feature configured by this identity provider configuration.\n\n\* `saml` - Saml\n\* `oidc` - Oidc\n\* `scim` - Scim\n\* `xaa` - Xaa'
        ),
    organization_domain_ids: zod
        .array(zod.uuid())
        .optional()
        .describe('Organization domain IDs that this identity provider configuration applies to.'),
    oidc_issuer_url: zod
        .union([
            zod.url().max(identityProviderConfigsCreateBodyOidcIssuerUrlOneMax),
            zod.string().max(identityProviderConfigsCreateBodyOidcIssuerUrlTwoMax),
        ])
        .optional()
        .describe('HTTPS issuer URL. Must exactly match the issuer in the OIDC discovery document.'),
    oidc_client_id: zod
        .string()
        .max(identityProviderConfigsCreateBodyOidcClientIdMax)
        .optional()
        .describe("Client ID of the organization's OIDC application."),
    oidc_client_secret: zod
        .string()
        .max(identityProviderConfigsCreateBodyOidcClientSecretMax)
        .optional()
        .describe(
            'OIDC client secret. Omit to keep the saved secret. Set to an empty string to remove it. Never returned in responses.'
        ),
    saml_entity_id: zod
        .string()
        .max(identityProviderConfigsCreateBodySamlEntityIdMax)
        .nullish()
        .describe('SAML IdP entity ID (issuer).'),
    saml_acs_url: zod
        .string()
        .max(identityProviderConfigsCreateBodySamlAcsUrlMax)
        .nullish()
        .describe('SAML single sign-on (ACS) URL the IdP redirects to.'),
    saml_x509_cert: zod.string().nullish().describe('SAML IdP X.509 signing certificate (PEM).'),
    scim_enabled: zod
        .boolean()
        .optional()
        .describe(
            'Whether SCIM provisioning is enabled. Setting this true generates a bearer token (returned once); setting it false clears the token.'
        ),
    id_jag_issuer_url: zod
        .string()
        .max(identityProviderConfigsCreateBodyIdJagIssuerUrlMax)
        .nullish()
        .describe('Trusted IdP issuer URL for ID-JAG (XAA). Required to enable ID-JAG.'),
    id_jag_jwks_url: zod
        .string()
        .max(identityProviderConfigsCreateBodyIdJagJwksUrlMax)
        .nullish()
        .describe('Override JWKS URL. Defaults to OIDC discovery on the issuer URL.'),
    id_jag_allowed_clients: zod
        .array(zod.string().max(identityProviderConfigsCreateBodyIdJagAllowedClientsItemMax))
        .optional()
        .describe('Allowed ID-JAG client IDs. Empty list allows any client_id.'),
})

export const identityProviderConfigsUpdateBodyNameMax = 255

export const identityProviderConfigsUpdateBodyOidcIssuerUrlOneMax = 512

export const identityProviderConfigsUpdateBodyOidcIssuerUrlTwoMax = 0

export const identityProviderConfigsUpdateBodyOidcClientIdMax = 512

export const identityProviderConfigsUpdateBodyOidcClientSecretMax = 4096

export const identityProviderConfigsUpdateBodySamlEntityIdMax = 512

export const identityProviderConfigsUpdateBodySamlAcsUrlMax = 512

export const identityProviderConfigsUpdateBodyIdJagIssuerUrlMax = 512

export const identityProviderConfigsUpdateBodyIdJagJwksUrlMax = 512

export const identityProviderConfigsUpdateBodyIdJagAllowedClientsItemMax = 256

export const IdentityProviderConfigsUpdateBody = /* @__PURE__ */ zod.object({
    name: zod
        .string()
        .max(identityProviderConfigsUpdateBodyNameMax)
        .optional()
        .describe("Display name for this IdP configuration (e.g. 'Okta production')."),
    domain_scope: zod
        .union([
            zod.enum(['all', 'selected']).describe('\* `all` - All\n\* `selected` - Selected'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional()
        .describe(
            'Domains this configuration applies to. An unset value behaves like selected domains.\n\n\* `all` - All\n\* `selected` - Selected'
        ),
    config_scope: zod
        .union([
            zod
                .enum(['saml', 'oidc', 'scim', 'xaa'])
                .describe('\* `saml` - Saml\n\* `oidc` - Oidc\n\* `scim` - Scim\n\* `xaa` - Xaa'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional()
        .describe(
            'Feature configured by this identity provider configuration.\n\n\* `saml` - Saml\n\* `oidc` - Oidc\n\* `scim` - Scim\n\* `xaa` - Xaa'
        ),
    organization_domain_ids: zod
        .array(zod.uuid())
        .optional()
        .describe('Organization domain IDs that this identity provider configuration applies to.'),
    oidc_issuer_url: zod
        .union([
            zod.url().max(identityProviderConfigsUpdateBodyOidcIssuerUrlOneMax),
            zod.string().max(identityProviderConfigsUpdateBodyOidcIssuerUrlTwoMax),
        ])
        .optional()
        .describe('HTTPS issuer URL. Must exactly match the issuer in the OIDC discovery document.'),
    oidc_client_id: zod
        .string()
        .max(identityProviderConfigsUpdateBodyOidcClientIdMax)
        .optional()
        .describe("Client ID of the organization's OIDC application."),
    oidc_client_secret: zod
        .string()
        .max(identityProviderConfigsUpdateBodyOidcClientSecretMax)
        .optional()
        .describe(
            'OIDC client secret. Omit to keep the saved secret. Set to an empty string to remove it. Never returned in responses.'
        ),
    saml_entity_id: zod
        .string()
        .max(identityProviderConfigsUpdateBodySamlEntityIdMax)
        .nullish()
        .describe('SAML IdP entity ID (issuer).'),
    saml_acs_url: zod
        .string()
        .max(identityProviderConfigsUpdateBodySamlAcsUrlMax)
        .nullish()
        .describe('SAML single sign-on (ACS) URL the IdP redirects to.'),
    saml_x509_cert: zod.string().nullish().describe('SAML IdP X.509 signing certificate (PEM).'),
    scim_enabled: zod
        .boolean()
        .optional()
        .describe(
            'Whether SCIM provisioning is enabled. Setting this true generates a bearer token (returned once); setting it false clears the token.'
        ),
    id_jag_issuer_url: zod
        .string()
        .max(identityProviderConfigsUpdateBodyIdJagIssuerUrlMax)
        .nullish()
        .describe('Trusted IdP issuer URL for ID-JAG (XAA). Required to enable ID-JAG.'),
    id_jag_jwks_url: zod
        .string()
        .max(identityProviderConfigsUpdateBodyIdJagJwksUrlMax)
        .nullish()
        .describe('Override JWKS URL. Defaults to OIDC discovery on the issuer URL.'),
    id_jag_allowed_clients: zod
        .array(zod.string().max(identityProviderConfigsUpdateBodyIdJagAllowedClientsItemMax))
        .optional()
        .describe('Allowed ID-JAG client IDs. Empty list allows any client_id.'),
})

export const identityProviderConfigsPartialUpdateBodyNameMax = 255

export const identityProviderConfigsPartialUpdateBodyOidcIssuerUrlOneMax = 512

export const identityProviderConfigsPartialUpdateBodyOidcIssuerUrlTwoMax = 0

export const identityProviderConfigsPartialUpdateBodyOidcClientIdMax = 512

export const identityProviderConfigsPartialUpdateBodyOidcClientSecretMax = 4096

export const identityProviderConfigsPartialUpdateBodySamlEntityIdMax = 512

export const identityProviderConfigsPartialUpdateBodySamlAcsUrlMax = 512

export const identityProviderConfigsPartialUpdateBodyIdJagIssuerUrlMax = 512

export const identityProviderConfigsPartialUpdateBodyIdJagJwksUrlMax = 512

export const identityProviderConfigsPartialUpdateBodyIdJagAllowedClientsItemMax = 256

export const IdentityProviderConfigsPartialUpdateBody = /* @__PURE__ */ zod.object({
    name: zod
        .string()
        .max(identityProviderConfigsPartialUpdateBodyNameMax)
        .optional()
        .describe("Display name for this IdP configuration (e.g. 'Okta production')."),
    domain_scope: zod
        .union([
            zod.enum(['all', 'selected']).describe('\* `all` - All\n\* `selected` - Selected'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional()
        .describe(
            'Domains this configuration applies to. An unset value behaves like selected domains.\n\n\* `all` - All\n\* `selected` - Selected'
        ),
    config_scope: zod
        .union([
            zod
                .enum(['saml', 'oidc', 'scim', 'xaa'])
                .describe('\* `saml` - Saml\n\* `oidc` - Oidc\n\* `scim` - Scim\n\* `xaa` - Xaa'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional()
        .describe(
            'Feature configured by this identity provider configuration.\n\n\* `saml` - Saml\n\* `oidc` - Oidc\n\* `scim` - Scim\n\* `xaa` - Xaa'
        ),
    organization_domain_ids: zod
        .array(zod.uuid())
        .optional()
        .describe('Organization domain IDs that this identity provider configuration applies to.'),
    oidc_issuer_url: zod
        .union([
            zod.url().max(identityProviderConfigsPartialUpdateBodyOidcIssuerUrlOneMax),
            zod.string().max(identityProviderConfigsPartialUpdateBodyOidcIssuerUrlTwoMax),
        ])
        .optional()
        .describe('HTTPS issuer URL. Must exactly match the issuer in the OIDC discovery document.'),
    oidc_client_id: zod
        .string()
        .max(identityProviderConfigsPartialUpdateBodyOidcClientIdMax)
        .optional()
        .describe("Client ID of the organization's OIDC application."),
    oidc_client_secret: zod
        .string()
        .max(identityProviderConfigsPartialUpdateBodyOidcClientSecretMax)
        .optional()
        .describe(
            'OIDC client secret. Omit to keep the saved secret. Set to an empty string to remove it. Never returned in responses.'
        ),
    saml_entity_id: zod
        .string()
        .max(identityProviderConfigsPartialUpdateBodySamlEntityIdMax)
        .nullish()
        .describe('SAML IdP entity ID (issuer).'),
    saml_acs_url: zod
        .string()
        .max(identityProviderConfigsPartialUpdateBodySamlAcsUrlMax)
        .nullish()
        .describe('SAML single sign-on (ACS) URL the IdP redirects to.'),
    saml_x509_cert: zod.string().nullish().describe('SAML IdP X.509 signing certificate (PEM).'),
    scim_enabled: zod
        .boolean()
        .optional()
        .describe(
            'Whether SCIM provisioning is enabled. Setting this true generates a bearer token (returned once); setting it false clears the token.'
        ),
    id_jag_issuer_url: zod
        .string()
        .max(identityProviderConfigsPartialUpdateBodyIdJagIssuerUrlMax)
        .nullish()
        .describe('Trusted IdP issuer URL for ID-JAG (XAA). Required to enable ID-JAG.'),
    id_jag_jwks_url: zod
        .string()
        .max(identityProviderConfigsPartialUpdateBodyIdJagJwksUrlMax)
        .nullish()
        .describe('Override JWKS URL. Defaults to OIDC discovery on the issuer URL.'),
    id_jag_allowed_clients: zod
        .array(zod.string().max(identityProviderConfigsPartialUpdateBodyIdJagAllowedClientsItemMax))
        .optional()
        .describe('Allowed ID-JAG client IDs. Empty list allows any client_id.'),
})

export const invitesCreateBodyTargetEmailMax = 254

export const invitesCreateBodyFirstNameMax = 30

export const invitesCreateBodyMessageMax = 1000

export const invitesCreateBodySendEmailDefault = true
export const invitesCreateBodyCombinePendingInvitesDefault = false

export const InvitesCreateBody = /* @__PURE__ */ zod.object({
    target_email: zod.email().max(invitesCreateBodyTargetEmailMax),
    first_name: zod.string().max(invitesCreateBodyFirstNameMax).optional(),
    level: zod
        .union([zod.literal(1), zod.literal(8), zod.literal(15)])
        .optional()
        .describe('\* `1` - member\n\* `8` - administrator\n\* `15` - owner'),
    message: zod
        .string()
        .max(invitesCreateBodyMessageMax)
        .nullish()
        .describe('Optional personal message in the invite email.'),
    private_project_access: zod
        .unknown()
        .optional()
        .describe('List of team IDs and corresponding access levels to private projects.'),
    send_email: zod.boolean().default(invitesCreateBodySendEmailDefault),
    combine_pending_invites: zod.boolean().default(invitesCreateBodyCombinePendingInvitesDefault),
})

export const invitesBulkCreateBodyTargetEmailMax = 254

export const invitesBulkCreateBodyFirstNameMax = 30

export const invitesBulkCreateBodyMessageMax = 1000

export const invitesBulkCreateBodySendEmailDefault = true
export const invitesBulkCreateBodyCombinePendingInvitesDefault = false

export const InvitesBulkCreateBody = /* @__PURE__ */ zod.object({
    target_email: zod.email().max(invitesBulkCreateBodyTargetEmailMax),
    first_name: zod.string().max(invitesBulkCreateBodyFirstNameMax).optional(),
    level: zod
        .union([zod.literal(1), zod.literal(8), zod.literal(15)])
        .optional()
        .describe('\* `1` - member\n\* `8` - administrator\n\* `15` - owner'),
    message: zod
        .string()
        .max(invitesBulkCreateBodyMessageMax)
        .nullish()
        .describe('Optional personal message in the invite email.'),
    private_project_access: zod
        .unknown()
        .optional()
        .describe('List of team IDs and corresponding access levels to private projects.'),
    send_email: zod.boolean().default(invitesBulkCreateBodySendEmailDefault),
    combine_pending_invites: zod.boolean().default(invitesBulkCreateBodyCombinePendingInvitesDefault),
})

/**
 * Create an onboarding delegation invite: an admin-level invite flagged as a setup delegation.
 * Sends a single dedicated delegation email and records the inviting user as having delegated.
 */
export const invitesDelegateCreateBodyMessageMax = 1000

export const invitesDelegateCreateBodyStepAtDelegationMax = 64

export const InvitesDelegateCreateBody = /* @__PURE__ */ zod.object({
    target_email: zod
        .email()
        .describe(
            "Email of the teammate who should complete setup on the inviter's behalf. Receives a PostHog-branded delegation invite granting admin-level membership on accept."
        ),
    message: zod
        .string()
        .max(invitesDelegateCreateBodyMessageMax)
        .optional()
        .describe('Optional personal message included in the delegation email (up to 1000 characters).'),
    step_at_delegation: zod
        .string()
        .max(invitesDelegateCreateBodyStepAtDelegationMax)
        .optional()
        .describe('Onboarding step key the delegator was on when delegating, for analytics only.'),
})

/**
 * Lock or unlock notification settings for members of this organization. Each affected member is notified in the app.
 */
export const notificationLocksBulkUpdateCreateBodyChangesItemScopeIdDefault = ``
export const notificationLocksBulkUpdateCreateBodyChangesMax = 2000

export const NotificationLocksBulkUpdateCreateBody = /* @__PURE__ */ zod.object({
    changes: zod
        .array(
            zod.object({
                user_id: zod.number().describe('Member this rule applies to.'),
                setting: zod
                    .enum([
                        'approval_requested',
                        'approval_resolved',
                        'data_catalog_weekly_digest',
                        'discussions_mentioned',
                        'error_tracking_issue_assigned',
                        'error_tracking_weekly_digest_project_enabled',
                        'materialized_view_sync_failed',
                        'materialized_view_sync_failed_daily',
                        'materialized_view_sync_failed_immediate',
                        'organization_member_join_email_disabled',
                        'pipeline_notifications_disabled',
                        'project_weekly_digest_disabled',
                        'web_analytics_weekly_digest_project_enabled',
                    ])
                    .describe(
                        '\* `approval_requested` - approval_requested\n\* `approval_resolved` - approval_resolved\n\* `data_catalog_weekly_digest` - data_catalog_weekly_digest\n\* `discussions_mentioned` - discussions_mentioned\n\* `error_tracking_issue_assigned` - error_tracking_issue_assigned\n\* `error_tracking_weekly_digest_project_enabled` - error_tracking_weekly_digest_project_enabled\n\* `materialized_view_sync_failed` - materialized_view_sync_failed\n\* `materialized_view_sync_failed_daily` - materialized_view_sync_failed_daily\n\* `materialized_view_sync_failed_immediate` - materialized_view_sync_failed_immediate\n\* `organization_member_join_email_disabled` - organization_member_join_email_disabled\n\* `pipeline_notifications_disabled` - pipeline_notifications_disabled\n\* `project_weekly_digest_disabled` - project_weekly_digest_disabled\n\* `web_analytics_weekly_digest_project_enabled` - web_analytics_weekly_digest_project_enabled'
                    )
                    .describe(
                        'Notification setting to lock or unlock.\n\n\* `approval_requested` - approval_requested\n\* `approval_resolved` - approval_resolved\n\* `data_catalog_weekly_digest` - data_catalog_weekly_digest\n\* `discussions_mentioned` - discussions_mentioned\n\* `error_tracking_issue_assigned` - error_tracking_issue_assigned\n\* `error_tracking_weekly_digest_project_enabled` - error_tracking_weekly_digest_project_enabled\n\* `materialized_view_sync_failed` - materialized_view_sync_failed\n\* `materialized_view_sync_failed_daily` - materialized_view_sync_failed_daily\n\* `materialized_view_sync_failed_immediate` - materialized_view_sync_failed_immediate\n\* `organization_member_join_email_disabled` - organization_member_join_email_disabled\n\* `pipeline_notifications_disabled` - pipeline_notifications_disabled\n\* `project_weekly_digest_disabled` - project_weekly_digest_disabled\n\* `web_analytics_weekly_digest_project_enabled` - web_analytics_weekly_digest_project_enabled'
                    ),
                scope_id: zod
                    .string()
                    .default(notificationLocksBulkUpdateCreateBodyChangesItemScopeIdDefault)
                    .describe(
                        'Project ID for a setting that breaks down by project, organization ID for the member-join email, empty for a single switch.'
                    ),
                locked_value: zod
                    .boolean()
                    .nullable()
                    .describe(
                        'Value to enforce, or null to remove the rule and give the member their own setting back.'
                    ),
            })
        )
        .max(notificationLocksBulkUpdateCreateBodyChangesMax)
        .describe('Only the entries you changed. Anything left out keeps whatever it had.'),
})

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsCreateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Replace a project and its settings. Prefer the PATCH endpoint for partial updates — PUT requires every writable field to be provided.
 */
export const OrganizationsProjectsUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Update one or more of a project's settings. Only the fields included in the request body are changed.
 */
export const OrganizationsProjectsPartialUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsAddProductIntentPartialUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsChangeOrganizationCreateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsCompleteProductOnboardingPartialUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Manage default evaluation contexts for a project. Members can read; writing requires
 * project admin, matching the admin-only settings UI.
 */
export const OrganizationsProjectsDefaultEvaluationContextsCreateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Manage default release conditions for new feature flags in this project. Members can read;
 * writing requires project admin, matching the admin-only settings UI.
 */
export const OrganizationsProjectsDefaultReleaseConditionsUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsDeleteSecretTokenBackupPartialUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Manage experiment configuration for this project.
 */
export const OrganizationsProjectsExperimentsConfigPartialUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsGenerateConversationsPublicTokenCreateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsResetTokenPartialUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Projects for the current organization.
 */
export const OrganizationsProjectsRotateSecretTokenPartialUpdateBody = /* @__PURE__ */ zod
    .record(zod.string(), zod.unknown())
    .describe('Deep\/recursive schema (opaque in Zod — use TypeScript types for full shape)')

/**
 * Create a new password for the sharing configuration.
 */
export const DashboardsSharingPasswordsCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

export const DashboardsSharingRefreshCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

/**
 * Submit a one-column HogQL query for event deletion.
 */
export const DataDeletionRequestsCreateBody = /* @__PURE__ */ zod.object({
    query: zod.string().describe('HogQL query that selects one event UUID column.'),
    variables: zod
        .record(
            zod.string(),
            zod.object({
                code_name: zod.string(),
                isNull: zod.union([zod.boolean(), zod.null()]).optional(),
                value: zod.unknown().optional(),
                variableId: zod.string(),
            })
        )
        .optional()
        .describe('Variables referenced by the HogQL query.'),
    submission_id: zod.uuid().describe('Client-generated identifier that makes request submission idempotent.'),
})

/**
 * Validate a one-column HogQL query and count the selected event UUIDs.
 */
export const DataDeletionRequestsPreviewCreateBody = /* @__PURE__ */ zod.object({
    query: zod.string().describe('HogQL query that selects one event UUID column.'),
    variables: zod
        .record(
            zod.string(),
            zod.object({
                code_name: zod.string(),
                isNull: zod.union([zod.boolean(), zod.null()]).optional(),
                value: zod.unknown().optional(),
                variableId: zod.string(),
            })
        )
        .optional()
        .describe('Variables referenced by the HogQL query.'),
})

export const ExportsCreateBody = /* @__PURE__ */ zod
    .object({
        dashboard: zod.number().nullish(),
        insight: zod.number().nullish(),
        export_format: zod
            .enum([
                'image/png',
                'application/pdf',
                'text/csv',
                'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
                'video/webm',
                'video/mp4',
                'image/gif',
                'application/json',
            ])
            .describe(
                '\* `image\/png` - image\/png\n\* `application\/pdf` - application\/pdf\n\* `text\/csv` - text\/csv\n\* `application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n\* `video\/webm` - video\/webm\n\* `video\/mp4` - video\/mp4\n\* `image\/gif` - image\/gif\n\* `application\/json` - application\/json'
            )
            .describe(
                'File format to generate. Dataset JSONL exports use the dataset export endpoint.\n\n\* `image\/png` - image\/png\n\* `application\/pdf` - application\/pdf\n\* `text\/csv` - text\/csv\n\* `application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet` - application\/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n\* `video\/webm` - video\/webm\n\* `video\/mp4` - video\/mp4\n\* `image\/gif` - image\/gif\n\* `application\/json` - application\/json'
            ),
        export_context: zod.unknown().optional(),
    })
    .describe("Standard ExportedAsset serializer that doesn't return content.")

export const fileSystemCreateBodyTypeMax = 100

export const fileSystemCreateBodyRefMax = 100

export const FileSystemCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemCreateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemCreateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

export const fileSystemUpdateBodyTypeMax = 100

export const fileSystemUpdateBodyRefMax = 100

export const FileSystemUpdateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemUpdateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemUpdateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

export const fileSystemPartialUpdateBodyTypeMax = 100

export const fileSystemPartialUpdateBodyRefMax = 100

export const FileSystemPartialUpdateBody = /* @__PURE__ */ zod.object({
    path: zod.string().optional(),
    type: zod.string().max(fileSystemPartialUpdateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemPartialUpdateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

/**
 * Get count of all files in a folder.
 */
export const fileSystemCountCreateBodyTypeMax = 100

export const fileSystemCountCreateBodyRefMax = 100

export const FileSystemCountCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemCountCreateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemCountCreateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

export const fileSystemLinkCreateBodyTypeMax = 100

export const fileSystemLinkCreateBodyRefMax = 100

export const FileSystemLinkCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemLinkCreateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemLinkCreateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

export const fileSystemMoveCreateBodyTypeMax = 100

export const fileSystemMoveCreateBodyRefMax = 100

export const FileSystemMoveCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemMoveCreateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemMoveCreateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

/**
 * Get count of all files in a folder.
 */
export const fileSystemCountByPathCreateBodyTypeMax = 100

export const fileSystemCountByPathCreateBodyRefMax = 100

export const FileSystemCountByPathCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemCountByPathCreateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemCountByPathCreateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

export const fileSystemLogViewCreateBodyTypeMax = 100

export const fileSystemLogViewCreateBodyRefMax = 100

export const FileSystemLogViewCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemLogViewCreateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemLogViewCreateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

export const fileSystemUndoDeleteCreateBodyTypeMax = 100

export const fileSystemUndoDeleteCreateBodyRefMax = 100

export const FileSystemUndoDeleteCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string(),
    type: zod.string().max(fileSystemUndoDeleteCreateBodyTypeMax).optional(),
    ref: zod.string().max(fileSystemUndoDeleteCreateBodyRefMax).nullish(),
    href: zod.string().nullish(),
    meta: zod.unknown().optional(),
    shortcut: zod.boolean().nullish(),
})

export const fileSystemShortcutCreateBodyTypeMax = 100

export const fileSystemShortcutCreateBodyRefMax = 4000

export const fileSystemShortcutCreateBodyOrderMin = -2147483648
export const fileSystemShortcutCreateBodyOrderMax = 2147483647

export const FileSystemShortcutCreateBody = /* @__PURE__ */ zod.object({
    path: zod.string().describe('Display path of the shortcut in the sidebar.'),
    type: zod
        .string()
        .max(fileSystemShortcutCreateBodyTypeMax)
        .optional()
        .describe("Type of the linked item (e.g. 'folder', 'insight'), or blank."),
    ref: zod
        .string()
        .max(fileSystemShortcutCreateBodyRefMax)
        .nullish()
        .describe('Reference to the linked item, scoped to its type. Null for href-only shortcuts.'),
    href: zod
        .string()
        .nullish()
        .describe('Destination URL the shortcut opens. Null when the shortcut points at an item by ref.'),
    order: zod
        .number()
        .min(fileSystemShortcutCreateBodyOrderMin)
        .max(fileSystemShortcutCreateBodyOrderMax)
        .optional()
        .describe("Display order within the user's shortcut list, ascending."),
})

export const fileSystemShortcutUpdateBodyTypeMax = 100

export const fileSystemShortcutUpdateBodyRefMax = 4000

export const fileSystemShortcutUpdateBodyOrderMin = -2147483648
export const fileSystemShortcutUpdateBodyOrderMax = 2147483647

export const FileSystemShortcutUpdateBody = /* @__PURE__ */ zod.object({
    path: zod.string().describe('Display path of the shortcut in the sidebar.'),
    type: zod
        .string()
        .max(fileSystemShortcutUpdateBodyTypeMax)
        .optional()
        .describe("Type of the linked item (e.g. 'folder', 'insight'), or blank."),
    ref: zod
        .string()
        .max(fileSystemShortcutUpdateBodyRefMax)
        .nullish()
        .describe('Reference to the linked item, scoped to its type. Null for href-only shortcuts.'),
    href: zod
        .string()
        .nullish()
        .describe('Destination URL the shortcut opens. Null when the shortcut points at an item by ref.'),
    order: zod
        .number()
        .min(fileSystemShortcutUpdateBodyOrderMin)
        .max(fileSystemShortcutUpdateBodyOrderMax)
        .optional()
        .describe("Display order within the user's shortcut list, ascending."),
})

export const fileSystemShortcutPartialUpdateBodyTypeMax = 100

export const fileSystemShortcutPartialUpdateBodyRefMax = 4000

export const fileSystemShortcutPartialUpdateBodyOrderMin = -2147483648
export const fileSystemShortcutPartialUpdateBodyOrderMax = 2147483647

export const FileSystemShortcutPartialUpdateBody = /* @__PURE__ */ zod.object({
    path: zod.string().optional().describe('Display path of the shortcut in the sidebar.'),
    type: zod
        .string()
        .max(fileSystemShortcutPartialUpdateBodyTypeMax)
        .optional()
        .describe("Type of the linked item (e.g. 'folder', 'insight'), or blank."),
    ref: zod
        .string()
        .max(fileSystemShortcutPartialUpdateBodyRefMax)
        .nullish()
        .describe('Reference to the linked item, scoped to its type. Null for href-only shortcuts.'),
    href: zod
        .string()
        .nullish()
        .describe('Destination URL the shortcut opens. Null when the shortcut points at an item by ref.'),
    order: zod
        .number()
        .min(fileSystemShortcutPartialUpdateBodyOrderMin)
        .max(fileSystemShortcutPartialUpdateBodyOrderMax)
        .optional()
        .describe("Display order within the user's shortcut list, ascending."),
})

/**
 * Create and delete several of the current user's shortcuts in one transaction, then return the full shortcut list in display order. Any unknown ID in `remove_ids` rejects the whole request.
 */
export const fileSystemShortcutBulkUpdateCreateBodyAddItemTypeDefault = ``
export const fileSystemShortcutBulkUpdateCreateBodyAddItemTypeMax = 100

export const fileSystemShortcutBulkUpdateCreateBodyAddItemRefMax = 4000

export const fileSystemShortcutBulkUpdateCreateBodyAddMax = 500

export const fileSystemShortcutBulkUpdateCreateBodyRemoveIdsMax = 500

export const FileSystemShortcutBulkUpdateCreateBody = /* @__PURE__ */ zod.object({
    add: zod
        .array(
            zod.object({
                path: zod.string().describe('Display path of the shortcut in the sidebar.'),
                type: zod
                    .string()
                    .max(fileSystemShortcutBulkUpdateCreateBodyAddItemTypeMax)
                    .default(fileSystemShortcutBulkUpdateCreateBodyAddItemTypeDefault)
                    .describe("Type of the linked item (e.g. 'folder', 'insight'), or blank."),
                ref: zod
                    .string()
                    .max(fileSystemShortcutBulkUpdateCreateBodyAddItemRefMax)
                    .nullish()
                    .describe('Reference to the linked item, scoped to its type. Null for href-only shortcuts.'),
                href: zod
                    .string()
                    .nullish()
                    .describe('Destination URL the shortcut opens. Null when the shortcut points at an item by ref.'),
            })
        )
        .max(fileSystemShortcutBulkUpdateCreateBodyAddMax)
        .optional()
        .describe(
            'Shortcuts to create, appended to the end of the current order in the given sequence. An item identical to a shortcut the user already has is skipped.'
        ),
    remove_ids: zod
        .array(zod.uuid())
        .max(fileSystemShortcutBulkUpdateCreateBodyRemoveIdsMax)
        .optional()
        .describe("IDs of the current user's shortcuts to delete."),
})

/**
 * Set the display order of the current user's shortcuts. `ordered_ids` becomes the new top-to-bottom order; any unknown IDs are rejected.
 */
export const FileSystemShortcutReorderCreateBody = /* @__PURE__ */ zod.object({
    ordered_ids: zod.array(zod.uuid()).describe("IDs of the current user's shortcuts in the desired display order."),
})

/**
 * Create a new password for the sharing configuration.
 */
export const InsightsSharingPasswordsCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

export const InsightsSharingRefreshCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

/**
 * Create a new password for the sharing configuration.
 */
export const NotebooksSharingPasswordsCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

export const NotebooksSharingRefreshCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

export const ProductEnablementCreateBody = /* @__PURE__ */ zod.object({
    products: zod
        .array(
            zod
                .enum(['conversations', 'error_tracking', 'session_replay'])
                .describe(
                    '\* `conversations` - conversations\n\* `error_tracking` - error_tracking\n\* `session_replay` - session_replay'
                )
        )
        .min(1)
        .describe('Products to turn on for this project, each enabled with server-owned conservative defaults.'),
})

export const projectSecretApiKeysCreateBodyLabelMax = 40

export const ProjectSecretApiKeysCreateBody = /* @__PURE__ */ zod.object({
    label: zod.string().max(projectSecretApiKeysCreateBodyLabelMax),
    scopes: zod
        .array(zod.string())
        .describe(
            'Project-wide API scopes granted to this key. Project secret API keys do not honor object-level access controls, so a scope can access resources of that type even when per-resource RBAC would hide them from an individual user.'
        ),
})

export const projectSecretApiKeysUpdateBodyLabelMax = 40

export const ProjectSecretApiKeysUpdateBody = /* @__PURE__ */ zod.object({
    label: zod.string().max(projectSecretApiKeysUpdateBodyLabelMax),
    scopes: zod
        .array(zod.string())
        .describe(
            'Project-wide API scopes granted to this key. Project secret API keys do not honor object-level access controls, so a scope can access resources of that type even when per-resource RBAC would hide them from an individual user.'
        ),
})

export const projectSecretApiKeysPartialUpdateBodyLabelMax = 40

export const ProjectSecretApiKeysPartialUpdateBody = /* @__PURE__ */ zod.object({
    label: zod.string().max(projectSecretApiKeysPartialUpdateBodyLabelMax).optional(),
    scopes: zod
        .array(zod.string())
        .optional()
        .describe(
            'Project-wide API scopes granted to this key. Project secret API keys do not honor object-level access controls, so a scope can access resources of that type even when per-resource RBAC would hide them from an individual user.'
        ),
})

export const PropertyDefinitionsUpdateBody = /* @__PURE__ */ zod
    .object({
        description: zod.string().nullish(),
        tags: zod.array(zod.unknown()).optional(),
        property_type: zod
            .union([
                zod
                    .enum(['DateTime', 'String', 'Numeric', 'Boolean', 'Duration'])
                    .describe(
                        '\* `DateTime` - DateTime\n\* `String` - String\n\* `Numeric` - Numeric\n\* `Boolean` - Boolean\n\* `Duration` - Duration'
                    ),
                zod.enum(['']),
                zod.null(),
            ])
            .optional(),
        verified: zod.boolean().optional(),
        hidden: zod.boolean().nullish(),
    })
    .describe('Serializer mixin that handles tags for objects.')

export const PropertyDefinitionsPartialUpdateBody = /* @__PURE__ */ zod
    .object({
        description: zod.string().nullish(),
        tags: zod.array(zod.unknown()).optional(),
        property_type: zod
            .union([
                zod
                    .enum(['DateTime', 'String', 'Numeric', 'Boolean', 'Duration'])
                    .describe(
                        '\* `DateTime` - DateTime\n\* `String` - String\n\* `Numeric` - Numeric\n\* `Boolean` - Boolean\n\* `Duration` - Duration'
                    ),
                zod.enum(['']),
                zod.null(),
            ])
            .optional(),
        verified: zod.boolean().optional(),
        hidden: zod.boolean().nullish(),
    })
    .describe('Serializer mixin that handles tags for objects.')

/**
 * Bulk update tags on multiple objects.
 *
 * PAT access: this action has no ``required_scopes=`` on the decorator —
 * inheriting viewsets must add ``"bulk_update_tags"`` to their
 * ``scope_object_write_actions`` list to accept personal API keys.
 * Without that opt-in, ``APIScopePermission`` rejects PAT requests with
 * "This action does not support personal API key access". Done per-viewset
 * so granting ``<scope>:write`` for one resource doesn't leak access to
 * sibling resources that share this mixin.
 *
 * Accepts:
 * - {"ids": [...], "action": "add"|"remove"|"set", "tags": ["tag1", "tag2"]}
 *
 * Actions:
 * - "add": Add tags to existing tags on each object
 * - "remove": Remove specific tags from each object
 * - "set": Replace all tags on each object with the provided list
 */
export const propertyDefinitionsBulkUpdateTagsCreateBodyIdsMax = 500

export const propertyDefinitionsBulkUpdateTagsCreateBodyTagsItemMax = 255

export const propertyDefinitionsBulkUpdateTagsCreateBodyTagsMax = 100

export const PropertyDefinitionsBulkUpdateTagsCreateBody = /* @__PURE__ */ zod.object({
    ids: zod
        .array(zod.number())
        .max(propertyDefinitionsBulkUpdateTagsCreateBodyIdsMax)
        .describe('List of object IDs to update tags on.'),
    action: zod
        .enum(['add', 'remove', 'set'])
        .describe('\* `add` - add\n\* `remove` - remove\n\* `set` - set')
        .describe(
            "'add' merges with existing tags, 'remove' deletes specific tags, 'set' replaces all tags.\n\n\* `add` - add\n\* `remove` - remove\n\* `set` - set"
        ),
    tags: zod
        .array(zod.string().max(propertyDefinitionsBulkUpdateTagsCreateBodyTagsItemMax))
        .max(propertyDefinitionsBulkUpdateTagsCreateBodyTagsMax)
        .describe('Tag names to add, remove, or set (up to 100 per request, 255 characters each).'),
})

/**
 * Create a new password for the sharing configuration.
 */
export const SessionRecordingsSharingPasswordsCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

export const SessionRecordingsSharingRefreshCreateBody = /* @__PURE__ */ zod
    .object({
        enabled: zod.boolean().optional(),
        settings: zod.unknown().optional(),
        password_required: zod.boolean().optional(),
    })
    .describe('Mixin for serializers to add user access control fields')

/**
 * Guess which filter picker tab a search belongs to, so the picker can suggest or promote it.
 * @summary Classify a filter picker search
 */
export const taxonomicSearchIntentClassifyCreateBodyQueryMax = 200

export const taxonomicSearchIntentClassifyCreateBodyActiveGroupTypeMax = 100

export const taxonomicSearchIntentClassifyCreateBodyAvailableGroupTypesItemMax = 100

export const taxonomicSearchIntentClassifyCreateBodyAvailableGroupTypesMax = 64

export const taxonomicSearchIntentClassifyCreateBodySceneRegExp = new RegExp('^[A-Za-z0-9_-]{1,64}$')

export const TaxonomicSearchIntentClassifyCreateBody = /* @__PURE__ */ zod.object({
    query: zod
        .string()
        .max(taxonomicSearchIntentClassifyCreateBodyQueryMax)
        .describe('What the person typed into the filter picker search box.'),
    active_group_type: zod
        .string()
        .max(taxonomicSearchIntentClassifyCreateBodyActiveGroupTypeMax)
        .describe('The picker tab that is open, as a taxonomic group type such as event_properties.'),
    available_group_types: zod
        .array(zod.string().max(taxonomicSearchIntentClassifyCreateBodyAvailableGroupTypesItemMax))
        .max(taxonomicSearchIntentClassifyCreateBodyAvailableGroupTypesMax)
        .describe('The taxonomic group types the picker shows. The answer is always one of these, or null.'),
    scene: zod
        .string()
        .regex(taxonomicSearchIntentClassifyCreateBodySceneRegExp)
        .nullish()
        .describe('The id of the scene the picker is open in, such as Insight or Replay.'),
})

/**
 * Send a WebRTC session description to another terminal in a Doom room.
 */
export const terminalNetplaySignalCreateBodyRoomRegExp = new RegExp('^[A-Z0-9]{4,12}$')
export const terminalNetplaySignalCreateBodySenderRegExp = new RegExp('^[a-z0-9]{1,32}$')
export const terminalNetplaySignalCreateBodyRecipientRegExp = new RegExp('^[a-z0-9]{1,32}$')
export const terminalNetplaySignalCreateBodyDescriptionSdpMax = 16384

export const TerminalNetplaySignalCreateBody = /* @__PURE__ */ zod.object({
    room: zod.string().regex(terminalNetplaySignalCreateBodyRoomRegExp).describe('Room code shown by the game host.'),
    sender: zod.string().regex(terminalNetplaySignalCreateBodySenderRegExp).describe('Peer that sent the description.'),
    recipient: zod
        .string()
        .regex(terminalNetplaySignalCreateBodyRecipientRegExp)
        .describe('Peer that receives the description.'),
    description: zod.object({
        type: zod
            .enum(['offer', 'answer'])
            .describe('\* `offer` - offer\n\* `answer` - answer')
            .describe('WebRTC session description type.\n\n\* `offer` - offer\n\* `answer` - answer'),
        sdp: zod
            .string()
            .max(terminalNetplaySignalCreateBodyDescriptionSdpMax)
            .describe('WebRTC session description with ICE candidates.'),
    }),
})

/**
 *
 *     When object storage is available this API allows upload of media which can be used, for example, in text cards on dashboards.
 *
 *     Uploaded media must be less than 4MB and decode as a PNG, JPEG, GIF, WebP, AVIF or BMP image — the formats
 *     the download route will serve inline. Pass `purpose` to also add the image to a library, making it visible
 *     to `GET ?purpose=...`.
 *
 */
export const UploadedMediaCreateBody = /* @__PURE__ */ zod.object({
    image: zod.instanceof(File).describe('Image file. Must be under 4MB and a real, decodable image.'),
    purpose: zod
        .enum(['email', 'canvas', 'experiment'])
        .optional()
        .describe(
            'Library to add this image to. Omit to upload without joining a library (as dashboard text cards and notebooks do).'
        ),
})

/**
 * Step 1 of the presigned upload flow: reserves a pending image and returns a presigned URL to POST the file to directly, bytes never pass through this API. Call complete_upload with the returned id once the upload finishes.
 */
export const uploadedMediaStartUploadCreateBodyNameMax = 1000

export const uploadedMediaStartUploadCreateBodyPurposeMax = 100

export const UploadedMediaStartUploadCreateBody = /* @__PURE__ */ zod.object({
    name: zod
        .string()
        .max(uploadedMediaStartUploadCreateBodyNameMax)
        .describe("The file's display name, e.g. 'logo.png'."),
    purpose: zod
        .string()
        .max(uploadedMediaStartUploadCreateBodyPurposeMax)
        .describe("Library to add this image to once uploaded, e.g. 'email'."),
})

export const workloadTrustPoliciesCreateBodyNameMax = 200

export const workloadTrustPoliciesCreateBodyIssuerMax = 255

export const workloadTrustPoliciesCreateBodySubjectNameMax = 255

export const workloadTrustPoliciesCreateBodySubjectMax = 255

export const workloadTrustPoliciesCreateBodyScopesItemMax = 100

export const WorkloadTrustPoliciesCreateBody = /* @__PURE__ */ zod.object({
    name: zod.string().max(workloadTrustPoliciesCreateBodyNameMax).describe('A name that says what the policy is for.'),
    issuer: zod
        .string()
        .max(workloadTrustPoliciesCreateBodyIssuerMax)
        .describe('The OIDC issuer of the workload provider, from the list of supported providers.'),
    subject_name: zod
        .string()
        .max(workloadTrustPoliciesCreateBodySubjectNameMax)
        .describe(
            "The workload's human-readable name, from the provider's subject name claim, for example a repository's full name. Matched exactly."
        ),
    subject: zod
        .string()
        .max(workloadTrustPoliciesCreateBodySubjectMax)
        .describe(
            "The workload's immutable ID, from the provider's subject claim, for example a repository ID. Matched exactly together with the name, so a deleted and re-created workload with the same name does not match."
        ),
    conditions: zod
        .record(zod.string(), zod.string())
        .optional()
        .describe(
            "Claims the token must carry, as claim name to exact value, for example a branch or an environment. Only the provider's condition claims are allowed. An empty value removes the condition."
        ),
    scopes: zod
        .array(zod.string().max(workloadTrustPoliciesCreateBodyScopesItemMax))
        .describe(
            'The scopes every token minted under this policy carries. Scopes that manage credentials or access are refused.'
        ),
    enabled: zod.boolean().optional().describe('Whether the policy can mint tokens. Disabling it cuts off its tokens.'),
})

export const workloadTrustPoliciesUpdateBodyNameMax = 200

export const workloadTrustPoliciesUpdateBodyIssuerMax = 255

export const workloadTrustPoliciesUpdateBodySubjectNameMax = 255

export const workloadTrustPoliciesUpdateBodySubjectMax = 255

export const workloadTrustPoliciesUpdateBodyScopesItemMax = 100

export const WorkloadTrustPoliciesUpdateBody = /* @__PURE__ */ zod.object({
    name: zod.string().max(workloadTrustPoliciesUpdateBodyNameMax).describe('A name that says what the policy is for.'),
    issuer: zod
        .string()
        .max(workloadTrustPoliciesUpdateBodyIssuerMax)
        .describe('The OIDC issuer of the workload provider, from the list of supported providers.'),
    subject_name: zod
        .string()
        .max(workloadTrustPoliciesUpdateBodySubjectNameMax)
        .describe(
            "The workload's human-readable name, from the provider's subject name claim, for example a repository's full name. Matched exactly."
        ),
    subject: zod
        .string()
        .max(workloadTrustPoliciesUpdateBodySubjectMax)
        .describe(
            "The workload's immutable ID, from the provider's subject claim, for example a repository ID. Matched exactly together with the name, so a deleted and re-created workload with the same name does not match."
        ),
    conditions: zod
        .record(zod.string(), zod.string())
        .optional()
        .describe(
            "Claims the token must carry, as claim name to exact value, for example a branch or an environment. Only the provider's condition claims are allowed. An empty value removes the condition."
        ),
    scopes: zod
        .array(zod.string().max(workloadTrustPoliciesUpdateBodyScopesItemMax))
        .describe(
            'The scopes every token minted under this policy carries. Scopes that manage credentials or access are refused.'
        ),
    enabled: zod.boolean().optional().describe('Whether the policy can mint tokens. Disabling it cuts off its tokens.'),
})

export const workloadTrustPoliciesPartialUpdateBodyNameMax = 200

export const workloadTrustPoliciesPartialUpdateBodyIssuerMax = 255

export const workloadTrustPoliciesPartialUpdateBodySubjectNameMax = 255

export const workloadTrustPoliciesPartialUpdateBodySubjectMax = 255

export const workloadTrustPoliciesPartialUpdateBodyScopesItemMax = 100

export const WorkloadTrustPoliciesPartialUpdateBody = /* @__PURE__ */ zod.object({
    name: zod
        .string()
        .max(workloadTrustPoliciesPartialUpdateBodyNameMax)
        .optional()
        .describe('A name that says what the policy is for.'),
    issuer: zod
        .string()
        .max(workloadTrustPoliciesPartialUpdateBodyIssuerMax)
        .optional()
        .describe('The OIDC issuer of the workload provider, from the list of supported providers.'),
    subject_name: zod
        .string()
        .max(workloadTrustPoliciesPartialUpdateBodySubjectNameMax)
        .optional()
        .describe(
            "The workload's human-readable name, from the provider's subject name claim, for example a repository's full name. Matched exactly."
        ),
    subject: zod
        .string()
        .max(workloadTrustPoliciesPartialUpdateBodySubjectMax)
        .optional()
        .describe(
            "The workload's immutable ID, from the provider's subject claim, for example a repository ID. Matched exactly together with the name, so a deleted and re-created workload with the same name does not match."
        ),
    conditions: zod
        .record(zod.string(), zod.string())
        .optional()
        .describe(
            "Claims the token must carry, as claim name to exact value, for example a branch or an environment. Only the provider's condition claims are allowed. An empty value removes the condition."
        ),
    scopes: zod
        .array(zod.string().max(workloadTrustPoliciesPartialUpdateBodyScopesItemMax))
        .optional()
        .describe(
            'The scopes every token minted under this policy carries. Scopes that manage credentials or access are refused.'
        ),
    enabled: zod.boolean().optional().describe('Whether the policy can mint tokens. Disabling it cuts off its tokens.'),
})

export const workloadTrustPolicyRequestsCreateBodyNameMax = 200

export const workloadTrustPolicyRequestsCreateBodyIssuerMax = 255

export const workloadTrustPolicyRequestsCreateBodySubjectNameMax = 255

export const workloadTrustPolicyRequestsCreateBodySubjectMax = 255

export const workloadTrustPolicyRequestsCreateBodyScopesItemMax = 100

export const WorkloadTrustPolicyRequestsCreateBody = /* @__PURE__ */ zod.object({
    name: zod
        .string()
        .max(workloadTrustPolicyRequestsCreateBodyNameMax)
        .describe('The name the policy gets once approved.'),
    issuer: zod
        .string()
        .max(workloadTrustPolicyRequestsCreateBodyIssuerMax)
        .describe('The OIDC issuer of the workload provider, from the list of supported providers.'),
    subject_name: zod
        .string()
        .max(workloadTrustPolicyRequestsCreateBodySubjectNameMax)
        .describe(
            "The workload's human-readable name, from the provider's subject name claim, for example a repository's full name. Matched exactly."
        ),
    subject: zod
        .string()
        .max(workloadTrustPolicyRequestsCreateBodySubjectMax)
        .describe(
            "The workload's immutable ID, from the provider's subject claim, for example a repository ID. Matched exactly together with the name, so a deleted and re-created workload with the same name does not match."
        ),
    conditions: zod
        .record(zod.string(), zod.string())
        .optional()
        .describe(
            "Claims the token must carry, as claim name to exact value, for example a branch or an environment. Only the provider's condition claims are allowed. An empty value removes the condition."
        ),
    scopes: zod
        .array(zod.string().max(workloadTrustPolicyRequestsCreateBodyScopesItemMax))
        .describe("The scopes the policy's tokens would carry."),
})

/**
 * Public, unauthenticated endpoint for self-service revocation of a leaked PostHog personal API key, project secret API key, legacy feature flags secure API key, or OAuth access/refresh token. If the token matches a real credential, it is revoked immediately and the owner is notified by email. This includes an expired OAuth access token: the paired refresh token it protects may still be live. A legacy feature flags secure API key is matched through its migrated project secret API key row; it cannot be rotated automatically, so its project admins get an email to rotate it.
 *
 * This endpoint only checks the region it is running on. `"found": false` does not guarantee the token is safe. If you're not sure which region issued it, check both: https://app.posthog.com/api/revoke_leaked_key and https://eu.posthog.com/api/revoke_leaked_key.
 * @summary Report and revoke a leaked PostHog API key or token
 */
export const revokeLeakedKeyCreateBodyTokenMax = 200

export const RevokeLeakedKeyCreateBody = /* @__PURE__ */ zod.object({
    token: zod
        .string()
        .max(revokeLeakedKeyCreateBodyTokenMax)
        .describe(
            'The leaked PostHog personal API key, project secret API key, legacy feature flags secure API key, or OAuth access\/refresh token to revoke.'
        ),
})

/**
 * Replace the authenticated user's profile and settings. Pass `@me` as the UUID to update the authenticated user. Prefer the PATCH endpoint for partial updates — PUT requires every writable field to be provided.
 */
export const usersUpdateBodyFirstNameMax = 150

export const usersUpdateBodyLastNameMax = 150

export const usersUpdateBodyEmailMax = 254

export const usersUpdateBodyPasswordMax = 128

export const UsersUpdateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersUpdateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersUpdateBodyLastNameMax).optional(),
    email: zod.email().max(usersUpdateBodyEmailMax),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersUpdateBodyPasswordMax),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

/**
 * Update one or more of the authenticated user's profile fields or settings.
 */
export const usersPartialUpdateBodyFirstNameMax = 150

export const usersPartialUpdateBodyLastNameMax = 150

export const usersPartialUpdateBodyEmailMax = 254

export const usersPartialUpdateBodyPasswordMax = 128

export const UsersPartialUpdateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersPartialUpdateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersPartialUpdateBodyLastNameMax).optional(),
    email: zod.email().max(usersPartialUpdateBodyEmailMax).optional(),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersPartialUpdateBodyPasswordMax).optional(),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

export const usersHedgehogConfigPartialUpdateBodyFirstNameMax = 150

export const usersHedgehogConfigPartialUpdateBodyLastNameMax = 150

export const usersHedgehogConfigPartialUpdateBodyEmailMax = 254

export const usersHedgehogConfigPartialUpdateBodyPasswordMax = 128

export const UsersHedgehogConfigPartialUpdateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersHedgehogConfigPartialUpdateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersHedgehogConfigPartialUpdateBodyLastNameMax).optional(),
    email: zod.email().max(usersHedgehogConfigPartialUpdateBodyEmailMax).optional(),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersHedgehogConfigPartialUpdateBodyPasswordMax).optional(),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

/**
 * Submit the `tokens` object of the `auth.json` that `codex login` wrote on the user's machine. PostHog refreshes the chain once to prove it works, stores the rotated tokens encrypted, and from then on refreshes them for the user's Codex cloud runs. Only the owning user can connect. No response carries a token.
 * @summary Connect a ChatGPT account for Codex cloud tasks
 */
export const UsersIntegrationsCodexCreateBody = /* @__PURE__ */ zod.object({
    tokens: zod
        .object({
            access_token: zod
                .string()
                .describe('The ChatGPT access token (a JWT) from the `tokens` object of the Codex `auth.json`.'),
            refresh_token: zod.string().describe('The single-use ChatGPT refresh token from the same `tokens` object.'),
            id_token: zod
                .string()
                .nullish()
                .describe(
                    'The OpenID id token from the same `tokens` object, when present. Used to read the account email.'
                ),
        })
        .describe(
            'The `tokens` object of the `auth.json` that `codex login` wrote. PostHog refreshes the chain once, stores the rotated tokens, and refreshes them for cloud runs from then on.'
        ),
})

/**
 * Seed personal GitHub manage callback state before opening installation settings on GitHub.
 */
export const UsersIntegrationsGithubPrepareCallbackCreateBody = /* @__PURE__ */ zod.object({
    installation_id: zod.string().describe('GitHub App installation id being managed on github.com.'),
})

/**
 * Start GitHub linking: either full App install or OAuth-only (user-to-server).
 *
 * ``**_kwargs`` absorbs ``parent_lookup_uuid`` from the nested
 * ``/api/users/{uuid}/integrations/`` router (same pattern as ``local_evaluation``
 * under projects).
 *
 * Usually returns ``install_url`` pointing at ``/installations/new`` so the
 * user can pick any GitHub org (new or already connected).  GitHub's install
 * page handles both cases: orgs where the app is installed show "Configure"
 * (no admin needed), orgs where it isn't show "Install" (needs admin).
 *
 * **OAuth fast path:** when the current project already has a team-level
 * GitHub installation, and the user has no ``UserIntegration`` for that
 * installation yet, we skip the org picker and redirect straight to
 * ``/login/oauth/authorize`` so the user only authorizes themselves.
 * ``connect_from`` is preserved for first-party clients so they return to
 * the originating client immediately.
 *
 * In both cases the response key is ``install_url`` for compatibility with callers.
 * @summary Start GitHub personal integration linking
 */
export const UsersIntegrationsGithubStartCreateBody = /* @__PURE__ */ zod.object({
    team_id: zod
        .number()
        .nullish()
        .describe("Optional team\/project id (e.g. PostHog Desktop); web UI uses the session's current team."),
    connect_from: zod
        .string()
        .optional()
        .describe('Optional client hint (e.g. posthog_code) for return routing after OAuth.'),
})

/**
 * Mint a Sign-in-with-Slack invite URL initiated from settings, without
 * Slack-DM context. The returned URL takes the user through PostHog login
 * (already satisfied here), then to Slack OAuth, then back to our callback
 * which writes the ``UserIntegration`` row.
 *
 * Without body params, falls back to the user's ``current_team`` and that
 * team's first Slack ``Integration`` — works when there's exactly one
 * linkable workspace. With ``team_id`` + ``slack_team_id``, links against
 * the exact pair (what the frontend uses when a picker is shown).
 *
 * Refuses if the target team has no matching Slack workspace, if the
 * feature flag is off for the workspace, or if the user is already linked
 * to it.
 * @summary Start Slack identity link from settings
 */
export const UsersIntegrationsSlackStartCreateBody = /* @__PURE__ */ zod
    .object({
        team_id: zod
            .number()
            .nullish()
            .describe("Optional team\/project id to link against; defaults to the user's current team."),
        slack_team_id: zod
            .string()
            .nullish()
            .describe(
                'Specific Slack workspace id to link against, scoped to the team. Disambiguates when one team has multiple Slack integrations (rare).'
            ),
    })
    .describe(
        "Settings-initiated link can target a specific PostHog team + Slack workspace.\n\nBoth are optional — when omitted we fall back to the user's ``current_team``\nand that team's first Slack ``Integration`` (mirrors ``github_start`` for\nthe simple case). The frontend passes both explicitly once it has the\nlinkable-workspace list and the user has picked a workspace."
    )

/**
 * Mark the current user as having exited onboarding with a non-delegated reason.
 * Idempotent: the skip timestamp is only set on the first successful call.
 *
 * Callers wanting to delegate setup to a teammate must use the dedicated
 * /organizations/{id}/invites/delegate/ endpoint, which atomically creates the
 * invite and sets reason="delegated". This endpoint rejects that reason so state
 * can't be faked without a real invite.
 */
export const usersOnboardingSkipCreateBodyStepAtSkipMax = 64

export const UsersOnboardingSkipCreateBody = /* @__PURE__ */ zod
    .object({
        reason: zod
            .enum(['later', 'other'])
            .describe('\* `later` - Later\n\* `other` - Other')
            .describe(
                "Why the user is leaving onboarding. 'later' keeps them able to return; 'other' is a catch-all. 'delegated' is rejected here — use the delegate endpoint so the delegation invite is created atomically.\n\n\* `later` - Later\n\* `other` - Other"
            ),
        step_at_skip: zod
            .string()
            .max(usersOnboardingSkipCreateBodyStepAtSkipMax)
            .optional()
            .describe('Onboarding step key the user was on when skipping, for analytics only.'),
    })
    .describe(
        'Request body for POST \/api\/users\/{id}\/onboarding\/skip\/.\n\nSource of truth for OpenAPI \/ generated TS \/ zod \/ MCP — bind this serializer at\nruntime so the contract clients believe is enforced (length cap, choice validation,\nno extra fields) is actually enforced server-side.'
    )

/**
 * Record that this user has seen one product intro.
 *
 * Separate from the `has_seen_product_intro_for` field on the main user PATCH, which requires a
 * recently authenticated session. Dismissing an intro must not depend on that: a re-auth prompt
 * would cover the intro it interrupts, and the dismissal would never persist. Nothing reachable
 * here changes an account, an organization, or a profile.
 *
 * Merging server-side also keeps two intros dismissed from separate tabs from dropping each
 * other's key, which a read-modify-write of the whole map cannot avoid.
 */
export const usersProductIntroSeenPartialUpdateBodyProductKeyMax = 128

export const usersProductIntroSeenPartialUpdateBodySeenDefault = true

export const UsersProductIntroSeenPartialUpdateBody = /* @__PURE__ */ zod
    .object({
        product_key: zod
            .string()
            .max(usersProductIntroSeenPartialUpdateBodyProductKeyMax)
            .optional()
            .describe(
                'Which key in `has_seen_product_intro_for` to set. Any string is accepted: besides the product keys, the map holds keys composed per team and keys for surfaces that are not products.'
            ),
        seen: zod
            .boolean()
            .default(usersProductIntroSeenPartialUpdateBodySeenDefault)
            .describe('Whether the intro counts as seen. Send false to show it again.'),
    })
    .describe('Request body for PATCH \/api\/users\/@me\/product_intro_seen.')

/**
 * Register the device for the authenticated user, removing registrations for the same token belonging to other users on this instance. Re-registration refreshes `platform` and `last_seen_at`.
 * @summary Register a push notification token
 */
export const usersPushTokensCreateBodyTokenMax = 512

export const UsersPushTokensCreateBody = /* @__PURE__ */ zod.object({
    token: zod
        .string()
        .max(usersPushTokensCreateBodyTokenMax)
        .describe("Opaque push token issued by the device's platform push service (e.g. an Expo push token)."),
    platform: zod
        .enum(['ios', 'android', 'web'])
        .describe('\* `ios` - iOS\n\* `android` - Android\n\* `web` - Web')
        .describe(
            'Device platform the token was issued for. One of `ios`, `android`, or `web`.\n\n\* `ios` - iOS\n\* `android` - Android\n\* `web` - Web'
        ),
})

/**
 * Delete the row matching `(user, token)`. Returns 204 even if no row matches so the mobile client can call this unconditionally when the user opts out.
 * @summary Unregister a push notification token
 */
export const usersPushTokensUnregisterCreateBodyTokenMax = 512

export const UsersPushTokensUnregisterCreateBody = /* @__PURE__ */ zod.object({
    token: zod
        .string()
        .max(usersPushTokensUnregisterCreateBodyTokenMax)
        .describe('The opaque push token to remove for the authenticated user.'),
})

export const usersScenePersonalisationCreateBodyFirstNameMax = 150

export const usersScenePersonalisationCreateBodyLastNameMax = 150

export const usersScenePersonalisationCreateBodyEmailMax = 254

export const usersScenePersonalisationCreateBodyPasswordMax = 128

export const UsersScenePersonalisationCreateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersScenePersonalisationCreateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersScenePersonalisationCreateBodyLastNameMax).optional(),
    email: zod.email().max(usersScenePersonalisationCreateBodyEmailMax),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersScenePersonalisationCreateBodyPasswordMax),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

/**
 * Generate new backup codes, invalidating any existing ones
 */
export const usersTwoFactorBackupCodesCreateBodyFirstNameMax = 150

export const usersTwoFactorBackupCodesCreateBodyLastNameMax = 150

export const usersTwoFactorBackupCodesCreateBodyEmailMax = 254

export const usersTwoFactorBackupCodesCreateBodyPasswordMax = 128

export const UsersTwoFactorBackupCodesCreateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersTwoFactorBackupCodesCreateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersTwoFactorBackupCodesCreateBodyLastNameMax).optional(),
    email: zod.email().max(usersTwoFactorBackupCodesCreateBodyEmailMax),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersTwoFactorBackupCodesCreateBodyPasswordMax),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

/**
 * Disable 2FA and remove all related devices
 */
export const usersTwoFactorDisableCreateBodyFirstNameMax = 150

export const usersTwoFactorDisableCreateBodyLastNameMax = 150

export const usersTwoFactorDisableCreateBodyEmailMax = 254

export const usersTwoFactorDisableCreateBodyPasswordMax = 128

export const UsersTwoFactorDisableCreateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersTwoFactorDisableCreateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersTwoFactorDisableCreateBodyLastNameMax).optional(),
    email: zod.email().max(usersTwoFactorDisableCreateBodyEmailMax),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersTwoFactorDisableCreateBodyPasswordMax),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

export const usersTwoFactorValidateCreateBodyFirstNameMax = 150

export const usersTwoFactorValidateCreateBodyLastNameMax = 150

export const usersTwoFactorValidateCreateBodyEmailMax = 254

export const usersTwoFactorValidateCreateBodyPasswordMax = 128

export const UsersTwoFactorValidateCreateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersTwoFactorValidateCreateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersTwoFactorValidateCreateBodyLastNameMax).optional(),
    email: zod.email().max(usersTwoFactorValidateCreateBodyEmailMax),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersTwoFactorValidateCreateBodyPasswordMax),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

export const usersValidate2faCreateBodyFirstNameMax = 150

export const usersValidate2faCreateBodyLastNameMax = 150

export const usersValidate2faCreateBodyEmailMax = 254

export const usersValidate2faCreateBodyPasswordMax = 128

export const UsersValidate2faCreateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersValidate2faCreateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersValidate2faCreateBodyLastNameMax).optional(),
    email: zod.email().max(usersValidate2faCreateBodyEmailMax),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersValidate2faCreateBodyPasswordMax),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

export const usersCancelEmailChangeRequestPartialUpdateBodyFirstNameMax = 150

export const usersCancelEmailChangeRequestPartialUpdateBodyLastNameMax = 150

export const usersCancelEmailChangeRequestPartialUpdateBodyEmailMax = 254

export const usersCancelEmailChangeRequestPartialUpdateBodyPasswordMax = 128

export const UsersCancelEmailChangeRequestPartialUpdateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersCancelEmailChangeRequestPartialUpdateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersCancelEmailChangeRequestPartialUpdateBodyLastNameMax).optional(),
    email: zod.email().max(usersCancelEmailChangeRequestPartialUpdateBodyEmailMax).optional(),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersCancelEmailChangeRequestPartialUpdateBodyPasswordMax).optional(),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

export const usersRequestEmailVerificationCreateBodyFirstNameMax = 150

export const usersRequestEmailVerificationCreateBodyLastNameMax = 150

export const usersRequestEmailVerificationCreateBodyEmailMax = 254

export const usersRequestEmailVerificationCreateBodyPasswordMax = 128

export const UsersRequestEmailVerificationCreateBody = /* @__PURE__ */ zod.object({
    first_name: zod.string().max(usersRequestEmailVerificationCreateBodyFirstNameMax).optional(),
    last_name: zod.string().max(usersRequestEmailVerificationCreateBodyLastNameMax).optional(),
    email: zod.email().max(usersRequestEmailVerificationCreateBodyEmailMax),
    notification_settings: zod
        .record(zod.string(), zod.unknown())
        .optional()
        .describe(
            'Map of notification preferences. Keys include `plugin_disabled`, `all_weekly_report_disabled`, `project_weekly_digest_disabled`, `error_tracking_weekly_digest_project_enabled`, `web_analytics_weekly_digest_project_enabled`, `organization_member_join_email_disabled`, `data_pipeline_error_threshold` (number between 0.0 and 1.0), and other per-topic switches. Values are either booleans, or (for per-project\/per-resource keys) a map of IDs to booleans. Only the keys you send are updated — other preferences stay as-is.'
        ),
    anonymize_data: zod
        .boolean()
        .nullish()
        .describe('Whether PostHog should anonymize events captured for this user when identified.'),
    allow_impersonation: zod.boolean().nullish(),
    toolbar_mode: zod
        .union([
            zod.enum(['disabled', 'toolbar']).describe('\* `disabled` - disabled\n\* `toolbar` - toolbar'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    is_staff: zod.boolean().optional().describe('Designates whether the user can log into this admin site.'),
    set_current_organization: zod.string().optional(),
    set_current_team: zod.string().optional(),
    password: zod.string().max(usersRequestEmailVerificationCreateBodyPasswordMax),
    current_password: zod
        .string()
        .optional()
        .describe(
            "The user's current password. Required when changing `password` if the user already has a usable password set."
        ),
    events_column_config: zod.unknown().optional(),
    has_seen_product_intro_for: zod.unknown().optional(),
    theme_mode: zod
        .union([
            zod
                .enum(['light', 'dark', 'system'])
                .describe('\* `light` - Light\n\* `dark` - Dark\n\* `system` - System'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    hedgehog_config: zod.unknown().optional(),
    allow_sidebar_suggestions: zod.boolean().nullish(),
    shortcut_position: zod
        .union([
            zod
                .enum(['above', 'below', 'hidden'])
                .describe('\* `above` - Above\n\* `below` - Below\n\* `hidden` - Hidden'),
            zod.enum(['']),
            zod.null(),
        ])
        .optional(),
    role_at_organization: zod
        .enum(['engineering', 'data', 'product', 'founder', 'leadership', 'marketing', 'sales', 'student', 'other'])
        .optional()
        .describe(
            '\* `engineering` - Engineering\n\* `data` - Data\n\* `product` - Product Management\n\* `founder` - Founder\n\* `leadership` - Leadership\n\* `marketing` - Marketing\n\* `sales` - Sales \/ Success\n\* `student` - Student\n\* `other` - Other'
        ),
    passkeys_enabled_for_2fa: zod
        .boolean()
        .nullish()
        .describe(
            'Whether passkeys are enabled for 2FA authentication. Users can disable this to use only TOTP for 2FA while keeping passkeys for login.'
        ),
    hide_mcp_hints: zod
        .boolean()
        .optional()
        .describe(
            'When true, the user has opted out of in-app hints promoting the PostHog MCP integration after taking actions.'
        ),
    ui_configuration: zod
        .unknown()
        .optional()
        .describe(
            'Per-user UI customization, validated against the `UserUIConfiguration` schema. Covers SQL editor settings such as Vim mode and the vimrc. Send the complete object: it replaces the stored value wholesale. Null means no customization.'
        ),
})

export const UsersVerifyEmailCreateBody = /* @__PURE__ */ zod
    .object({
        uuid: zod.string().describe('UUID of the user whose email is being verified.'),
        code: zod
            .string()
            .describe(
                'The 6-digit verification code from the email. Whitespace, invisible characters, and grouping hyphens are removed and compatibility digits are folded to ASCII before checking.'
            ),
    })
    .describe('Request body for POST \/api\/users\/verify_email\/.')