Class: Appwrite::Activities
- Defined in:
- lib/appwrite/services/activities.rb
Instance Method Summary collapse
-
#get_event(event_id:) ⇒ ActivityEvent
Get event by ID.
-
#initialize(client) ⇒ Activities
constructor
A new instance of Activities.
-
#list_events(queries: nil, total: nil) ⇒ ActivityEventList
List all events for selected filters.
Constructor Details
#initialize(client) ⇒ Activities
Returns a new instance of Activities.
5 6 7 |
# File 'lib/appwrite/services/activities.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#get_event(event_id:) ⇒ ActivityEvent
Get event by ID.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/appwrite/services/activities.rb', line 46 def get_event( event_id: ) if event_id.nil? || event_id == '' raise Appwrite::Exception.new('Missing required parameter: "eventId"') end api_path = '/activities/events/{eventId}' .gsub('{eventId}', @client.encode_path(event_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::ActivityEvent ) end |
#list_events(queries: nil, total: nil) ⇒ ActivityEventList
List all events for selected filters.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/appwrite/services/activities.rb', line 15 def list_events( queries: nil, total: nil ) api_path = '/activities/events' api_params = { queries: queries, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::ActivityEventList ) end |