Class: Iterable::Templates

Inherits:
ApiResource show all
Defined in:
lib/iterable/templates.rb

Overview

Interact with /templates API endpoints

Examples:

Creating templates endpoint object

# With default config
templates = Iterable::Templates.new
templates.all

# With custom config
conf = Iterable::Config.new(token: 'new-token')
templates = Iterable::Templates.new(config)

Constant Summary collapse

TYPES =

Template types

[
  BASE_TYPE      = 'Base'.freeze,
  BLAST_TYPE     = 'Blast'.freeze,
  TRIGGERED_TYPE = 'Triggered'.freeze,
  WORKFLOW_TYPE  = 'Workflow'.freeze
].freeze

Instance Attribute Summary

Attributes inherited from ApiResource

#conf

Instance Method Summary collapse

Methods inherited from ApiResource

#default_config, default_config, #initialize

Constructor Details

This class inherits a constructor from Iterable::ApiResource

Instance Method Details

#all(params = {}) ⇒ Iterable::Response

Get all templates

Returns:



28
29
30
# File 'lib/iterable/templates.rb', line 28

def all(params = {})
  Iterable.request(conf, '/templates', params).get
end

#for_client_template_id(client_template_id) ⇒ Object



32
33
34
35
# File 'lib/iterable/templates.rb', line 32

def for_client_template_id(client_template_id)
  params = { clientTemplateId: client_template_id }
  Iterable.request(conf, '/templates/getByClientTemplateId', params).get
end