Class: Nylas::Credentials
- Includes:
- ApiOperations::Delete, ApiOperations::Get, ApiOperations::Patch, ApiOperations::Post
- Defined in:
- lib/nylas/resources/credentials.rb
Overview
Nylas Connectors API
Instance Method Summary collapse
-
#create(provider:, request_body:) ⇒ Array(Hash, String)
Create a connector.
-
#destroy(provider:, credential_id:) ⇒ Array(TrueClass, String)
Delete a connector.
-
#find(provider:, credential_id:) ⇒ Array(Hash, String)
Return a connector.
-
#list(provider:, query_params: nil) ⇒ Array(Array(Hash), String)
Return all credentials.
-
#update(provider:, credential_id:, request_body:) ⇒ Array(Hash, String)
Update a connector.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Nylas::Resource
Instance Method Details
#create(provider:, request_body:) ⇒ Array(Hash, String)
Create a connector.
42 43 44 45 46 47 |
# File 'lib/nylas/resources/credentials.rb', line 42 def create(provider:, request_body:) post( path: "#{api_uri}/v3/connectors/#{provider}/creds", request_body: request_body ) end |
#destroy(provider:, credential_id:) ⇒ Array(TrueClass, String)
Delete a connector.
67 68 69 70 71 72 73 |
# File 'lib/nylas/resources/credentials.rb', line 67 def destroy(provider:, credential_id:) _, request_id = delete( path: "#{api_uri}/v3/connectors/#{provider}/creds/#{credential_id}" ) [true, request_id] end |
#find(provider:, credential_id:) ⇒ Array(Hash, String)
Return a connector.
31 32 33 34 35 |
# File 'lib/nylas/resources/credentials.rb', line 31 def find(provider:, credential_id:) get( path: "#{api_uri}/v3/connectors/#{provider}/creds/#{credential_id}" ) end |
#list(provider:, query_params: nil) ⇒ Array(Array(Hash), String)
Return all credentials.
19 20 21 22 23 24 |
# File 'lib/nylas/resources/credentials.rb', line 19 def list(provider:, query_params: nil) get( path: "#{api_uri}/v3/connectors/#{provider}/creds", query_params: query_params ) end |
#update(provider:, credential_id:, request_body:) ⇒ Array(Hash, String)
Update a connector.
55 56 57 58 59 60 |
# File 'lib/nylas/resources/credentials.rb', line 55 def update(provider:, credential_id:, request_body:) patch( path: "#{api_uri}/v3/connectors/#{provider}/creds/#{credential_id}", request_body: request_body ) end |