Class: Iterable::BulkCatalogItems
- Inherits:
-
ApiResource
- Object
- ApiResource
- Iterable::BulkCatalogItems
- Defined in:
- lib/iterable/bulk_catalog_items.rb
Overview
Interact with /catalogs/catalogName/items API endpoints **currently in Beta only**
Instance Attribute Summary collapse
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
Attributes inherited from ApiResource
Instance Method Summary collapse
-
#create(items = {}, replace_uploaded_fields_only: false) ⇒ Iterable::Response
Bulk create catalog items.
-
#delete(item_ids = []) ⇒ Iterable::Response
Bulk delete catalog items.
-
#initialize(catalog, conf = nil) ⇒ Iterable::Catalog
constructor
Initialize CatalogItems with a catalog name and item ID **currently in Beta only**.
Methods inherited from ApiResource
default_config, #default_config
Constructor Details
#initialize(catalog, conf = nil) ⇒ Iterable::Catalog
Initialize CatalogItems with a catalog name and item ID **currently in Beta only**
27 28 29 30 |
# File 'lib/iterable/bulk_catalog_items.rb', line 27 def initialize(catalog, conf = nil) @catalog = catalog super conf end |
Instance Attribute Details
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
16 17 18 |
# File 'lib/iterable/bulk_catalog_items.rb', line 16 def catalog @catalog end |
Instance Method Details
#create(items = {}, replace_uploaded_fields_only: false) ⇒ Iterable::Response
Bulk create catalog items
53 54 55 56 57 58 59 |
# File 'lib/iterable/bulk_catalog_items.rb', line 53 def create(items = {}, replace_uploaded_fields_only: false) body = { documents: items, replaceUploadedFieldsOnly: replace_uploaded_fields_only } Iterable.request(conf, base_path).post(body) end |
#delete(item_ids = []) ⇒ Iterable::Response
Bulk delete catalog items
39 40 41 42 |
# File 'lib/iterable/bulk_catalog_items.rb', line 39 def delete(item_ids = []) body = { itemIds: item_ids } Iterable.request(conf, base_path).delete(body) end |