Class: Nylas::Connectors
- Includes:
- ApiOperations::Delete, ApiOperations::Get, ApiOperations::Patch, 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.
19 20 21 22 23 |
# File 'lib/nylas/resources/connectors.rb', line 19 def initialize(sdk_instance) super(sdk_instance) @credentials = Credentials.new(sdk_instance) end |
Instance Attribute Details
#credentials ⇒ Object (readonly)
Access the Credentials API
16 17 18 |
# File 'lib/nylas/resources/connectors.rb', line 16 def credentials @credentials end |
Instance Method Details
#create(request_body:) ⇒ Array(Hash, String)
Create a connector.
50 51 52 53 54 55 |
# File 'lib/nylas/resources/connectors.rb', line 50 def create(request_body:) post( path: "#{api_uri}/v3/connectors", request_body: request_body ) end |
#destroy(provider:) ⇒ Array(TrueClass, String)
Delete a connector.
73 74 75 76 77 78 79 |
# File 'lib/nylas/resources/connectors.rb', line 73 def destroy(provider:) _, request_id = delete( path: "#{api_uri}/v3/connectors/#{provider}" ) [true, request_id] end |
#find(provider:) ⇒ Array(Hash, String)
Return a connector.
40 41 42 43 44 |
# File 'lib/nylas/resources/connectors.rb', line 40 def find(provider:) get( path: "#{api_uri}/v3/connectors/#{provider}" ) end |
#list(query_params: nil) ⇒ Array(Array(Hash), String)
Return all connectors.
29 30 31 32 33 34 |
# File 'lib/nylas/resources/connectors.rb', line 29 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.
62 63 64 65 66 67 |
# File 'lib/nylas/resources/connectors.rb', line 62 def update(provider:, request_body:) patch( path: "#{api_uri}/v3/connectors/#{provider}", request_body: request_body ) end |