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.



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

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.



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

def api_key
  @api_key
end

#api_uriObject (readonly)

Returns the value of attribute api_uri.



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

def api_uri
  @api_uri
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



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

def timeout
  @timeout
end

Instance Method Details

#applicationsNylas::Applications

The application resources for your Nylas application.

Returns:



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

def applications
  Applications.new(self)
end

#attachmentsNylas::Attachments

The attachments resources for your Nylas application.

Returns:



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

def attachments
  Attachments.new(self)
end

#authNylas::Auth

The auth resources for your Nylas application.

Returns:

  • (Nylas::Auth)

    Auth resources for your Nylas application.



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

def auth
  Auth.new(self)
end

#availabilityNylas::Scheduling::Availability

The availability resources for your Nylas application.

Returns:

  • (Nylas::Scheduling::Availability)

    Scheduling availability resources for your Nylas application.



150
151
152
# File 'lib/nylas/client.rb', line 150

def availability
  Availability.new(self)
end

#bookingsNylas::Scheduling::Bookings

The Booking resources for your Nylas application.

Returns:

  • (Nylas::Scheduling::Bookings)

    Scheduling booking resources for your Nylas application.



136
137
138
# File 'lib/nylas/client.rb', line 136

def bookings
  Bookings.new(self)
end

#calendarsNylas::Calendars

The calendar resources for your Nylas application.

Returns:



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

def calendars
  Calendars.new(self)
end

#configurationsNylas::Scheduling::Confiugrations

The configuration resources for your Nylas application.

for your Nylas application.

Returns:

  • (Nylas::Scheduling::Confiugrations)

    Scheduling configuration resources



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

def configurations
  Configurations.new(self)
end

#connectorsNylas::Connectors

The connector resources for your Nylas application.

Returns:



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

def connectors
  Connectors.new(self)
end

#contactsNylas::Contacts

The contact resources for your Nylas application.

Returns:



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

def contacts
  Contacts.new(self)
end

#draftsNylas::Drafts

The draft resources for your Nylas application.

Returns:

  • (Nylas::Drafts)

    Draft resources for your Nylas application.



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

def drafts
  Drafts.new(self)
end

#eventsNylas::Events

The event resources for your Nylas application.

Returns:



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

def events
  Events.new(self)
end

#foldersNylas::Folder

The folder resources for your Nylas application.

Returns:

  • (Nylas::Folder)

    Folder resources for your Nylas application



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

def folders
  Folders.new(self)
end

#grantsNylas::Grants

The grants resources for your Nylas application.

Returns:



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

def grants
  Grants.new(self)
end

#messagesNylas::Messages

The message resources for your Nylas application.

Returns:



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

def messages
  Messages.new(self)
end

#sessionsNylas::Scheduling::Sessions

The Session resources for your Nylas application.

Returns:

  • (Nylas::Scheduling::Sessions)

    Scheduling session resources for your Nylas application.



143
144
145
# File 'lib/nylas/client.rb', line 143

def sessions
  Sessions.new(self)
end

#threadsNylas::Threads

The thread resources for your Nylas application.

Returns:



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

def threads
  Threads.new(self)
end

#webhooksNylas::Webhooks

The webhook resources for your Nylas application.

Returns:



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

def webhooks
  Webhooks.new(self)
end