Class: MailchimpTransactional::AllowlistsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/MailchimpTransactional/api/allowlists_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AllowlistsApi

Returns a new instance of AllowlistsApi.



19
20
21
# File 'lib/MailchimpTransactional/api/allowlists_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/MailchimpTransactional/api/allowlists_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add(body = {}) ⇒ Array<(InlineResponse200, Fixnum, Hash)>

Add email to allowlist Adds an email to your email rejection allowlist. If the address is currently on your denylist, that denylist entry will be removed automatically.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse200, Fixnum, Hash)>)

    InlineResponse200 data, response status code and response headers



28
29
30
31
# File 'lib/MailchimpTransactional/api/allowlists_api.rb', line 28

def add(body = {})
  data = @api_client.call_api(:POST, '/allowlists/add', body)
  data
end

#delete(body = {}) ⇒ Array<(InlineResponse2002, Fixnum, Hash)>

Remove email from allowlist Removes an email address from the allowlist.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(InlineResponse2002, Fixnum, Hash)>)

    InlineResponse2002 data, response status code and response headers



38
39
40
41
# File 'lib/MailchimpTransactional/api/allowlists_api.rb', line 38

def delete(body = {})
  data = @api_client.call_api(:POST, '/allowlists/delete', body)
  data
end

#list(body = {}) ⇒ Array<(Array<InlineResponse2001>, Fixnum, Hash)>

List allowlisted emails Retrieves your email rejection allowlist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results.

Parameters:

  • body (defaults to: {})
  • opts (Hash)

    the optional parameters

Returns:

  • (Array<(Array<InlineResponse2001>, Fixnum, Hash)>)

    Array<InlineResponse2001> data, response status code and response headers



48
49
50
51
# File 'lib/MailchimpTransactional/api/allowlists_api.rb', line 48

def list(body = {})
  data = @api_client.call_api(:POST, '/allowlists/list', body)
  data
end