Class: Pago::V2026_04::Services::EventTypes
- Defined in:
- lib/pago/v2026_04/services/event_types.rb,
sig/pago/v2026_04/generated.rbs
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#list(organization_id: nil, customer_id: nil, external_customer_id: nil, query: nil, root_events: false, parent_id: nil, source: nil, page: 1, limit: 10, sorting: ["-last_seen"]) ⇒ Models::ListResourceEventTypeWithStats
List event types with aggregated statistics.
-
#list_each(organization_id: nil, customer_id: nil, external_customer_id: nil, query: nil, root_events: false, parent_id: nil, source: nil, limit: 10, sorting: ["-last_seen"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of
list, fetching pages on demand. -
#update(id, body: {}) ⇒ Models::EventType
Update an event type's label.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Pago::Service
Instance Method Details
#list(organization_id: nil, customer_id: nil, external_customer_id: nil, query: nil, root_events: false, parent_id: nil, source: nil, page: 1, limit: 10, sorting: ["-last_seen"]) ⇒ Models::ListResourceEventTypeWithStats
List event types with aggregated statistics.
Scopes: events:read events:write
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/pago/v2026_04/services/event_types.rb', line 24 def list(organization_id: nil, customer_id: nil, external_customer_id: nil, query: nil, root_events: false, parent_id: nil, source: nil, page: 1, limit: 10, sorting: ["-last_seen"]) data = client.request( http_method: "GET", path: "/v1/event-types/", path_params: {}, query: { "organization_id" => organization_id, "customer_id" => customer_id, "external_customer_id" => external_customer_id, "query" => query, "root_events" => root_events, "parent_id" => parent_id, "source" => source, "page" => page, "limit" => limit, "sorting" => sorting }, response_type: :json, errors: { 422 => Errors::HTTPValidationError } ) Models::ListResourceEventTypeWithStats.from_json(data) end |
#list_each(organization_id: nil, customer_id: nil, external_customer_id: nil, query: nil, root_events: false, parent_id: nil, source: nil, limit: 10, sorting: ["-last_seen"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of list, fetching pages on demand.
40 41 42 43 44 45 |
# File 'lib/pago/v2026_04/services/event_types.rb', line 40 def list_each(organization_id: nil, customer_id: nil, external_customer_id: nil, query: nil, root_events: false, parent_id: nil, source: nil, limit: 10, sorting: ["-last_seen"], &block) paginator = ::Pago::Paginator.new do |page_number| list(organization_id: organization_id, customer_id: customer_id, external_customer_id: external_customer_id, query: query, root_events: root_events, parent_id: parent_id, source: source, page: page_number, limit: limit, sorting: sorting) end block ? paginator.each(&block) : paginator end |
#update(id, body: {}) ⇒ Models::EventType
Update an event type's label.
Scopes: events:write
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/pago/v2026_04/services/event_types.rb', line 57 def update(id, body: {}) data = client.request( http_method: "PATCH", path: "/v1/event-types/{id}", path_params: { "id" => id }, query: {}, body: body, response_type: :json, errors: { 404 => Errors::Update404Error, 422 => Errors::HTTPValidationError } ) Models::EventType.from_json(data) end |