Class: Nylas::Sessions

Inherits:
Resource show all
Includes:
ApiOperations::Delete, ApiOperations::Post
Defined in:
lib/nylas/resources/sessions.rb

Overview

Nylas Messages API

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Nylas::Resource

Instance Method Details

#create(request_body:) ⇒ Array(Hash, String)

Create a session for a configuration.

Parameters:

  • request_body (Hash)

    The values to create a configuration sessions.

Returns:

  • (Array(Hash, String))

    The created configuration and API Request ID.



15
16
17
18
19
20
# File 'lib/nylas/resources/sessions.rb', line 15

def create(request_body:)
  post(
    path: "#{api_uri}/v3/scheduling/sessions",
    request_body: request_body
  )
end

#destroy(session_id:) ⇒ Array(TrueClass, String)

Delete a session for a configuration.

Parameters:

  • session_id (String)

    The id of the session to delete.

Returns:

  • (Array(TrueClass, String))

    True and the API Request ID for the delete operation.



25
26
27
28
29
30
31
# File 'lib/nylas/resources/sessions.rb', line 25

def destroy(session_id:)
  _, request_id = delete(
    path: "#{api_uri}/v3/scheduling/sessions/#{session_id}"
  )

  [true, request_id]
end