@@ -94,12 +94,13 @@ export function BulkOperation (http, data = {}) {
9494 * @returns {Promise<Object> } Response Object.
9595 * @param {String } params.job_id - The ID of the job.
9696 * @param {String } [params.bulk_version] - The bulk version.
97+ * @param {String } [params.api_version] - The API version.
9798 * @example
9899 * client.stack({ api_key: 'api_key'}).bulkOperation().jobStatus({ job_id: 'job_id' })
99100 * .then((response) => { console.log(response) })
100101 */
101102 // eslint-disable-next-line camelcase
102- this . jobStatus = async ( { job_id, bulk_version = '' } ) => {
103+ this . jobStatus = async ( { job_id, bulk_version = '' , api_version = '' } ) => {
103104 // eslint-disable-next-line camelcase
104105 this . urlPath = `/bulk/jobs/${ job_id } `
105106 const headers = {
@@ -109,12 +110,18 @@ export function BulkOperation (http, data = {}) {
109110 }
110111 // eslint-disable-next-line camelcase
111112 if ( bulk_version ) headers . headers . bulk_version = bulk_version
113+ // eslint-disable-next-line camelcase
114+ if ( api_version ) headers . headers . api_version = api_version
112115 try {
113116 const response = await http . get ( this . urlPath , headers )
114117 if ( response . data ) {
118+ // eslint-disable-next-line camelcase
119+ if ( api_version ) delete headers . headers . api_version
115120 return response . data
116121 }
117122 } catch ( error ) {
123+ // eslint-disable-next-line camelcase
124+ if ( api_version ) delete headers . headers . api_version
118125 console . error ( error )
119126 }
120127 }
0 commit comments