Class: Mailfloss::Resources::Integrations

Inherits:
Base
  • Object
show all
Defined in:
lib/mailfloss/resources.rb,
sig/resources.rbs

Overview

GET /integrations and nested connections/keywords.

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#encode, #initialize

Constructor Details

This class inherits a constructor from Mailfloss::Resources::Base

Instance Method Details

#connectionsConnections

Returns:



170
171
172
# File 'lib/mailfloss/resources.rb', line 170

def connections
  @connections ||= Connections.new(client)
end

#get(type) ⇒ Hash

GET /integrations/type — detail for a single ESP.

Parameters:

  • type (String)

Returns:

  • (Hash)

    { type:, connected:, connection_count:, connections:, disconnected_connections: }



166
167
168
# File 'lib/mailfloss/resources.rb', line 166

def get(type)
  client.request(:get, "/integrations/#{encode(type)}")
end

#keywordsKeywords

Returns:



174
175
176
# File 'lib/mailfloss/resources.rb', line 174

def keywords
  @keywords ||= Keywords.new(client)
end

#list(per_page: nil, cursor: nil) ⇒ Hash

GET /integrations — all supported ESPs with connection state.

Parameters:

  • per_page: (Integer, nil) (defaults to: nil)
  • cursor: (String, nil) (defaults to: nil)

Returns:

  • (Hash)

    { data: [Integration], pagination: { next_cursor:, has_more: } }



158
159
160
# File 'lib/mailfloss/resources.rb', line 158

def list(per_page: nil, cursor: nil)
  client.request(:get, "/integrations", query: { per_page: per_page, cursor: cursor })
end