Skip to content

Commit 23b262f

Browse files
updated doc changes
1 parent c5a6170 commit 23b262f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

lib/stack/bulkOperation/index.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,25 @@ export function BulkOperation (http, data = {}) {
99
this.stackHeaders = data.stackHeaders
1010
this.urlPath = `/bulk`
1111

12+
/**
13+
* The addItems request allows you to add multiple items to a release in bulk.
14+
* @memberof BulkOperation
15+
* @func addItems
16+
* @returns {Promise<Object>} Response Object.
17+
* @param {Object} params.data - The data containing the items to be added to the release.
18+
* @param {String} [params.bulk_version] - The bulk version.
19+
* @example
20+
* const itemsData = {
21+
* items: [
22+
* {
23+
* uid: '{{entry_uid}}',
24+
* content_type: '{{content_type_uid}}'
25+
* }
26+
* ]
27+
* }
28+
* client.stack({ api_key: 'api_key'}).bulkOperation().addItems({ data: itemsData })
29+
* .then((response) => { console.log(response) })
30+
*/
1231
this.addItems = async ({ data, bulk_version = "" }) => {
1332
this.urlPath = `/bulk/release/items`;
1433
const headers = {
@@ -27,6 +46,25 @@ export function BulkOperation (http, data = {}) {
2746
}
2847
};
2948

49+
/**
50+
* The updateItems request allows you to update multiple items in a release in bulk.
51+
* @memberof BulkOperation
52+
* @func updateItems
53+
* @returns {Promise<Object>} Response Object.
54+
* @param {Object} params.data - The data containing the items to be updated in the release.
55+
* @param {String} [params.bulk_version] - The bulk version.
56+
* @example
57+
* const itemsData = {
58+
* items: [
59+
* {
60+
* uid: '{{entry_uid}}',
61+
* content_type: '{{content_type_uid}}'
62+
* }
63+
* ]
64+
* }
65+
* client.stack({ api_key: 'api_key'}).bulkOperation().updateItems({ data: itemsData })
66+
* .then((response) => { console.log(response) })
67+
*/
3068
this.updateItems = async ({ data, bulk_version = "" }) => {
3169
this.urlPath = `/bulk/release/update_items`;
3270
const headers = {
@@ -45,6 +83,17 @@ export function BulkOperation (http, data = {}) {
4583
}
4684
};
4785

86+
/**
87+
* The jobStatus request allows you to check the status of a bulk job.
88+
* @memberof BulkOperation
89+
* @func jobStatus
90+
* @returns {Promise<Object>} Response Object.
91+
* @param {String} params.job_id - The ID of the job.
92+
* @param {String} [params.bulk_version] - The bulk version.
93+
* @example
94+
* client.stack({ api_key: 'api_key'}).bulkOperation().jobStatus({ job_id: 'job_id' })
95+
* .then((response) => { console.log(response) })
96+
*/
4897
this.jobStatus = async ({ job_id, bulk_version = "" }) => {
4998
this.urlPath = `/bulk/jobs/${job_id}`;
5099
const headers = {

0 commit comments

Comments
 (0)