Class: Nylas::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/nylas/client.rb

Overview

Methods to retrieve data from the Nylas API as Ruby objects.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, api_uri: Config::DEFAULT_REGION_URL, timeout: nil) ⇒ Client

Initializes a client session.

Parameters:

  • api_key (String, nil)

    API key to use for the client session.

  • api_uri (String) (defaults to: Config::DEFAULT_REGION_URL)

    Client session's host.

  • timeout (Integer, nil) (defaults to: nil)

    Timeout value to use for the client session.



27
28
29
30
31
32
33
# File 'lib/nylas/client.rb', line 27

def initialize(api_key:,
               api_uri: Config::DEFAULT_REGION_URL,
               timeout: nil)
  @api_key = api_key
  @api_uri = api_uri
  @timeout = timeout || 90
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



20
21
22
# File 'lib/nylas/client.rb', line 20

def api_key
  @api_key
end

#api_uriObject (readonly)

Returns the value of attribute api_uri.



20
21
22
# File 'lib/nylas/client.rb', line 20

def api_uri
  @api_uri
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



20
21
22
# File 'lib/nylas/client.rb', line 20

def timeout
  @timeout
end

Instance Method Details

#applicationsNylas::Applications

The application resources for your Nylas application.

Returns:



38
39
40
# File 'lib/nylas/client.rb', line 38

def applications
  Applications.new(self)
end

#attachmentsNylas::Attachments

The attachments resources for your Nylas application.

Returns:



45
46
47
# File 'lib/nylas/client.rb', line 45

def attachments
  Attachments.new(self)
end

#authNylas::Auth

The auth resources for your Nylas application.

Returns:

  • (Nylas::Auth)

    Auth resources for your Nylas application.



52
53
54
# File 'lib/nylas/client.rb', line 52

def auth
  Auth.new(self)
end

#calendarsNylas::Calendars

The calendar resources for your Nylas application.

Returns:



59
60
61
# File 'lib/nylas/client.rb', line 59

def calendars
  Calendars.new(self)
end

#connectorsNylas::Connectors

The connector resources for your Nylas application.

Returns:



66
67
68
# File 'lib/nylas/client.rb', line 66

def connectors
  Connectors.new(self)
end

#contactsNylas::Contacts

The contact resources for your Nylas application.

Returns:



73
74
75
# File 'lib/nylas/client.rb', line 73

def contacts
  Contacts.new(self)
end

#draftsNylas::Drafts

The draft resources for your Nylas application.

Returns:

  • (Nylas::Drafts)

    Draft resources for your Nylas application.



80
81
82
# File 'lib/nylas/client.rb', line 80

def drafts
  Drafts.new(self)
end

#eventsNylas::Events

The event resources for your Nylas application.

Returns:



87
88
89
# File 'lib/nylas/client.rb', line 87

def events
  Events.new(self)
end

#foldersNylas::Folder

The folder resources for your Nylas application.

Returns:

  • (Nylas::Folder)

    Folder resources for your Nylas application



94
95
96
# File 'lib/nylas/client.rb', line 94

def folders
  Folders.new(self)
end

#grantsNylas::Grants

The grants resources for your Nylas application.

Returns:



101
102
103
# File 'lib/nylas/client.rb', line 101

def grants
  Grants.new(self)
end

#messagesNylas::Messages

The message resources for your Nylas application.

Returns:



108
109
110
# File 'lib/nylas/client.rb', line 108

def messages
  Messages.new(self)
end

#schedulerNylas::Scheduler

The Scheduler resources for your Nylas application.

Returns:



128
129
130
# File 'lib/nylas/client.rb', line 128

def scheduler
  Scheduler.new(self)
end

#threadsNylas::Threads

The thread resources for your Nylas application.

Returns:



115
116
117
# File 'lib/nylas/client.rb', line 115

def threads
  Threads.new(self)
end

#webhooksNylas::Webhooks

The webhook resources for your Nylas application.

Returns:



122
123
124
# File 'lib/nylas/client.rb', line 122

def webhooks
  Webhooks.new(self)
end