Class: Seam::Clients::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/events.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:, defaults:) ⇒ Events

Returns a new instance of Events.



6
7
8
9
# File 'lib/seam/routes/events.rb', line 6

def initialize(client:, defaults:)
  @client = client
  @defaults = defaults
end

Instance Method Details

#get(event_id: nil, device_id: nil, event_type: nil) ⇒ Seam::Resources::SeamEvent

Returns a specified event. This endpoint returns the same event that would be sent to a webhook, but it enables you to retrieve an event that already took place.

Parameters:

  • event_id (defaults to: nil)

    Unique identifier for the event that you want to get.

  • device_id (defaults to: nil)

    Unique identifier for the device that triggered the event that you want to get.

  • event_type (defaults to: nil)

    Type of the event that you want to get.

Returns:



16
17
18
19
20
# File 'lib/seam/routes/events.rb', line 16

def get(event_id: nil, device_id: nil, event_type: nil)
  res = @client.post("/events/get", {event_id: event_id, device_id: device_id, event_type: event_type}.compact)

  Seam::Resources::SeamEvent.load_from_response(res.body["event"])
end

#list(access_code_id: nil, access_code_ids: nil, access_grant_id: nil, access_grant_ids: nil, access_method_id: nil, access_method_ids: nil, acs_access_group_id: nil, acs_credential_id: nil, acs_encoder_id: nil, acs_entrance_id: nil, acs_system_id: nil, acs_system_ids: nil, acs_user_id: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, space_id: nil, space_ids: nil, unstable_offset: nil, user_identity_id: nil) ⇒ Seam::Resources::SeamEvent

Returns a list of all events. This endpoint returns the same events that would be sent to a webhook, but it enables you to filter or see events that already took place.

Parameters:

  • access_code_id (defaults to: nil)

    ID of the access code for which you want to list events.

  • access_code_ids (defaults to: nil)

    IDs of the access codes for which you want to list events.

  • access_grant_id (defaults to: nil)

    ID of the access grant for which you want to list events.

  • access_grant_ids (defaults to: nil)

    IDs of the access grants for which you want to list events.

  • access_method_id (defaults to: nil)

    ID of the access method for which you want to list events.

  • access_method_ids (defaults to: nil)

    IDs of the access methods for which you want to list events.

  • acs_access_group_id (defaults to: nil)

    ID of the ACS access group for which you want to list events.

  • acs_credential_id (defaults to: nil)

    ID of the ACS credential for which you want to list events.

  • acs_encoder_id (defaults to: nil)

    ID of the ACS encoder for which you want to list events.

  • acs_entrance_id (defaults to: nil)

    ID of the ACS entrance for which you want to list events.

  • acs_system_id (defaults to: nil)

    ID of the access system for which you want to list events.

  • acs_system_ids (defaults to: nil)

    IDs of the access systems for which you want to list events.

  • acs_user_id (defaults to: nil)

    ID of the ACS user for which you want to list events.

  • between (defaults to: nil)

    Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include since or between.

  • connect_webview_id (defaults to: nil)

    ID of the Connect Webview for which you want to list events.

  • connected_account_id (defaults to: nil)

    ID of the connected account for which you want to list events.

  • customer_key (defaults to: nil)

    Customer key for which you want to list events.

  • device_id (defaults to: nil)

    ID of the device for which you want to list events.

  • device_ids (defaults to: nil)

    IDs of the devices for which you want to list events.

  • event_ids (defaults to: nil)

    IDs of the events that you want to list.

  • event_type (defaults to: nil)

    Type of the events that you want to list.

  • event_types (defaults to: nil)

    Types of the events that you want to list.

  • limit (defaults to: nil)

    Numerical limit on the number of events to return.

  • since (defaults to: nil)

    Timestamp to indicate the beginning generation time for the events that you want to list. You must include since or between.

  • space_id (defaults to: nil)

    ID of the space for which you want to list events.

  • space_ids (defaults to: nil)

    IDs of the spaces for which you want to list events.

  • unstable_offset (defaults to: nil)

    Offset for the events that you want to list.

  • user_identity_id (defaults to: nil)

    ID of the user identity for which you want to list events.

Returns:



52
53
54
55
56
# File 'lib/seam/routes/events.rb', line 52

def list(access_code_id: nil, access_code_ids: nil, access_grant_id: nil, access_grant_ids: nil, access_method_id: nil, access_method_ids: nil, acs_access_group_id: nil, acs_credential_id: nil, acs_encoder_id: nil, acs_entrance_id: nil, acs_system_id: nil, acs_system_ids: nil, acs_user_id: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, space_id: nil, space_ids: nil, unstable_offset: nil, user_identity_id: nil)
  res = @client.post("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_ids: access_grant_ids, access_method_id: access_method_id, access_method_ids: access_method_ids, acs_access_group_id: acs_access_group_id, acs_credential_id: acs_credential_id, acs_encoder_id: acs_encoder_id, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_user_id: acs_user_id, between: between, connect_webview_id: connect_webview_id, connected_account_id: , customer_key: customer_key, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, space_id: space_id, space_ids: space_ids, unstable_offset: unstable_offset, user_identity_id: user_identity_id}.compact)

  Seam::Resources::SeamEvent.load_from_response(res.body["events"])
end