diff --git a/docs/accounting/index.html b/docs/accounting/index.html index 7d0eec57..f6d7137c 100644 --- a/docs/accounting/index.html +++ b/docs/accounting/index.html @@ -7249,18 +7249,9 @@

Usage and SDK Samples

const accountID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -7395,7 +7386,7 @@

Parameters

- byte[] + File
@@ -7413,7 +7404,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -7453,18 +7444,9 @@

Usage and SDK Samples

const bankTransactionID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -7599,7 +7581,7 @@

Parameters

- byte[] + File
@@ -7617,7 +7599,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -8268,18 +8250,9 @@

Usage and SDK Samples

const bankTransferID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -8414,7 +8387,7 @@

Parameters

- byte[] + File
@@ -8432,7 +8405,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -9247,18 +9220,9 @@

Usage and SDK Samples

const contactID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -9393,7 +9357,7 @@

Parameters

- byte[] + File
@@ -9411,7 +9375,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -10433,18 +10397,9 @@

Usage and SDK Samples

const fileName = 'xero-dev.jpg'; const includeOnline = true; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, includeOnline,idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, includeOnline,idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -10579,7 +10534,7 @@

Parameters

- byte[] + File
@@ -10597,7 +10552,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -11753,18 +11708,9 @@

Usage and SDK Samples

const fileName = 'xero-dev.jpg'; const includeOnline = true; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, includeOnline,idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, includeOnline,idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -11899,7 +11845,7 @@

Parameters

- byte[] + File
@@ -11917,7 +11863,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -12951,18 +12897,9 @@

Usage and SDK Samples

const manualJournalID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -13097,7 +13034,7 @@

Parameters

- byte[] + File
@@ -13115,7 +13052,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -15063,18 +15000,9 @@

Usage and SDK Samples

const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createPurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createPurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -15209,7 +15137,7 @@

Parameters

- byte[] + File
@@ -15227,7 +15155,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -15652,18 +15580,9 @@

Usage and SDK Samples

const quoteID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -15798,7 +15717,7 @@

Parameters

- byte[] + File
@@ -15816,7 +15735,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -16454,18 +16373,9 @@

Usage and SDK Samples

const receiptID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -16600,7 +16510,7 @@

Parameters

- byte[] + File
@@ -16618,7 +16528,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -16841,18 +16751,9 @@

Usage and SDK Samples

const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.createRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -16987,7 +16888,7 @@

Parameters

- byte[] + File
@@ -17005,7 +16906,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -38813,18 +38714,9 @@

Usage and SDK Samples

const accountID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateAccountAttachmentByFileName(xeroTenantId, accountID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -38959,7 +38851,7 @@

Parameters

- byte[] + File
@@ -38977,7 +38869,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -39314,18 +39206,9 @@

Usage and SDK Samples

const bankTransactionID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateBankTransactionAttachmentByFileName(xeroTenantId, bankTransactionID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -39460,7 +39343,7 @@

Parameters

- byte[] + File
@@ -39478,7 +39361,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -39518,18 +39401,9 @@

Usage and SDK Samples

const bankTransferID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateBankTransferAttachmentByFileName(xeroTenantId, bankTransferID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -39664,7 +39538,7 @@

Parameters

- byte[] + File
@@ -39682,7 +39556,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -39907,18 +39781,9 @@

Usage and SDK Samples

const contactID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateContactAttachmentByFileName(xeroTenantId, contactID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -40053,7 +39918,7 @@

Parameters

- byte[] + File
@@ -40071,7 +39936,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -40537,18 +40402,9 @@

Usage and SDK Samples

const creditNoteID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateCreditNoteAttachmentByFileName(xeroTenantId, creditNoteID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -40683,7 +40539,7 @@

Parameters

- byte[] + File
@@ -40701,7 +40557,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -41158,18 +41014,9 @@

Usage and SDK Samples

const invoiceID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateInvoiceAttachmentByFileName(xeroTenantId, invoiceID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -41304,7 +41151,7 @@

Parameters

- byte[] + File
@@ -41322,7 +41169,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -41960,18 +41807,9 @@

Usage and SDK Samples

const manualJournalID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateManualJournalAttachmentByFileName(xeroTenantId, manualJournalID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -42106,7 +41944,7 @@

Parameters

- byte[] + File
@@ -42124,7 +41962,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -44432,18 +44270,9 @@

Usage and SDK Samples

const purchaseOrderID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updatePurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updatePurchaseOrderAttachmentByFileName(xeroTenantId, purchaseOrderID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -44578,7 +44407,7 @@

Parameters

- byte[] + File
@@ -44596,7 +44425,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -44829,18 +44658,9 @@

Usage and SDK Samples

const quoteID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateQuoteAttachmentByFileName(xeroTenantId, quoteID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -44975,7 +44795,7 @@

Parameters

- byte[] + File
@@ -44993,7 +44813,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -45254,18 +45074,9 @@

Usage and SDK Samples

const receiptID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateReceiptAttachmentByFileName(xeroTenantId, receiptID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -45400,7 +45211,7 @@

Parameters

- byte[] + File
@@ -45418,7 +45229,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, @@ -45674,18 +45485,9 @@

Usage and SDK Samples

const repeatingInvoiceID = '00000000-0000-0000-0000-000000000000'; const fileName = 'xero-dev.jpg'; const idempotencyKey = 'KEY_VALUE'; -const path = require("path"); -const mime = require("mime-types"); -const pathToUpload = path.resolve(__dirname, "../public/images/xero-dev.jpg"); // determine the path to your file -const body = fs.createReadStream(pathToUpload); // {fs.ReadStream} read the file -const contentType = mime.lookup(fileName); try { - const response = await xero.accountingApi.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey, { - headers: { - "Content-Type": contentType, - } - }); + const response = await xero.accountingApi.updateRepeatingInvoiceAttachmentByFileName(xeroTenantId, repeatingInvoiceID, fileName, body, idempotencyKey); console.log(response.body || response.response.statusCode) } catch (err) { const error = JSON.stringify(err.response.body, null, 2) @@ -45820,7 +45622,7 @@

Parameters

- byte[] + File
@@ -45838,7 +45640,7 @@

Parameters

"application/octet-stream" : { "schema" : { "type" : "string", - "format" : "byte" + "format" : "binary" } } }, diff --git a/src/gen/api/accountingApi.ts b/src/gen/api/accountingApi.ts index 596f0ea1..950ba781 100644 --- a/src/gen/api/accountingApi.ts +++ b/src/gen/api/accountingApi.ts @@ -215,7 +215,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createAccountAttachmentByFileName (xeroTenantId: string, accountID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createAccountAttachmentByFileName (xeroTenantId: string, accountID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Accounts/{AccountID}/Attachments/{FileName}' .replace('{' + 'AccountID' + '}', encodeURIComponent(String(accountID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -260,7 +260,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -304,7 +304,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createBankTransactionAttachmentByFileName (xeroTenantId: string, bankTransactionID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createBankTransactionAttachmentByFileName (xeroTenantId: string, bankTransactionID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/BankTransactions/{BankTransactionID}/Attachments/{FileName}' .replace('{' + 'BankTransactionID' + '}', encodeURIComponent(String(bankTransactionID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -349,7 +349,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -634,7 +634,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createBankTransferAttachmentByFileName (xeroTenantId: string, bankTransferID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createBankTransferAttachmentByFileName (xeroTenantId: string, bankTransferID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/BankTransfers/{BankTransferID}/Attachments/{FileName}' .replace('{' + 'BankTransferID' + '}', encodeURIComponent(String(bankTransferID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -679,7 +679,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -1048,7 +1048,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createContactAttachmentByFileName (xeroTenantId: string, contactID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createContactAttachmentByFileName (xeroTenantId: string, contactID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Contacts/{ContactID}/Attachments/{FileName}' .replace('{' + 'ContactID' + '}', encodeURIComponent(String(contactID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -1093,7 +1093,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -1544,7 +1544,7 @@ export class AccountingApi { * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createCreditNoteAttachmentByFileName (xeroTenantId: string, creditNoteID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , includeOnline?: boolean, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createCreditNoteAttachmentByFileName (xeroTenantId: string, creditNoteID: string, fileName: string, body: RequestFile, includeOnline?: boolean, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/CreditNotes/{CreditNoteID}/Attachments/{FileName}' .replace('{' + 'CreditNoteID' + '}', encodeURIComponent(String(creditNoteID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -1593,7 +1593,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -2117,7 +2117,7 @@ export class AccountingApi { * @param includeOnline Allows an attachment to be seen by the end customer within their online invoice * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createInvoiceAttachmentByFileName (xeroTenantId: string, invoiceID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , includeOnline?: boolean, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createInvoiceAttachmentByFileName (xeroTenantId: string, invoiceID: string, fileName: string, body: RequestFile, includeOnline?: boolean, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Invoices/{InvoiceID}/Attachments/{FileName}' .replace('{' + 'InvoiceID' + '}', encodeURIComponent(String(invoiceID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -2166,7 +2166,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -2619,7 +2619,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createManualJournalAttachmentByFileName (xeroTenantId: string, manualJournalID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createManualJournalAttachmentByFileName (xeroTenantId: string, manualJournalID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/ManualJournals/{ManualJournalID}/Attachments/{FileName}' .replace('{' + 'ManualJournalID' + '}', encodeURIComponent(String(manualJournalID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -2664,7 +2664,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -3520,7 +3520,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createPurchaseOrderAttachmentByFileName (xeroTenantId: string, purchaseOrderID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createPurchaseOrderAttachmentByFileName (xeroTenantId: string, purchaseOrderID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}' .replace('{' + 'PurchaseOrderID' + '}', encodeURIComponent(String(purchaseOrderID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -3565,7 +3565,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -3771,7 +3771,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createQuoteAttachmentByFileName (xeroTenantId: string, quoteID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createQuoteAttachmentByFileName (xeroTenantId: string, quoteID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Quotes/{QuoteID}/Attachments/{FileName}' .replace('{' + 'QuoteID' + '}', encodeURIComponent(String(quoteID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -3816,7 +3816,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -4102,7 +4102,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createReceiptAttachmentByFileName (xeroTenantId: string, receiptID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createReceiptAttachmentByFileName (xeroTenantId: string, receiptID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Receipts/{ReceiptID}/Attachments/{FileName}' .replace('{' + 'ReceiptID' + '}', encodeURIComponent(String(receiptID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -4147,7 +4147,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -4273,7 +4273,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async createRepeatingInvoiceAttachmentByFileName (xeroTenantId: string, repeatingInvoiceID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async createRepeatingInvoiceAttachmentByFileName (xeroTenantId: string, repeatingInvoiceID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}' .replace('{' + 'RepeatingInvoiceID' + '}', encodeURIComponent(String(repeatingInvoiceID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -4318,7 +4318,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -16274,7 +16274,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateAccountAttachmentByFileName (xeroTenantId: string, accountID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateAccountAttachmentByFileName (xeroTenantId: string, accountID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Accounts/{AccountID}/Attachments/{FileName}' .replace('{' + 'AccountID' + '}', encodeURIComponent(String(accountID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -16319,7 +16319,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -16450,7 +16450,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateBankTransactionAttachmentByFileName (xeroTenantId: string, bankTransactionID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateBankTransactionAttachmentByFileName (xeroTenantId: string, bankTransactionID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/BankTransactions/{BankTransactionID}/Attachments/{FileName}' .replace('{' + 'BankTransactionID' + '}', encodeURIComponent(String(bankTransactionID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -16495,7 +16495,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -16538,7 +16538,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateBankTransferAttachmentByFileName (xeroTenantId: string, bankTransferID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateBankTransferAttachmentByFileName (xeroTenantId: string, bankTransferID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/BankTransfers/{BankTransferID}/Attachments/{FileName}' .replace('{' + 'BankTransferID' + '}', encodeURIComponent(String(bankTransferID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -16583,7 +16583,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -16708,7 +16708,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateContactAttachmentByFileName (xeroTenantId: string, contactID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateContactAttachmentByFileName (xeroTenantId: string, contactID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Contacts/{ContactID}/Attachments/{FileName}' .replace('{' + 'ContactID' + '}', encodeURIComponent(String(contactID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -16753,7 +16753,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -16966,7 +16966,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateCreditNoteAttachmentByFileName (xeroTenantId: string, creditNoteID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateCreditNoteAttachmentByFileName (xeroTenantId: string, creditNoteID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/CreditNotes/{CreditNoteID}/Attachments/{FileName}' .replace('{' + 'CreditNoteID' + '}', encodeURIComponent(String(creditNoteID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -17011,7 +17011,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -17224,7 +17224,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateInvoiceAttachmentByFileName (xeroTenantId: string, invoiceID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateInvoiceAttachmentByFileName (xeroTenantId: string, invoiceID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Invoices/{InvoiceID}/Attachments/{FileName}' .replace('{' + 'InvoiceID' + '}', encodeURIComponent(String(invoiceID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -17269,7 +17269,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -17564,7 +17564,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateManualJournalAttachmentByFileName (xeroTenantId: string, manualJournalID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateManualJournalAttachmentByFileName (xeroTenantId: string, manualJournalID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/ManualJournals/{ManualJournalID}/Attachments/{FileName}' .replace('{' + 'ManualJournalID' + '}', encodeURIComponent(String(manualJournalID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -17609,7 +17609,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -18555,7 +18555,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updatePurchaseOrderAttachmentByFileName (xeroTenantId: string, purchaseOrderID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updatePurchaseOrderAttachmentByFileName (xeroTenantId: string, purchaseOrderID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/PurchaseOrders/{PurchaseOrderID}/Attachments/{FileName}' .replace('{' + 'PurchaseOrderID' + '}', encodeURIComponent(String(purchaseOrderID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -18600,7 +18600,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -18726,7 +18726,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateQuoteAttachmentByFileName (xeroTenantId: string, quoteID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateQuoteAttachmentByFileName (xeroTenantId: string, quoteID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Quotes/{QuoteID}/Attachments/{FileName}' .replace('{' + 'QuoteID' + '}', encodeURIComponent(String(quoteID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -18771,7 +18771,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -18902,7 +18902,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateReceiptAttachmentByFileName (xeroTenantId: string, receiptID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateReceiptAttachmentByFileName (xeroTenantId: string, receiptID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/Receipts/{ReceiptID}/Attachments/{FileName}' .replace('{' + 'ReceiptID' + '}', encodeURIComponent(String(receiptID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -18947,7 +18947,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve(); @@ -19073,7 +19073,7 @@ export class AccountingApi { * @param body Byte array of file in body of request * @param idempotencyKey This allows you to safely retry requests without the risk of duplicate processing. 128 character max. */ - public async updateRepeatingInvoiceAttachmentByFileName (xeroTenantId: string, repeatingInvoiceID: string, fileName: string, body: fs.ReadStream | Readable | Buffer , idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { + public async updateRepeatingInvoiceAttachmentByFileName (xeroTenantId: string, repeatingInvoiceID: string, fileName: string, body: RequestFile, idempotencyKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: AxiosResponse; body: Attachments; }> { const localVarPath = this.basePath + '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}' .replace('{' + 'RepeatingInvoiceID' + '}', encodeURIComponent(String(repeatingInvoiceID))) .replace('{' + 'FileName' + '}', encodeURIComponent(String(fileName))); @@ -19118,7 +19118,7 @@ export class AccountingApi { headers: localVarHeaderParams, url: localVarPath, responseType: responseTypeOption, - data: ObjectSerializer.serialize(body, "string"), + data: ObjectSerializer.serialize(body, "RequestFile"), }; let authenticationPromise = Promise.resolve();