Class: MailchimpTransactional::MetadataApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ MetadataApi

Returns a new instance of MetadataApi.



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

def api_client
  @api_client
end

Instance Method Details

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

Add metadata field Add a new custom metadata field to be indexed for the account.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20037 data, response status code and response headers



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

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

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

Delete metadata field Delete an existing custom metadata field. Deletion isn&#39;t instataneous, and /metadata/list will continue to return the field until the asynchronous deletion process is complete.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20039 data, response status code and response headers



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

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

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

List metadata fields Get the list of custom metadata fields indexed for the account.

Parameters:

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

    the optional parameters

Returns:

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

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



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

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

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

Update metadata field Update an existing custom metadata field.

Parameters:

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

    the optional parameters

Returns:

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

    InlineResponse20038 data, response status code and response headers



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

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