Class: Iterable::CatalogFieldMappings

Inherits:
ApiResource show all
Extended by:
T::Sig
Defined in:
lib/iterable/catalog_field_mappings.rb

Overview

Interact with /catalogs/catalogName/fieldMappings API endpoints **currently in Beta only**

Examples:

Creating catalog field mappings endpoint object

# With default config
catalog = Iterable::CatalogFieldMappings.new "catalog-name"
catalog.items

# With custom config
conf = Iterable::Config.new(token: 'new-token')
catalog = Iterable::CatalogFieldMappings.new("catalog-name", config)

Instance Attribute Summary collapse

Attributes inherited from ApiResource

#conf

Instance Method Summary collapse

Methods inherited from ApiResource

default_config, #default_config

Constructor Details

#initialize(catalog, conf = nil) ⇒ CatalogFieldMappings

Returns a new instance of CatalogFieldMappings.



31
32
33
34
# File 'lib/iterable/catalog_field_mappings.rb', line 31

def initialize(catalog, conf = nil)
  @catalog = catalog
  super conf
end

Instance Attribute Details

#catalogObject (readonly)

Returns the value of attribute catalog.



20
21
22
# File 'lib/iterable/catalog_field_mappings.rb', line 20

def catalog
  @catalog
end

Instance Method Details

#getObject



42
43
44
# File 'lib/iterable/catalog_field_mappings.rb', line 42

def get
  Iterable.request(conf, base_path).get
end

#update(mappings_updates = []) ⇒ Object



61
62
63
64
# File 'lib/iterable/catalog_field_mappings.rb', line 61

def update(mappings_updates = [])
  body = { mappingsUpdates: mappings_updates }
  Iterable.request(conf, base_path).put(body)
end