OrganizationSpending

Manages organization and project hard spend limits and notification alerts using an Admin API key. Default operations throw UnsupportedOperationException so custom clients can omit this capability.

Inheritors

Functions

Link copied to clipboard
open suspend fun createOrganizationSpendAlert(request: SpendAlertRequest, requestOptions: RequestOptions? = null): SpendAlert

Creates an organization-level spend notification alert.

Link copied to clipboard
open suspend fun createProjectSpendAlert(projectId: String, request: SpendAlertRequest, requestOptions: RequestOptions? = null): SpendAlert

Creates a spend notification alert for a project.

Link copied to clipboard
open suspend fun deleteOrganizationSpendAlert(alertId: String, requestOptions: RequestOptions? = null): SpendAlertDeleted

Deletes an organization-level alert and returns its ID and service confirmation.

Link copied to clipboard
open suspend fun deleteOrganizationSpendLimit(requestOptions: RequestOptions? = null): SpendLimitDeleted

Deletes the organization's hard spend limit and returns the service confirmation.

Link copied to clipboard
open suspend fun deleteProjectSpendAlert(projectId: String, alertId: String, requestOptions: RequestOptions? = null): SpendAlertDeleted

Deletes a project's alert and returns its ID and service confirmation.

Link copied to clipboard
open suspend fun deleteProjectSpendLimit(projectId: String, requestOptions: RequestOptions? = null): SpendLimitDeleted

Deletes a project's hard spend limit and returns the service confirmation.

Link copied to clipboard
open suspend fun organizationSpendAlert(alertId: String, requestOptions: RequestOptions? = null): SpendAlert

Retrieves one organization-level spend alert.

Link copied to clipboard
open suspend fun organizationSpendAlerts(after: String? = null, before: String? = null, limit: Int? = null, order: SortOrder? = null, requestOptions: RequestOptions? = null): SpendAlertPage

Lists organization alerts with forward or backward cursors and optional sort order.

Link copied to clipboard
open suspend fun organizationSpendLimit(requestOptions: RequestOptions? = null): SpendLimit

Retrieves the organization's hard spend limit and enforcement state.

Link copied to clipboard
open suspend fun projectSpendAlert(projectId: String, alertId: String, requestOptions: RequestOptions? = null): SpendAlert

Retrieves one project's spend alert.

Link copied to clipboard
open suspend fun projectSpendAlerts(projectId: String, after: String? = null, before: String? = null, limit: Int? = null, order: SortOrder? = null, requestOptions: RequestOptions? = null): SpendAlertPage

Lists project alerts with forward or backward cursors and optional sort order.

Link copied to clipboard
open suspend fun projectSpendLimit(projectId: String, requestOptions: RequestOptions? = null): SpendLimit

Retrieves a project's hard spend limit and enforcement state.

Link copied to clipboard
open suspend fun updateOrganizationSpendAlert(alertId: String, request: SpendAlertRequest, requestOptions: RequestOptions? = null): SpendAlert

Replaces an organization's alert configuration, including its complete notification channel.

Link copied to clipboard
open suspend fun updateOrganizationSpendLimit(request: SpendLimitRequest, requestOptions: RequestOptions? = null): SpendLimit

Creates or completely replaces the organization's hard spend limit. Amounts are in cents.

Link copied to clipboard
open suspend fun updateProjectSpendAlert(projectId: String, alertId: String, request: SpendAlertRequest, requestOptions: RequestOptions? = null): SpendAlert

Replaces a project's alert configuration, including its complete notification channel.

Link copied to clipboard
open suspend fun updateProjectSpendLimit(projectId: String, request: SpendLimitRequest, requestOptions: RequestOptions? = null): SpendLimit

Creates or completely replaces a project's hard spend limit. Amounts are in cents.