Class: Nylas::Connectors
- Includes:
- ApiOperations::Delete, ApiOperations::Get, ApiOperations::Post, ApiOperations::Put
- Defined in:
- lib/nylas/resources/connectors.rb
Overview
Nylas Connectors API
Instance Attribute Summary collapse
-
#credentials ⇒ Object
readonly
Access the Credentials API.
Instance Method Summary collapse
-
#create(request_body:) ⇒ Array(Hash, String)
Create a connector.
-
#destroy(provider:) ⇒ Array(TrueClass, String)
Delete a connector.
-
#find(provider:) ⇒ Array(Hash, String)
Return a connector.
-
#initialize(sdk_instance) ⇒ Connectors
constructor
Initializes Connectors.
-
#list(query_params: nil) ⇒ Array(Array(Hash), String)
Return all connectors.
-
#update(provider:, request_body:) ⇒ Array(Hash, String)
Update a connector.
Constructor Details
#initialize(sdk_instance) ⇒ Connectors
Initializes Connectors.
18 19 20 21 22 |
# File 'lib/nylas/resources/connectors.rb', line 18 def initialize(sdk_instance) super(sdk_instance) @credentials = Credentials.new(sdk_instance) end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Access the Credentials API
15 16 17 |
# File 'lib/nylas/resources/connectors.rb', line 15 def credentials @credentials end |
Instance Method Details
#create(request_body:) ⇒ Array(Hash, String)
Create a connector.
49 50 51 52 53 54 |
# 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:) ⇒ Array(TrueClass, String)
Delete a connector.
72 73 74 75 76 77 78 |
# 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:) ⇒ Array(Hash, String)
Return a connector.
39 40 41 42 43 |
# File 'lib/nylas/resources/connectors.rb', line 39 def find(provider:) get( path: "#{api_uri}/v3/connectors/#{provider}" ) end |
#list(query_params: nil) ⇒ Array(Array(Hash), String)
Return all connectors.
28 29 30 31 32 33 |
# 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:) ⇒ Array(Hash, String)
Update a connector.
61 62 63 64 65 66 |
# File 'lib/nylas/resources/connectors.rb', line 61 def update(provider:, request_body:) put( path: "#{api_uri}/v3/connectors/#{provider}", request_body: request_body ) end |