Class: Mailfloss::Resources::Connections
- Defined in:
- lib/mailfloss/resources.rb,
sig/resources.rbs
Overview
/integrations/type/connections/*
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(type, credentials:, name: nil, idempotency_key: nil) ⇒ Hash
POST /integrations/type/connections — connect an ESP account.
-
#delete(type, id) ⇒ Hash
DELETE /integrations/type/connections/id — disconnect (soft-disable).
-
#get(type, id) ⇒ Types::connection
GET /integrations/type/connections/id.
-
#sync(type, id, idempotency_key: nil) ⇒ Hash
POST /integrations/type/connections/id/sync — trigger a sync.
-
#test(type, id, idempotency_key: nil) ⇒ Hash
POST /integrations/type/connections/id/test — test stored credentials.
-
#update(type, id, aggressiveness: nil, manual_mode: nil, autofloss: nil, decay_protection: nil, action: nil, checks: nil) ⇒ Hash
PATCH /integrations/type/connections/id — update floss settings.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mailfloss::Resources::Base
Instance Method Details
#create(type, credentials:, name: nil, idempotency_key: nil) ⇒ Hash
POST /integrations/type/connections — connect an ESP account.
188 189 190 191 192 193 |
# File 'lib/mailfloss/resources.rb', line 188 def create(type, credentials:, name: nil, idempotency_key: nil) body = { credentials: credentials } body[:name] = name if name client.request(:post, "/integrations/#{encode(type)}/connections", body: body, idempotency_key: idempotency_key) end |
#delete(type, id) ⇒ Hash
DELETE /integrations/type/connections/id — disconnect (soft-disable).
224 225 226 |
# File 'lib/mailfloss/resources.rb', line 224 def delete(type, id) client.request(:delete, "/integrations/#{encode(type)}/connections/#{encode(id)}") end |
#get(type, id) ⇒ Types::connection
GET /integrations/type/connections/id
196 197 198 |
# File 'lib/mailfloss/resources.rb', line 196 def get(type, id) client.request(:get, "/integrations/#{encode(type)}/connections/#{encode(id)}") end |
#sync(type, id, idempotency_key: nil) ⇒ Hash
POST /integrations/type/connections/id/sync — trigger a sync.
231 232 233 234 |
# File 'lib/mailfloss/resources.rb', line 231 def sync(type, id, idempotency_key: nil) client.request(:post, "/integrations/#{encode(type)}/connections/#{encode(id)}/sync", idempotency_key: idempotency_key) end |
#test(type, id, idempotency_key: nil) ⇒ Hash
POST /integrations/type/connections/id/test — test stored credentials.
239 240 241 242 |
# File 'lib/mailfloss/resources.rb', line 239 def test(type, id, idempotency_key: nil) client.request(:post, "/integrations/#{encode(type)}/connections/#{encode(id)}/test", idempotency_key: idempotency_key) end |
#update(type, id, aggressiveness: nil, manual_mode: nil, autofloss: nil, decay_protection: nil, action: nil, checks: nil) ⇒ Hash
PATCH /integrations/type/connections/id — update floss settings.
209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/mailfloss/resources.rb', line 209 def update(type, id, aggressiveness: nil, manual_mode: nil, autofloss: nil, decay_protection: nil, action: nil, checks: nil) body = {} body[:aggressiveness] = aggressiveness unless aggressiveness.nil? body[:manual_mode] = manual_mode unless manual_mode.nil? body[:autofloss] = autofloss unless autofloss.nil? body[:decay_protection] = decay_protection unless decay_protection.nil? body[:action] = action unless action.nil? body[:checks] = checks unless checks.nil? client.request(:patch, "/integrations/#{encode(type)}/connections/#{encode(id)}", body: body) end |