Skip to content

Latest commit

 

History

History
105 lines (70 loc) · 12 KB

File metadata and controls

105 lines (70 loc) · 12 KB

EventTypes

(event_types)

Overview

Available Operations

  • list - List Event Types
  • update - Update Event Type

list

List event types with aggregated statistics.

Scopes: events:read events:write

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.event_types.list(organization_id="1dbfc517-0bbf-4301-9ba8-555ca42b9737", root_events=False, page=1, limit=10)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description
organization_id OptionalNullable[models.EventTypesListQueryParamOrganizationIDFilter] Filter by organization ID.
customer_id OptionalNullable[models.EventTypesListQueryParamCustomerIDFilter] Filter by customer ID.
external_customer_id OptionalNullable[models.EventTypesListQueryParamExternalCustomerIDFilter] Filter by external customer ID.
query OptionalNullable[str] Query to filter event types by name or label.
root_events Optional[bool] When true, only return event types with root events (parent_id IS NULL).
parent_id OptionalNullable[str] Filter by specific parent event ID.
source OptionalNullable[models.EventSource] Filter by event source (system or user).
page Optional[int] Page number, defaults to 1.
limit Optional[int] Size of a page, defaults to 10. Maximum is 100.
sorting List[models.EventTypesSortProperty] Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.EventTypesListResponse

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

update

Update an event type's label.

Example Usage

from polar_sdk import Polar


with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.event_types.update(id="<value>", event_type_update={
        "label": "<value>",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The event type ID.
event_type_update models.EventTypeUpdate ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.EventType

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*