class Nylas::Connectors

Nylas Connectors API

Attributes

credentials[R]

Access the Credentials API

Public Class Methods

new(sdk_instance) click to toggle source

Initializes Connectors.

Calls superclass method
# File lib/nylas/resources/connectors.rb, line 18
def initialize(sdk_instance)
  super(sdk_instance)

  @credentials = Credentials.new(sdk_instance)
end

Public Instance Methods

create(request_body:) click to toggle source

Create a connector.

@param request_body [Hash] The values to create the connector with. @return [Array(Hash, String)] The created connector and API Request ID.

# File lib/nylas/resources/connectors.rb, line 49
def create(request_body:)
  post(
    path: "#{api_uri}/v3/connectors",
    request_body: request_body
  )
end
destroy(provider:) click to toggle source

Delete a connector.

@param provider [String] The provider associated to the connector to delete. @return [Array(TrueClass, String)] True and the API Request ID for the delete operation.

# File lib/nylas/resources/connectors.rb, line 72
def destroy(provider:)
  _, request_id = delete(
    path: "#{api_uri}/v3/connectors/#{provider}"
  )

  [true, request_id]
end
find(provider:) click to toggle source

Return a connector.

@param provider [String] The provider associated to the connector to retrieve. @return [Array(Hash, String)] The connector and API request ID.

# File lib/nylas/resources/connectors.rb, line 39
def find(provider:)
  get(
    path: "#{api_uri}/v3/connectors/#{provider}"
  )
end
list(query_params: nil) click to toggle source

Return all connectors.

@param query_params [Hash, nil] Query params to pass to the request. @return [Array(Array(Hash), String)] The list of connectors and API Request ID.

# File lib/nylas/resources/connectors.rb, line 28
def list(query_params: nil)
  get(
    path: "#{api_uri}/v3/connectors",
    query_params: query_params
  )
end
update(provider:, request_body:) click to toggle source

Update a connector.

@param provider [String] The provider associated to the connector to update. @param request_body [Hash] The values to update the connector with @return [Array(Hash, String)] The updated connector and API Request ID.

# File lib/nylas/resources/connectors.rb, line 61
def update(provider:, request_body:)
  patch(
    path: "#{api_uri}/v3/connectors/#{provider}",
    request_body: request_body
  )
end