Class: Nylas::Scheduler
- Inherits:
-
Object
- Object
- Nylas::Scheduler
- Includes:
- Model
- Defined in:
- lib/nylas/scheduler.rb
Overview
Ruby representation of a the Nylas Scheduler API
Instance Attribute Summary
Attributes included from Model
Instance Method Summary collapse
Methods included from Model
#auth_method, #create, #destroy, #execute, included, #model_class, #persisted?, #reload, #resource_path, #resources_path, #save, #save_all_attributes, #to_json, #update, #update_all_attributes
Instance Method Details
#get_available_calendars ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/nylas/scheduler.rb', line 28 def get_available_calendars raise ArgumentError, "Cannot get calendars for a page without an ID." if id.nil? api.execute( method: :get, path: "/manage/pages/#{id}/calendars" ) end |
#upload_image(content_type:, object_name:) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/nylas/scheduler.rb', line 37 def upload_image(content_type:, object_name:) raise ArgumentError, "Cannot upload an image to a page without an ID." if id.nil? payload = { contentType: content_type, objectName: object_name } api.execute( method: :put, path: "/manage/pages/#{id}/upload-image", payload: JSON.dump(payload) ) end |