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 (String, nil) (defaults to: nil)

    Timeout value to use for the client session.



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

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

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



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

def api_key
  @api_key
end

#api_uriObject (readonly)

Returns the value of attribute api_uri.



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

def api_uri
  @api_uri
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



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

def timeout
  @timeout
end

Instance Method Details

#applicationsNylas::Applications

The application resources for your Nylas application.

Returns:



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

def applications
  Applications.new(self)
end

#authNylas::Auth

The auth resources for your Nylas application.

Returns:

  • (Nylas::Auth)

    Auth resources for your Nylas application.



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

def auth
  Auth.new(self)
end

#calendarsNylas::Calendars

The calendar resources for your Nylas application.

Returns:



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

def calendars
  Calendars.new(self)
end

#connectorsNylas::Connectors

The connector resources for your Nylas application.

Returns:



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

def connectors
  Connectors.new(self)
end

#eventsNylas::Events

The event resources for your Nylas application.

Returns:



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

def events
  Events.new(self)
end

#messagesNylas::Messages

The event resources for your Nylas application.

Returns:



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

def messages
  Messages.new(self)
end

#webhooksNylas::Webhooks

The webhook resources for your Nylas application.

Returns:



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

def webhooks
  Webhooks.new(self)
end