@@ -227,4 +227,96 @@ def update(self, data: dict):
227227 data = json .dumps (data )
228228 return self .client .post (url , headers = self .client .headers , data = data , params = self .params )
229229
230+ def add_items (self , data : dict , headers : dict = None ):
231+ """
232+ The Add items to bulk operation request allows you to add multiple entries and assets to a bulk operation.
233+
234+ :return: The `add_items` method is returning the result of the `post` request made by the
235+ `client.post` method.
236+ -------------------------------
237+ [Example:]
238+ >>> data = {
239+ >>> "release": "release_uid"
240+ >>> "action": "publish",
241+ >>> "locale": ["en-us", "hi-in"]
242+ >>> "reference": true
243+ >>> "items": [
244+ >>> {
245+ >>> "uid": "blt63177c0f00f20b61",
246+ >>> "content_type_uid": "my_blog"
247+ >>> }
248+ >>> ]
249+ >>> }
250+ >>> import contentstack_management
251+ >>> client = contentstack_management.Client(authtoken='your_authtoken')
252+ >>> result = client.stack('api_key').bulk_operation().add_items(data).json()
253+
254+ -------------------------------
255+ """
256+ if headers is not None :
257+ self .client .headers .update (headers )
258+ url = f"{ self .path } /release/items"
259+ data = json .dumps (data )
260+ return self .client .post (url , headers = self .client .headers , data = data , params = self .params )
261+
262+ def update_items (self , data : dict , headers : dict = None ):
263+ """
264+ The update items to bulk operation request allows you to update multiple entries and assets to a bulk operation.
265+
266+ :return: The `update_items` method is returning the result of the `put` request made by the
267+ `client.post` method.
268+ -------------------------------
269+ [Example:]
270+ >>> data = {
271+ >>> "release": "release_uid",
272+ >>> "items": [
273+ >>> {
274+ >>> "uid": "entry_uid",
275+ >>> "locale": "en-us"
276+ >>> },
277+ >>> {
278+ >>> "uid": "entry_uid",
279+ >>> "locale": "en-us",
280+ >>> "variant_id": "entry_variant_id"
281+ >>> }
282+ >>> ]
283+ >>> or
284+ >>> [ '$all' ]
285+ >>> }
286+ >>> import contentstack_management
287+ >>> client = contentstack_management.Client(authtoken='your_authtoken')
288+ >>> result = client.stack('api_key').bulk_operation().update_items(data).json()
289+
290+ -------------------------------
291+ """
292+ if headers is not None :
293+ self .client .headers .update (headers )
294+ url = f"{ self .path } /release/update_items"
295+ data = json .dumps (data )
296+ return self .client .put (url , headers = self .client .headers , data = data , params = self .params )
297+
298+ def job_status (self , job_uid : str , headers : dict = None ):
299+ """
300+ The Job status request allows you to get the status of a bulk operation job.
301+
302+ :param job_uid: The `job_uid` parameter is a string that represents the unique identifier of the job
303+ whose status you want to retrieve
304+ :type job_uid: str
305+ :return: The `job_status` method is returning the result of the `get` request made by the
306+ `client.get` method.
307+ -------------------------------
308+ [Example:]
309+ >>> import contentstack_management
310+ >>> client = contentstack_management.Client(authtoken='your_authtoken')
311+ >>> result = client.stack('api_key').bulk_operation().job_status('job_uid').json()
312+
313+ -------------------------------
314+ """
315+ if job_uid is None :
316+ raise ArgumentException ("job_uid" , "job_uid cannot be None" )
317+ if headers is not None :
318+ self .client .headers .update (headers )
319+ url = f"{ self .path } /jobs/{ quote (job_uid )} "
320+ return self .client .get (url , headers = self .client .headers , params = self .params )
321+
230322
0 commit comments