iterable-api-client 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +206 -1
- data/lib/iterable.rb +4 -0
- data/lib/iterable/bulk_catalog_items.rb +67 -0
- data/lib/iterable/catalog_field_mappings.rb +63 -0
- data/lib/iterable/catalog_items.rb +95 -0
- data/lib/iterable/catalogs.rb +63 -0
- data/lib/iterable/request.rb +6 -2
- metadata +29 -22
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9fb91e7903cb57cc4b94cf4e09e55d30363b54814e3b4a4772bb0afcc9e0688
|
4
|
+
data.tar.gz: b485aefb061f8378d1dc26b2df501468102a4d03e5b38a0f765f215053489f61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c2eec26670adaaec5954136b1b458ea0e28680ed56e4872b4eb5bcdd9788082a80067d1fb7b5a0706254349ffda1bb83e08bd4218b2144c2bf841e98659177
|
7
|
+
data.tar.gz: 267c86d3a69163e1ebc3a4a9005ad999c86e1fd906fe38fd0b2e43cc11ce5e5a47bf6332abc0d37d849e8b72d03933fb2b281ab084e365fee4fe35ef245cb4ed
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Iterable API Gem
|
2
2
|
|
3
3
|
[![Gem](https://img.shields.io/gem/v/iterable-api-client.svg)](https://rubygems.org/gems/iterable-api-client)
|
4
|
-
[![
|
4
|
+
[![pipeline status](https://gitlab.com/mtchavez/iterable/badges/master/pipeline.svg)](https://gitlab.com/mtchavez/iterable/-/commits/master)
|
5
5
|
[![coverage report](https://gitlab.com/mtchavez/iterable/badges/master/coverage.svg)](https://gitlab.com/mtchavez/iterable/commits/master)
|
6
6
|
|
7
7
|
Rubygem to interact with the [Iterable][iterable] API.
|
@@ -87,11 +87,27 @@ reponse.uri
|
|
87
87
|
|
88
88
|
## API Endpoints
|
89
89
|
|
90
|
+
* [Bulk Catalog Items](#bulk-catalog-items)
|
91
|
+
* [Create](#bulk-catalog-items-create)
|
92
|
+
* [Delete](#bulk-catalog-items-delete)
|
90
93
|
* [Campaigns](#campaigns)
|
91
94
|
* [All](#campaigns-all)
|
92
95
|
* [Create](#campaigns-create)
|
93
96
|
* [Metrics](#campaigns-metrics)
|
94
97
|
* [Child Campaigns](#campaigns-child)
|
98
|
+
* [Catalog Field Mappings](#catalog-field-mappings)
|
99
|
+
* [Get](#catalog-field-mappings-get)
|
100
|
+
* [Update](#catalog-field-mappings-update)
|
101
|
+
* [Catalog Items](#catalog-items)
|
102
|
+
* [All](#catalog-items-all)
|
103
|
+
* [Create](#catalog-items-create)
|
104
|
+
* [Update](#catalog-items-update)
|
105
|
+
* [Get](#catalog-items-get)
|
106
|
+
* [Delete](#catalog-items-delete)
|
107
|
+
* [Catalogs](#catalogs)
|
108
|
+
* [Create](#catalogs-create)
|
109
|
+
* [Delete](#catalogs-delete)
|
110
|
+
* [Names](#catalogs-names)
|
95
111
|
* [Channels](#channels)
|
96
112
|
* [All](#channels-all)
|
97
113
|
* [Commerce](#commerce)
|
@@ -155,6 +171,41 @@ reponse.uri
|
|
155
171
|
* [Workflows](#workflows)
|
156
172
|
* [Trigger](#workflows-trigger)
|
157
173
|
|
174
|
+
### Bulk Catalog Items
|
175
|
+
|
176
|
+
**Beta access only** endpoint
|
177
|
+
|
178
|
+
#### Bulk Catalog Items Create
|
179
|
+
|
180
|
+
Endpoint: `POST /catalogs/{catalogName}/items`
|
181
|
+
|
182
|
+
```ruby
|
183
|
+
catalog = 'my-catalog'
|
184
|
+
catalog_items = Iterable::BulkCatalogItems.new(catalog)
|
185
|
+
# Hash of item id to item values
|
186
|
+
create_items = {
|
187
|
+
'122343453' => {
|
188
|
+
name: 'item name',
|
189
|
+
status: 'open'
|
190
|
+
}
|
191
|
+
}
|
192
|
+
response = catalog_items.create(create_items, replace_uploaded_fields_only: true)
|
193
|
+
# Use replace_uploaded_fields_only as true to update fields
|
194
|
+
# of existing items. Otherwise the default is to replace
|
195
|
+
# existing items
|
196
|
+
```
|
197
|
+
|
198
|
+
#### Bulk Catalog Items Delete
|
199
|
+
|
200
|
+
Endpoint: `DELETE /catalogs/{catalogName}/items`
|
201
|
+
|
202
|
+
```ruby
|
203
|
+
catalog = 'my-catalog'
|
204
|
+
catalog_items = Iterable::BulkCatalogItems.new(catalog)
|
205
|
+
item_ids = ['12345', '12346', '12347']
|
206
|
+
response = catalog_items.create(item_ids)
|
207
|
+
```
|
208
|
+
|
158
209
|
### Campaigns
|
159
210
|
|
160
211
|
#### Campaigns All
|
@@ -200,6 +251,160 @@ campaigns = Iterable::Campaigns.new
|
|
200
251
|
response = campaigns.recurring 'campaign-id'
|
201
252
|
```
|
202
253
|
|
254
|
+
### Catalogs
|
255
|
+
|
256
|
+
**Beta access only** endpoint
|
257
|
+
|
258
|
+
#### Catalogs Create
|
259
|
+
|
260
|
+
Endpoint: `POST /catalogs/{catalogName}`
|
261
|
+
|
262
|
+
```ruby
|
263
|
+
catalog = 'my-catalog'
|
264
|
+
catalog_items = Iterable::Catalogs.new(catalog)
|
265
|
+
response = catalog_items.create
|
266
|
+
```
|
267
|
+
|
268
|
+
#### Catalogs Delete
|
269
|
+
|
270
|
+
Endpoint: `DELETE /catalogs/{catalogName}`
|
271
|
+
|
272
|
+
```ruby
|
273
|
+
catalog = 'my-catalog'
|
274
|
+
catalog_items = Iterable::Catalogs.new(catalog)
|
275
|
+
response = catalog_items.delete
|
276
|
+
```
|
277
|
+
|
278
|
+
#### Catalogs Delete
|
279
|
+
|
280
|
+
Endpoint: `DELETE /catalogs/{catalogName}`
|
281
|
+
|
282
|
+
```ruby
|
283
|
+
catalog = 'my-catalog'
|
284
|
+
catalog_items = Iterable::Catalogs.new(catalog)
|
285
|
+
params = { page: 1, pageSize: 20 }
|
286
|
+
response = catalog_items.names(params)
|
287
|
+
```
|
288
|
+
|
289
|
+
### Catalog Field Mappings
|
290
|
+
|
291
|
+
**Beta access only** endpoint
|
292
|
+
|
293
|
+
#### Catalog Field Mappings Get
|
294
|
+
|
295
|
+
Endpoint: `GET /catalogs/{catalogName}/fieldMappings`
|
296
|
+
|
297
|
+
```ruby
|
298
|
+
catalog = 'my-catalog'
|
299
|
+
catalog_items = Iterable::CatalogFieldMappings.new(catalog)
|
300
|
+
response = catalog_items.field_mappings
|
301
|
+
```
|
302
|
+
|
303
|
+
#### Catalog Field Mappings Update
|
304
|
+
|
305
|
+
Endpoint: `PUT /catalogs/{catalogName}/fieldMappings`
|
306
|
+
|
307
|
+
```ruby
|
308
|
+
catalog = 'my-catalog'
|
309
|
+
field_mappings = [{fieldName: 'test-field', fieldType: 'string'}]
|
310
|
+
catalog = Iterable::CatalogFieldMappings.new(catalog)
|
311
|
+
catalog.update_field_mappings(field_mappings)
|
312
|
+
```
|
313
|
+
|
314
|
+
### Catalog Items
|
315
|
+
|
316
|
+
**Beta access only** endpoint
|
317
|
+
|
318
|
+
#### Catalog Items All
|
319
|
+
|
320
|
+
Endpoint: `GET /catalogs/{catalogName}/items`
|
321
|
+
|
322
|
+
```ruby
|
323
|
+
catalog = 'my-catalog'
|
324
|
+
catalog_items = Iterable::CatalogItems.new(catalog)
|
325
|
+
response = catalog_items.all
|
326
|
+
```
|
327
|
+
|
328
|
+
#### Catalog Items Create
|
329
|
+
|
330
|
+
Endpoint: `PUT /catalogs/{catalogName}/items/{itemId}`
|
331
|
+
|
332
|
+
```ruby
|
333
|
+
catalog = 'my-catalog'
|
334
|
+
item_id = '1234-abcd-1234-abcd'
|
335
|
+
catalog_items = Iterable::CatalogItems.new(catalog, item_id)
|
336
|
+
item_attrs = { name: 'item name', status: 'open' }
|
337
|
+
response = catalog_items.create(item_attrs)
|
338
|
+
```
|
339
|
+
|
340
|
+
#### Catalog Items Update
|
341
|
+
|
342
|
+
Endpoint: `PATCH /catalogs/{catalogName}/items/{itemId}`
|
343
|
+
|
344
|
+
```ruby
|
345
|
+
catalog = 'my-catalog'
|
346
|
+
item_id = '1234-abcd-1234-abcd'
|
347
|
+
catalog_items = Iterable::CatalogItems.new(catalog, item_id)
|
348
|
+
item_attrs = { name: 'item name', status: 'open' }
|
349
|
+
response = catalog_items.update(item_attrs)
|
350
|
+
```
|
351
|
+
|
352
|
+
#### Catalog Items Get
|
353
|
+
|
354
|
+
Endpoint: `GET /catalogs/{catalogName}/items/{itemId}`
|
355
|
+
|
356
|
+
```ruby
|
357
|
+
catalog = 'my-catalog'
|
358
|
+
item_id = '1234-abcd-1234-abcd'
|
359
|
+
catalog_items = Iterable::CatalogItems.new(catalog, item_id)
|
360
|
+
response = catalog_items.get
|
361
|
+
```
|
362
|
+
|
363
|
+
#### Catalog Items Delete
|
364
|
+
|
365
|
+
Endpoint: `DELETE /catalogs/{catalogName}/items/{itemId}`
|
366
|
+
|
367
|
+
```ruby
|
368
|
+
catalog = 'my-catalog'
|
369
|
+
item_id = '1234-abcd-1234-abcd'
|
370
|
+
catalog_items = Iterable::CatalogItems.new(catalog, item_id)
|
371
|
+
response = catalog_items.delete
|
372
|
+
```
|
373
|
+
|
374
|
+
### Catalogs
|
375
|
+
|
376
|
+
**Beta access only** endpoint
|
377
|
+
|
378
|
+
#### Catalogs Create
|
379
|
+
|
380
|
+
Endpoint: `POST /catalogs/{catalogName}`
|
381
|
+
|
382
|
+
```ruby
|
383
|
+
catalog = 'my-catalog'
|
384
|
+
catalog_items = Iterable::Catalogs.new(catalog)
|
385
|
+
response = catalog_items.create
|
386
|
+
```
|
387
|
+
|
388
|
+
#### Catalogs Delete
|
389
|
+
|
390
|
+
Endpoint: `DELETE /catalogs/{catalogName}`
|
391
|
+
|
392
|
+
```ruby
|
393
|
+
catalog = 'my-catalog'
|
394
|
+
catalog_items = Iterable::Catalogs.new(catalog)
|
395
|
+
response = catalog_items.delete
|
396
|
+
```
|
397
|
+
|
398
|
+
#### Catalogs Names
|
399
|
+
|
400
|
+
Endpoint: `GET /catalogs/{catalogName}/names`
|
401
|
+
|
402
|
+
```ruby
|
403
|
+
catalog = 'my-catalog'
|
404
|
+
catalog_items = Iterable::Catalogs.new(catalog)
|
405
|
+
params = { page: 1, pageSize: 20 }
|
406
|
+
response = catalog_items.names(params)
|
407
|
+
```
|
203
408
|
|
204
409
|
### Channels
|
205
410
|
|
data/lib/iterable.rb
CHANGED
@@ -0,0 +1,67 @@
|
|
1
|
+
module Iterable
|
2
|
+
##
|
3
|
+
#
|
4
|
+
# Interact with /catalogs/{catalogName}/items API endpoints
|
5
|
+
# **currently in Beta only**
|
6
|
+
#
|
7
|
+
# @example Creating catalog items endpoint object
|
8
|
+
# # With default config
|
9
|
+
# catalog = Iterable::BulkCatalogItems.new "catalog-name"
|
10
|
+
# catalog.items
|
11
|
+
#
|
12
|
+
# # With custom config
|
13
|
+
# conf = Iterable::Config.new(token: 'new-token')
|
14
|
+
# catalog = Iterable::BulkCatalogItems.new("catalog-name", config)
|
15
|
+
class BulkCatalogItems < ApiResource
|
16
|
+
attr_reader :catalog
|
17
|
+
|
18
|
+
##
|
19
|
+
#
|
20
|
+
# Initialize CatalogItems with a catalog name and item ID **currently in Beta only**
|
21
|
+
#
|
22
|
+
# @param catalog [String] The name of the catalog to interact with
|
23
|
+
# @param item_id [String] The string ID of the item to interact with
|
24
|
+
# @param conf [Iterable::Config] A config to optionally pass for requests
|
25
|
+
#
|
26
|
+
# @return [Iterable::Catalog]
|
27
|
+
def initialize(catalog, conf = nil)
|
28
|
+
@catalog = catalog
|
29
|
+
super conf
|
30
|
+
end
|
31
|
+
|
32
|
+
##
|
33
|
+
#
|
34
|
+
# Bulk delete catalog items
|
35
|
+
#
|
36
|
+
# @param keys [Array] Array of catalog items ids to delete
|
37
|
+
#
|
38
|
+
# @return [Iterable::Response] A response object
|
39
|
+
def delete(item_ids = [])
|
40
|
+
body = { itemIds: item_ids }
|
41
|
+
Iterable.request(conf, base_path).delete(body)
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
#
|
46
|
+
# Bulk create catalog items
|
47
|
+
#
|
48
|
+
# @param documents [Hash] Hash of item ID to item attributes e.g. { '123456': { name: 'foo', state: 'open' } }
|
49
|
+
# @param replace_uploaded_fields_only [Boolean] Whether to replace only the upload fields within each document,
|
50
|
+
# not each entire document. Defaults to false and will replace
|
51
|
+
# existing.
|
52
|
+
# @return [Iterable::Response] A response object
|
53
|
+
def create(items = {}, replace_uploaded_fields_only: false)
|
54
|
+
body = {
|
55
|
+
documents: items,
|
56
|
+
replaceUploadedFieldsOnly: replace_uploaded_fields_only
|
57
|
+
}
|
58
|
+
Iterable.request(conf, base_path).post(body)
|
59
|
+
end
|
60
|
+
|
61
|
+
private
|
62
|
+
|
63
|
+
def base_path
|
64
|
+
"/catalogs/#{@catalog}/items"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Iterable
|
2
|
+
##
|
3
|
+
#
|
4
|
+
# Interact with /catalogs/{catalogName}/fieldMappings API endpoints
|
5
|
+
# **currently in Beta only**
|
6
|
+
#
|
7
|
+
# @example Creating catalog field mappings endpoint object
|
8
|
+
# # With default config
|
9
|
+
# catalog = Iterable::CatalogFieldMappings.new "catalog-name"
|
10
|
+
# catalog.items
|
11
|
+
#
|
12
|
+
# # With custom config
|
13
|
+
# conf = Iterable::Config.new(token: 'new-token')
|
14
|
+
# catalog = Iterable::CatalogFieldMappings.new("catalog-name", config)
|
15
|
+
class CatalogFieldMappings < ApiResource
|
16
|
+
attr_reader :catalog
|
17
|
+
##
|
18
|
+
#
|
19
|
+
# Initialize CatalogFieldMappings with a catalog name **currently in Beta only**
|
20
|
+
#
|
21
|
+
# @param catalog [String] The name of the catalog to interact with
|
22
|
+
# @param conf [Iterable::Config] A config to optionally pass for requests
|
23
|
+
#
|
24
|
+
# @return [Iterable::Catalog]
|
25
|
+
def initialize(catalog, conf = nil)
|
26
|
+
@catalog = catalog
|
27
|
+
super conf
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
#
|
32
|
+
# Get field mappings for a catalog
|
33
|
+
#
|
34
|
+
# @return [Iterable::Response] A response object
|
35
|
+
def get
|
36
|
+
Iterable.request(conf, base_path).get
|
37
|
+
end
|
38
|
+
|
39
|
+
##
|
40
|
+
#
|
41
|
+
# Set a catalog's field mappings (data types)
|
42
|
+
#
|
43
|
+
# @param [Array] Array of field mapping hashes e.g [{"fieldName":"exampleString","fieldType":"string"}]}
|
44
|
+
#
|
45
|
+
# @return [Iterable::Response] A response object
|
46
|
+
#
|
47
|
+
# @example Supplying field mappings
|
48
|
+
# # Fields to update with field types
|
49
|
+
# field_mappings = [{fieldName: 'test-field', fieldType: 'string'}]
|
50
|
+
# catalog = Iterable::CatalogFieldMappings.new "catalog-name"
|
51
|
+
# catalog.update_field_mappings(field_mappings)
|
52
|
+
def update(mappings_updates = [])
|
53
|
+
body = { mappingsUpdates: mappings_updates }
|
54
|
+
Iterable.request(conf, base_path).put(body)
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def base_path
|
60
|
+
"/catalogs/#{@catalog}/fieldMappings"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module Iterable
|
2
|
+
##
|
3
|
+
#
|
4
|
+
# Interact with /catalogs/{catalogName}/{itemID} API endpoints
|
5
|
+
# **currently in Beta only**
|
6
|
+
#
|
7
|
+
# @example Creating catalog items endpoint object
|
8
|
+
# # With default config
|
9
|
+
# catalog = Iterable::CatalogItems.new "catalog-name"
|
10
|
+
# catalog.items
|
11
|
+
#
|
12
|
+
# # With custom config
|
13
|
+
# conf = Iterable::Config.new(token: 'new-token')
|
14
|
+
# catalog = Iterable::CatalogItems.new("catalog-name", config)
|
15
|
+
class CatalogItems < ApiResource
|
16
|
+
attr_reader :catalog, :item_id
|
17
|
+
|
18
|
+
##
|
19
|
+
#
|
20
|
+
# Initialize CatalogItems with a catalog name and item ID **currently in Beta only**
|
21
|
+
#
|
22
|
+
# @param catalog [String] The name of the catalog to interact with
|
23
|
+
# @param item_id [String] The string ID of the item to interact with
|
24
|
+
# @param conf [Iterable::Config] A config to optionally pass for requests
|
25
|
+
#
|
26
|
+
# @return [Iterable::Catalog]
|
27
|
+
def initialize(catalog, item_id = nil, conf = nil)
|
28
|
+
@catalog = catalog
|
29
|
+
@item_id = item_id
|
30
|
+
super conf
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
#
|
35
|
+
# Get all items for a catalog
|
36
|
+
#
|
37
|
+
# @param params[Hash] Attribute hash for item query (page, pageSize, orderBy, sortAscending)
|
38
|
+
#
|
39
|
+
# @return [Iterable::Response] A response object
|
40
|
+
def all(params = {})
|
41
|
+
Iterable.request(conf, base_path, params).get
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
#
|
46
|
+
# Create a catalog item
|
47
|
+
#
|
48
|
+
# @param item_attrs [Hash] Item attributes to save or update with
|
49
|
+
#
|
50
|
+
# @return [Iterable::Response] A response object
|
51
|
+
def create(item_attrs = {})
|
52
|
+
body = { update: item_attrs }
|
53
|
+
Iterable.request(conf, base_path).put(body)
|
54
|
+
end
|
55
|
+
alias replace create
|
56
|
+
|
57
|
+
##
|
58
|
+
#
|
59
|
+
# Update a catalog item
|
60
|
+
#
|
61
|
+
# @param item_attrs [Hash] Item attributes to save or update with
|
62
|
+
#
|
63
|
+
# @return [Iterable::Response] A response object
|
64
|
+
def update(item_attrs = {})
|
65
|
+
body = { update: item_attrs }
|
66
|
+
Iterable.request(conf, base_path).patch(body)
|
67
|
+
end
|
68
|
+
|
69
|
+
##
|
70
|
+
#
|
71
|
+
# Get a specific catalog item
|
72
|
+
#
|
73
|
+
# @return [Iterable::Response] A response object
|
74
|
+
def get
|
75
|
+
Iterable.request(conf, base_path).get
|
76
|
+
end
|
77
|
+
|
78
|
+
##
|
79
|
+
#
|
80
|
+
# Delete a catalog item
|
81
|
+
#
|
82
|
+
# @return [Iterable::Response] A response object
|
83
|
+
def delete
|
84
|
+
Iterable.request(conf, base_path).delete
|
85
|
+
end
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
def base_path
|
90
|
+
path = "/catalogs/#{@catalog}/items"
|
91
|
+
path += "/#{@item_id}" if @item_id
|
92
|
+
path
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Iterable
|
2
|
+
##
|
3
|
+
#
|
4
|
+
# Interact with /catalogs/{catalogName} API endpoints
|
5
|
+
# **currently in Beta only**
|
6
|
+
#
|
7
|
+
# @example Creating catalog endpoint object
|
8
|
+
# # With default config
|
9
|
+
# catalog = Iterable::Catalogs.new "catalog-name"
|
10
|
+
# catalog.items
|
11
|
+
#
|
12
|
+
# # With custom config
|
13
|
+
# conf = Iterable::Config.new(token: 'new-token')
|
14
|
+
# catalog = Iterable::Catalogs.new("catalog-name", config)
|
15
|
+
class Catalogs < ApiResource
|
16
|
+
attr_reader :name
|
17
|
+
##
|
18
|
+
#
|
19
|
+
# Initialize Catalogs with a catalog name **currently in Beta only**
|
20
|
+
#
|
21
|
+
# @param name [String] The name of the catalog to interact with
|
22
|
+
# @param conf [Iterable::Config] A config to optionally pass for requests
|
23
|
+
#
|
24
|
+
# @return [Iterable::Catalog]
|
25
|
+
def initialize(name, conf = nil)
|
26
|
+
@name = name
|
27
|
+
super conf
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
#
|
32
|
+
# Create a catalog
|
33
|
+
#
|
34
|
+
# @return [Iterable::Response] A response object
|
35
|
+
def create
|
36
|
+
Iterable.request(conf, base_path).post
|
37
|
+
end
|
38
|
+
|
39
|
+
##
|
40
|
+
#
|
41
|
+
# Delete a catalog
|
42
|
+
#
|
43
|
+
# @return [Iterable::Response] A response object
|
44
|
+
def delete
|
45
|
+
Iterable.request(conf, base_path).delete
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
#
|
50
|
+
# Get a list of all catalog names
|
51
|
+
#
|
52
|
+
# @return [Iterable::Response] A response object
|
53
|
+
def names(params = {})
|
54
|
+
Iterable.request(conf, '/catalogs', params).get
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def base_path
|
60
|
+
"/catalogs/#{@name}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
data/lib/iterable/request.rb
CHANGED
@@ -34,8 +34,12 @@ module Iterable
|
|
34
34
|
execute :put, body, headers
|
35
35
|
end
|
36
36
|
|
37
|
-
def
|
38
|
-
execute :
|
37
|
+
def patch(body = {}, headers = {})
|
38
|
+
execute :patch, body, headers
|
39
|
+
end
|
40
|
+
|
41
|
+
def delete(body = {}, headers = {})
|
42
|
+
execute :delete, body, headers
|
39
43
|
end
|
40
44
|
|
41
45
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iterable-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chavez
|
@@ -10,25 +10,29 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
13
|
+
MIIEQDCCAqigAwIBAgIBATANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpjb250
|
14
|
+
YWN0L0RDPWVsLWNoYXZlei9EQz1tZTAeFw0yMDAxMDYyMTE1MjJaFw0yMTAxMDUy
|
15
|
+
MTE1MjJaMCUxIzAhBgNVBAMMGmNvbnRhY3QvREM9ZWwtY2hhdmV6L0RDPW1lMIIB
|
16
|
+
ojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA6U1sauKbeYcFLhyEMvgwxxF+
|
17
|
+
qvd5/cE5PegVdrcR0FzUfnoYeJgPhuPR2zlMfGjOpNOhuu15PAw34tJAujW7JKpi
|
18
|
+
NAqJuQGLo79sn7RvGM1nWIuwa8oTRyg3bG5S/qB5rgqepLotw+2CqQpmGVYX24Sm
|
19
|
+
cj6xkvHR7uujxo9yddCmtV/FLQmLjFJPOniGR6MCYCF+nD83U9ql08ARYZnhqUXB
|
20
|
+
GmbtRp3HHu4cPW+DDfjrpmbr9Ro8JGAQO79yV6MeoUykmI0WROAXZLpMwzWYhSUF
|
21
|
+
cmiQYRVgH321DzTsQb1VdpDotkg6JQLqoh5PwIhIW+wugtc+bb17cEQDuNYGMP2p
|
22
|
+
XZk8rdkcICAanBMBq6iQ6Y16Qk0aDuwfG+z7r21U+6b+xvRTgnEQtAWcgrNQfIot
|
23
|
+
l2cUVrKORwqksMgBdBWFXnIFWELBQTjctlSzN+aVes7MiG8xL6GLhw8t4cRPuXuo
|
24
|
+
75BKqrQxNwiCUbkCXRz2qm4hI1mXMjXeZoCTzkDrAgMBAAGjezB5MAkGA1UdEwQC
|
25
|
+
MAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBTfbl7AdXC+ZHUSdKQDm3WSqdZFWzAf
|
26
|
+
BgNVHREEGDAWgRRjb250YWN0QGVsLWNoYXZlei5tZTAfBgNVHRIEGDAWgRRjb250
|
27
|
+
YWN0QGVsLWNoYXZlei5tZTANBgkqhkiG9w0BAQsFAAOCAYEAVFwtaW8yVXeY9A0g
|
28
|
+
enOBw+zAegw+hwEqtVu9ihBFRgGmdOpKy4M6VCczUH5UiuGYhUskfzaBWrhz/p1Z
|
29
|
+
/Jm7TBoMIMfadwhJhzwbVj4xGM2UzOsk77lwb88eCcJoDCsXswbGTt69gMWhAOY4
|
30
|
+
AVgxYC8MXr+Memsyxts6+XTfLqCl8CgmrGDgrmeyLgTUonnNCiorvh19HSDdqTru
|
31
|
+
oOiKlvPHq9LLzsL3lcFxrvUttOZE+k9TQqWUHtXSPYTKse4h66UtzsRG6o6WgW8c
|
32
|
+
u2bEy+cGzSlAiP5yNDLff5WP9VnMKhoxc97ADyAUQ4rrKi3wRVXf4K7DpGny1W3C
|
33
|
+
EQgzzH5CkIhqK+UVh5zC9UZIpDDeylDul3rvxaRV4TqpRzOm+Vsoc4RUGWngZUi+
|
34
|
+
6jerLBXBmcX53OXAzqUVvXdltwSkV6s8QU+HoX9UjEZJc0C8PZImFJK8luKAJyan
|
35
|
+
j5z5DqHqyQohXShIy6UFpAs4Jka/L7Uo7/iCYIeaE/0rRFLS
|
32
36
|
-----END CERTIFICATE-----
|
33
37
|
date: 2018-07-17 00:00:00.000000000 Z
|
34
38
|
dependencies:
|
@@ -282,7 +286,11 @@ files:
|
|
282
286
|
- lib/iterable-api-client.rb
|
283
287
|
- lib/iterable.rb
|
284
288
|
- lib/iterable/api_resource.rb
|
289
|
+
- lib/iterable/bulk_catalog_items.rb
|
285
290
|
- lib/iterable/campaigns.rb
|
291
|
+
- lib/iterable/catalog_field_mappings.rb
|
292
|
+
- lib/iterable/catalog_items.rb
|
293
|
+
- lib/iterable/catalogs.rb
|
286
294
|
- lib/iterable/channels.rb
|
287
295
|
- lib/iterable/commerce.rb
|
288
296
|
- lib/iterable/config.rb
|
@@ -326,8 +334,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
334
|
- !ruby/object:Gem::Version
|
327
335
|
version: '0'
|
328
336
|
requirements: []
|
329
|
-
|
330
|
-
rubygems_version: 2.7.6
|
337
|
+
rubygems_version: 3.0.3
|
331
338
|
signing_key:
|
332
339
|
specification_version: 4
|
333
340
|
summary: Iterable REST API Client
|
metadata.gz.sig
CHANGED
Binary file
|