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.



22
23
24
25
26
27
28
# File 'lib/nylas/client.rb', line 22

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.



15
16
17
# File 'lib/nylas/client.rb', line 15

def api_key
  @api_key
end

#api_uriObject (readonly)

Returns the value of attribute api_uri.



15
16
17
# File 'lib/nylas/client.rb', line 15

def api_uri
  @api_uri
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



15
16
17
# File 'lib/nylas/client.rb', line 15

def timeout
  @timeout
end

Instance Method Details

#applicationsNylas::Applications

The application resources for your Nylas application.

Returns:



33
34
35
# File 'lib/nylas/client.rb', line 33

def applications
  Applications.new(self)
end

#attachmentsNylas::Attachments

The attachments resources for your Nylas application.

Returns:



40
41
42
# File 'lib/nylas/client.rb', line 40

def attachments
  Attachments.new(self)
end

#authNylas::Auth

The auth resources for your Nylas application.

Returns:

  • (Nylas::Auth)

    Auth resources for your Nylas application.



47
48
49
# File 'lib/nylas/client.rb', line 47

def auth
  Auth.new(self)
end

#calendarsNylas::Calendars

The calendar resources for your Nylas application.

Returns:



54
55
56
# File 'lib/nylas/client.rb', line 54

def calendars
  Calendars.new(self)
end

#connectorsNylas::Connectors

The connector resources for your Nylas application.

Returns:



61
62
63
# File 'lib/nylas/client.rb', line 61

def connectors
  Connectors.new(self)
end

#contactsNylas::Contacts

The contact resources for your Nylas application.

Returns:



68
69
70
# File 'lib/nylas/client.rb', line 68

def contacts
  Contacts.new(self)
end

#draftsNylas::Drafts

The draft resources for your Nylas application.

Returns:

  • (Nylas::Drafts)

    Draft resources for your Nylas application.



75
76
77
# File 'lib/nylas/client.rb', line 75

def drafts
  Drafts.new(self)
end

#eventsNylas::Events

The event resources for your Nylas application.

Returns:



82
83
84
# File 'lib/nylas/client.rb', line 82

def events
  Events.new(self)
end

#foldersNylas::Folder

The folder resources for your Nylas application.

Returns:

  • (Nylas::Folder)

    Folder resources for your Nylas application



89
90
91
# File 'lib/nylas/client.rb', line 89

def folders
  Folders.new(self)
end

#grantsNylas::Grants

The grants resources for your Nylas application.

Returns:



96
97
98
# File 'lib/nylas/client.rb', line 96

def grants
  Grants.new(self)
end

#messagesNylas::Messages

The message resources for your Nylas application.

Returns:



103
104
105
# File 'lib/nylas/client.rb', line 103

def messages
  Messages.new(self)
end

#threadsNylas::Threads

The thread resources for your Nylas application.

Returns:



110
111
112
# File 'lib/nylas/client.rb', line 110

def threads
  Threads.new(self)
end

#webhooksNylas::Webhooks

The webhook resources for your Nylas application.

Returns:



117
118
119
# File 'lib/nylas/client.rb', line 117

def webhooks
  Webhooks.new(self)
end