Class: MailchimpTransactional::SubaccountsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SubaccountsApi

Returns a new instance of SubaccountsApi.



19
20
21
# File 'lib/MailchimpTransactional/api/subaccounts_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/subaccounts_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

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

Add subaccount Add a new subaccount.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20051 data, response status code and response headers



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

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

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

Delete subaccount Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20054 data, response status code and response headers



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

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

#info(body = {}) ⇒ Array<(InlineResponse20052, Fixnum, Hash)>

Get subaccount info Given the ID of an existing subaccount, return the data about it.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20052 data, response status code and response headers



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

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

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

List subaccounts Get the list of subaccounts defined for the account, optionally filtered by a prefix.

Parameters:

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

    the optional parameters

Returns:

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

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



58
59
60
61
# File 'lib/MailchimpTransactional/api/subaccounts_api.rb', line 58

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

#pause(body = {}) ⇒ Array<(InlineResponse20055, Fixnum, Hash)>

Pause subaccount Pause a subaccount&#39;s sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20055 data, response status code and response headers



68
69
70
71
# File 'lib/MailchimpTransactional/api/subaccounts_api.rb', line 68

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

#resume(body = {}) ⇒ Array<(InlineResponse20056, Fixnum, Hash)>

Resume subaccount Resume a paused subaccount&#39;s sending.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20056 data, response status code and response headers



78
79
80
81
# File 'lib/MailchimpTransactional/api/subaccounts_api.rb', line 78

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

#update(body = {}) ⇒ Array<(InlineResponse20053, Fixnum, Hash)>

Update subaccount Update an existing subaccount.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20053 data, response status code and response headers



88
89
90
91
# File 'lib/MailchimpTransactional/api/subaccounts_api.rb', line 88

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