Class: Nylas::Calendars
- Includes:
- ApiOperations::Delete, ApiOperations::Get, ApiOperations::Post, ApiOperations::Put
- Defined in:
- lib/nylas/resources/calendars.rb
Overview
Nylas Calendar API
Instance Method Summary collapse
-
#create(identifier:, request_body:) ⇒ Array(Hash, String)
Create a calendar.
-
#destroy(identifier:, calendar_id:) ⇒ Array(TrueClass, String)
Delete a calendar.
-
#find(identifier:, calendar_id:) ⇒ Array(Hash, String)
Return a calendar.
-
#get_availability(request_body:) ⇒ Array(Hash, String)
Checks multiple calendars to find available time slots for a single meeting.
-
#get_free_busy(identifier:, request_body:) ⇒ Array(Array(Hash), String)
Get the free/busy schedule for a list of email addresses.
-
#list(identifier:, query_params: nil) ⇒ Array(Array(Hash), String)
Return all calendars.
-
#update(identifier:, calendar_id:, request_body:) ⇒ Array(Hash, String)
Update a calendar.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Nylas::Resource
Instance Method Details
#create(identifier:, request_body:) ⇒ Array(Hash, String)
Create a calendar.
43 44 45 46 47 48 |
# File 'lib/nylas/resources/calendars.rb', line 43 def create(identifier:, request_body:) post( path: "#{api_uri}/v3/grants/#{identifier}/calendars", request_body: request_body ) end |
#destroy(identifier:, calendar_id:) ⇒ Array(TrueClass, String)
Delete a calendar.
70 71 72 73 74 75 76 |
# File 'lib/nylas/resources/calendars.rb', line 70 def destroy(identifier:, calendar_id:) _, request_id = delete( path: "#{api_uri}/v3/grants/#{identifier}/calendars/#{calendar_id}" ) [true, request_id] end |
#find(identifier:, calendar_id:) ⇒ Array(Hash, String)
Return a calendar.
32 33 34 35 36 |
# File 'lib/nylas/resources/calendars.rb', line 32 def find(identifier:, calendar_id:) get( path: "#{api_uri}/v3/grants/#{identifier}/calendars/#{calendar_id}" ) end |
#get_availability(request_body:) ⇒ Array(Hash, String)
Checks multiple calendars to find available time slots for a single meeting.
82 83 84 85 86 87 |
# File 'lib/nylas/resources/calendars.rb', line 82 def get_availability(request_body:) post( path: "#{api_uri}/v3/calendars/availability", request_body: request_body ) end |
#get_free_busy(identifier:, request_body:) ⇒ Array(Array(Hash), String)
Get the free/busy schedule for a list of email addresses.
94 95 96 97 98 99 |
# File 'lib/nylas/resources/calendars.rb', line 94 def get_free_busy(identifier:, request_body:) post( path: "#{api_uri}/v3/grants/#{identifier}/calendars/availability", request_body: request_body ) end |
#list(identifier:, query_params: nil) ⇒ Array(Array(Hash), String)
Return all calendars.
19 20 21 22 23 24 |
# File 'lib/nylas/resources/calendars.rb', line 19 def list(identifier:, query_params: nil) get( path: "#{api_uri}/v3/grants/#{identifier}/calendars", query_params: query_params ) end |
#update(identifier:, calendar_id:, request_body:) ⇒ Array(Hash, String)
Update a calendar.
57 58 59 60 61 62 |
# File 'lib/nylas/resources/calendars.rb', line 57 def update(identifier:, calendar_id:, request_body:) put( path: "#{api_uri}/v3/grants/#{identifier}/calendars/#{calendar_id}", request_body: request_body ) end |