Class: MailchimpTransactional::WebhooksApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WebhooksApi

Returns a new instance of WebhooksApi.



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

def api_client
  @api_client
end

Instance Method Details

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

Add webhook Add a new webhook.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20075 data, response status code and response headers



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

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

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

Delete webhook Delete an existing webhook.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20078 data, response status code and response headers



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

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

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

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

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20076 data, response status code and response headers



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

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

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

List webhooks Get the list of all webhooks defined on the account.

Parameters:

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

    the optional parameters

Returns:

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

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



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

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

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

Update webhook Update an existing webhook.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20077 data, response status code and response headers



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

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