Class: Nylas::Events
- Includes:
- ApiOperations::Delete, ApiOperations::Get, ApiOperations::Post, ApiOperations::Put
- Defined in:
- lib/nylas/resources/events.rb
Overview
Nylas Events API
Instance Method Summary collapse
-
#batch(identifier:, request_body:, query_params:) ⇒ Array(Array<Hash>, String, Hash)
Create, update, or delete events in one request (Google and Microsoft).
-
#create(identifier:, request_body:, query_params:) ⇒ Array(Hash, String)
Create an event.
-
#destroy(identifier:, event_id:, query_params:) ⇒ Array(TrueClass, String)
Delete an event.
-
#find(identifier:, event_id:, query_params:) ⇒ Array(Hash, String)
Return an event.
-
#list(identifier:, query_params:) ⇒ Array(Array(Hash), String, String)
Return all events.
-
#list_import_events(identifier:, query_params:) ⇒ (Array(Hash), String, String)
Returns a list of recurring events, recurring event exceptions, and single events from the specified calendar within a given time frame.
-
#send_rsvp(identifier:, event_id:, request_body:, query_params:) ⇒ (Hash, String)
Send RSVP.
-
#update(identifier:, event_id:, request_body:, query_params:) ⇒ Array(Hash, String)
Update an event.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Nylas::Resource
Instance Method Details
#batch(identifier:, request_body:, query_params:) ⇒ Array(Array<Hash>, String, Hash)
Create, update, or delete events in one request (Google and Microsoft).
Results follow the operation order. Both 200 and 207 responses return normally; inspect each result's status and error, even when every operation failed. The API validates the operations and batch size. No operations are retried automatically.
80 81 82 83 84 85 86 87 |
# File 'lib/nylas/resources/events.rb', line 80 def batch(identifier:, request_body:, query_params:) encoded_identifier = URI.encode_www_form_component(identifier).gsub("+", "%20") post( path: "#{api_uri}/v3/grants/#{encoded_identifier}/events/batch", query_params: query_params, request_body: request_body ) end |
#create(identifier:, request_body:, query_params:) ⇒ Array(Hash, String)
Create an event.
47 48 49 50 51 52 53 |
# File 'lib/nylas/resources/events.rb', line 47 def create(identifier:, request_body:, query_params:) post( path: "#{api_uri}/v3/grants/#{identifier}/events", query_params: query_params, request_body: request_body ) end |
#destroy(identifier:, event_id:, query_params:) ⇒ Array(TrueClass, String)
Delete an event.
111 112 113 114 115 116 117 118 |
# File 'lib/nylas/resources/events.rb', line 111 def destroy(identifier:, event_id:, query_params:) _, request_id = delete( path: "#{api_uri}/v3/grants/#{identifier}/events/#{event_id}", query_params: query_params ) [true, request_id] end |
#find(identifier:, event_id:, query_params:) ⇒ Array(Hash, String)
Return an event.
33 34 35 36 37 38 |
# File 'lib/nylas/resources/events.rb', line 33 def find(identifier:, event_id:, query_params:) get( path: "#{api_uri}/v3/grants/#{identifier}/events/#{event_id}", query_params: query_params ) end |
#list(identifier:, query_params:) ⇒ Array(Array(Hash), String, String)
Return all events.
20 21 22 23 24 25 |
# File 'lib/nylas/resources/events.rb', line 20 def list(identifier:, query_params:) get_list( path: "#{api_uri}/v3/grants/#{identifier}/events", query_params: query_params ) end |
#list_import_events(identifier:, query_params:) ⇒ (Array(Hash), String, String)
Returns a list of recurring events, recurring event exceptions, and single events from the specified calendar within a given time frame. This is useful when you want to import, store, and synchronize events from the time frame to your application
142 143 144 145 146 147 |
# File 'lib/nylas/resources/events.rb', line 142 def list_import_events(identifier:, query_params:) get_list( path: "#{api_uri}/v3/grants/#{identifier}/events/import", query_params: query_params ) end |
#send_rsvp(identifier:, event_id:, request_body:, query_params:) ⇒ (Hash, String)
Send RSVP. Allows users to respond to events they have been added to as an attendee.
127 128 129 130 131 132 133 |
# File 'lib/nylas/resources/events.rb', line 127 def send_rsvp(identifier:, event_id:, request_body:, query_params:) post( path: "#{api_uri}/v3/grants/#{identifier}/events/#{event_id}/send-rsvp", query_params: query_params, request_body: request_body ) end |
#update(identifier:, event_id:, request_body:, query_params:) ⇒ Array(Hash, String)
Update an event.
97 98 99 100 101 102 103 |
# File 'lib/nylas/resources/events.rb', line 97 def update(identifier:, event_id:, request_body:, query_params:) put( path: "#{api_uri}/v3/grants/#{identifier}/events/#{event_id}", query_params: query_params, request_body: request_body ) end |