Class: Seam::Clients::Events

Inherits:
Object
  • Object
show all
Defined in:
lib/seam/routes/clients/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/clients/events.rb', line 6

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

Instance Method Details

#get(device_id: nil, event_id: nil, event_type: nil) ⇒ Object



11
12
13
14
15
# File 'lib/seam/routes/clients/events.rb', line 11

def get(device_id: nil, event_id: nil, event_type: nil)
  res = @client.post("/events/get", {device_id: device_id, event_id: event_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) ⇒ Object



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

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