diff --git a/README.md b/README.md index aefe70d2..7f881b6d 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ The Xero-NetStandard SDK makes it easy for developers to access Xero's APIs in t - [API Clients](#api-clients) - [Helper Methods](#helper-methods) - [Usage Examples](#usage-examples) +- [Running Test(s) in Local](#running-tests-in-local) - [SDK conventions](#sdk-conventions) - [Contributing](#contributing) @@ -796,6 +797,16 @@ await FilesApi.DeleteFileAssociationAsync(accessToken, xeroTenantId, fileIdGuid, ``` --- +## Running Test(s) in Local +For Running Test cases PRISM Mock Server needs to be started in the local machine. +Steps to Run Test(s) +* Install PRISM from npm using the command: **npm install -g @stoplight/prism-cli** +* Verify Installation: **prism --version** +* Navigate to **Xero-NetStandard--> Xero.NetStandard.OAuth2.Test--> util** folder in the terminal +* Execute the script **./start-prism.sh** +* This will start the PRISM Server in Local +* Run **dotnet test** to run the dotnet test cases. + ## SDK conventions ## Security (state check & Jwt validation) diff --git a/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs b/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs index be796a1e..29265fa5 100755 --- a/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Api/AccountingApiTests.cs @@ -144,9 +144,33 @@ public async Task CreateBankTransactionsTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); BankTransactions bankTransactions = new BankTransactions(); - bankTransactions._BankTransactions = new List { new BankTransaction() }; + bankTransactions._BankTransactions = new List + { + new BankTransaction() + { + Type = BankTransaction.TypeEnum.SPEND, + Contact = new Contact() + { + ContactID = Guid.NewGuid() + }, + LineItems = new List() + { + new LineItem() + { + Description = "Foobar", + Quantity = 1, + UnitAmount = 20, + AccountCode = "000" + } + }, + BankAccount = new Account() + { + Code = "000" + } + } + }; string idempotencyKey = AutoFaker.Generate(); - bool? summarizeErrors = AutoFaker.Generate(); + bool? summarizeErrors = false; var response = await instance.CreateBankTransactionsAsync(accessToken, xeroTenantId, bankTransactions, summarizeErrors, null, idempotencyKey ).ConfigureAwait(false); Assert.IsType(response); } @@ -160,7 +184,48 @@ public async Task CreateBankTransferTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); BankTransfers bankTransfers = new BankTransfers(); - bankTransfers._BankTransfers = new List() { new BankTransfer() }; + bankTransfers._BankTransfers = new List + { + new BankTransfer() + { + FromBankAccount = new Account() + { + Code = "090", + Name = "My Savings", + AccountID = Guid.NewGuid(), + Type = AccountType.BANK, + BankAccountNumber = "123455", + Status = Account.StatusEnum.ACTIVE, + BankAccountType = Account.BankAccountTypeEnum.BANK, + CurrencyCode = CurrencyCode.AFN, + TaxType = "NONE", + EnablePaymentsToAccount = false, + ShowInExpenseClaims = false, + Class = Account.ClassEnum.ASSET, + ReportingCode = "ASS" + }, + ToBankAccount = new Account() + { + Code = "088", + Name = "Business Wells Fargo", + AccountID = Guid.NewGuid(), + Type = AccountType.BANK, + BankAccountNumber = "123455", + Status = Account.StatusEnum.ACTIVE, + BankAccountType = Account.BankAccountTypeEnum.BANK, + CurrencyCode = CurrencyCode.AFN, + TaxType = "NONE", + EnablePaymentsToAccount = false, + ShowInExpenseClaims = false, + Class = Account.ClassEnum.ASSET, + ReportingCode = "ASS" + }, + Amount = 50, + FromIsReconciled = true, + ToIsReconciled = true, + Reference = "SUB 098801" + } + }; var response = await instance.CreateBankTransferAsync(accessToken, xeroTenantId, bankTransfers).ConfigureAwait(false); Assert.IsType(response); } @@ -203,7 +268,62 @@ public async Task CreateBatchPaymentTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); BatchPayments batchPayments = new BatchPayments(); - bool? summarizeErrors = AutoFaker.Generate(); + batchPayments._BatchPayments = new List + { + new BatchPayment() + { + Account = new Account() + { + Code = "088", + Name = "Business Wells Fargo", + AccountID = Guid.NewGuid(), + Type = AccountType.BANK, + BankAccountNumber = "123455", + Status = Account.StatusEnum.ACTIVE, + BankAccountType = Account.BankAccountTypeEnum.BANK, + CurrencyCode = CurrencyCode.AFN, + TaxType = "NONE", + EnablePaymentsToAccount = false, + ShowInExpenseClaims = false, + Class = Account.ClassEnum.ASSET, + ReportingCode = "ASS" + }, + Reference = "SUB 098801", + Date = DateTime.Now, + Payments = new List() + { + new Payment() + { + Account = new Account() + { + Code = "088", + Name = "Business Wells Fargo", + AccountID = Guid.NewGuid(), + Type = AccountType.BANK, + BankAccountNumber = "123455", + Status = Account.StatusEnum.ACTIVE, + BankAccountType = Account.BankAccountTypeEnum.BANK, + CurrencyCode = CurrencyCode.AFN, + TaxType = "NONE", + EnablePaymentsToAccount = false, + ShowInExpenseClaims = false, + Class = Account.ClassEnum.ASSET, + ReportingCode = "ASS" + }, + Date = DateTime.Now, + Amount = 100, + Invoice = new Invoice() + { + InvoiceID = Guid.NewGuid(), + LineItems = new List(), + Contact = new Contact(), + Type = Invoice.TypeEnum.ACCPAY, + } + } + } + } + }; + bool? summarizeErrors = false; var response = await instance.CreateBatchPaymentAsync(accessToken, xeroTenantId, batchPayments, summarizeErrors).ConfigureAwait(false); Assert.IsType(response); } @@ -519,7 +639,39 @@ public async Task CreateManualJournalsTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); ManualJournals manualJournals = new ManualJournals(); - manualJournals._ManualJournals = new List { new ManualJournal() }; + manualJournals._ManualJournals = new List + { + new ManualJournal() + { + Narration = "Journal Desc", + JournalLines = new List() + { + new ManualJournalLine() + { + LineAmount = 100, + AccountCode = "400", + Description = "Journal Description", + }, + { + new ManualJournalLine() + { + LineAmount = -100, + AccountCode = "400", + Description = "Journal Description", + Tracking = new List() + { + new TrackingCategory() + { + Name = "Tracking", + Option = "Region" + } + } + } + } + }, + Date = DateTime.Now, + }, + }; var response = await instance.CreateManualJournalsAsync(accessToken, xeroTenantId, manualJournals).ConfigureAwait(false); Assert.IsType(response); } @@ -879,7 +1031,10 @@ public async Task DeletePaymentTest() string xeroTenantId = AutoFaker.Generate(); Guid paymentID = AutoFaker.Generate(); Payments payments = new Payments(); - PaymentDelete paymentDelete = new PaymentDelete(); + PaymentDelete paymentDelete = new PaymentDelete() + { + Status = "DELETED", + }; var response = await instance.DeletePaymentAsync(accessToken, xeroTenantId, paymentID, paymentDelete).ConfigureAwait(false); Assert.IsType(response); } @@ -1299,7 +1454,7 @@ public async Task GetContactCISSettingsTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - Guid contactID = AutoFaker.Generate(); + Guid contactID = Guid.NewGuid(); var response = await instance.GetContactCISSettingsAsync(accessToken, xeroTenantId, contactID).ConfigureAwait(false); Assert.IsType(response); } @@ -1554,7 +1709,7 @@ public async Task GetInvoiceTest() string xeroTenantId = AutoFaker.Generate(); Guid invoiceID = AutoFaker.Generate(); var response = await instance.GetInvoiceAsync(accessToken, xeroTenantId, invoiceID).ConfigureAwait(false); - Assert.IsType(response); + Assert.IsType>(response._Invoices); } /// @@ -1726,8 +1881,7 @@ public async Task GetJournalTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - Guid journalID = AutoFaker.Generate(); - var response = await instance.GetJournalAsync(accessToken, xeroTenantId, journalID).ConfigureAwait(false); + var response = await instance.GetJournalByNumberAsync(accessToken, xeroTenantId, 100).ConfigureAwait(false); Assert.IsType(response); } @@ -2061,7 +2215,7 @@ public async Task GetPurchaseOrdersTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); DateTime? ifModifiedSince = AutoFaker.Generate(); - string status = AutoFaker.Generate(); + string status = "SUBMITTED"; string dateFrom = AutoFaker.Generate(); string dateTo = AutoFaker.Generate(); string order = AutoFaker.Generate(); @@ -2091,16 +2245,11 @@ public async Task GetQuotesTest() { // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); - DateTime? ifModifiedSince = AutoFaker.Generate(); - DateTime? dateFrom = AutoFaker.Generate(); - DateTime? dateTo = AutoFaker.Generate(); - DateTime? expiryDateFrom = AutoFaker.Generate(); - DateTime? expiryDateTo = AutoFaker.Generate(); - Guid? contactID = AutoFaker.Generate(); - string status = AutoFaker.Generate(); - int? page = AutoFaker.Generate(); + Guid? contactID = Guid.NewGuid(); + string status = "DRAFT"; + int? page = 1; string order = AutoFaker.Generate(); - var response = await instance.GetQuotesAsync(accessToken, xeroTenantId, ifModifiedSince, dateFrom, dateTo, expiryDateFrom, expiryDateTo, contactID, status, page, order).ConfigureAwait(false); + var response = await instance.GetQuotesAsync(accessToken, xeroTenantId, null, null, null, null, null, contactID, status, page, order, "QU-0001").ConfigureAwait(false); Assert.IsType(response); } @@ -2284,7 +2433,7 @@ public async Task GetReportAgedPayablesByContactTest() DateTime? date = AutoFaker.Generate(); DateTime? fromDate = AutoFaker.Generate(); DateTime? toDate = AutoFaker.Generate(); - var response = await instance.GetReportAgedPayablesByContactAsync(accessToken, xeroTenantId, contactId, date, fromDate, toDate).ConfigureAwait(false); + var response = await instance.GetReportAgedPayablesByContactAsync(accessToken, xeroTenantId, contactId, null, null, null).ConfigureAwait(false); Assert.IsType(response); } @@ -2300,7 +2449,7 @@ public async Task GetReportAgedReceivablesByContactTest() DateTime? date = AutoFaker.Generate(); DateTime? fromDate = AutoFaker.Generate(); DateTime? toDate = AutoFaker.Generate(); - var response = await instance.GetReportAgedReceivablesByContactAsync(accessToken, xeroTenantId, contactId, date, fromDate, toDate).ConfigureAwait(false); + var response = await instance.GetReportAgedReceivablesByContactAsync(accessToken, xeroTenantId, contactId, null, null, null).ConfigureAwait(false); Assert.IsType(response); } @@ -2313,13 +2462,13 @@ public async Task GetReportBalanceSheetTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); DateTime date = AutoFaker.Generate(); - int? periods = AutoFaker.Generate(); - string timeframe = AutoFaker.Generate(); + int? periods = 3; + string timeframe = "MONTH"; string trackingOptionID1 = AutoFaker.Generate(); string trackingOptionID2 = AutoFaker.Generate(); - bool? standardLayout = AutoFaker.Generate(); - bool? paymentsOnly = AutoFaker.Generate(); - var response = await instance.GetReportBalanceSheetAsync(accessToken, xeroTenantId, date, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly).ConfigureAwait(false); + bool? standardLayout = false; + bool? paymentsOnly = false; + var response = await instance.GetReportBalanceSheetAsync(accessToken, xeroTenantId, null, periods, timeframe, trackingOptionID1, trackingOptionID2, standardLayout, paymentsOnly).ConfigureAwait(false); Assert.IsType(response); } @@ -2333,7 +2482,7 @@ public async Task GetReportBankSummaryTest() string xeroTenantId = AutoFaker.Generate(); DateTime? fromDate = AutoFaker.Generate(); DateTime? toDate = AutoFaker.Generate(); - var response = await instance.GetReportBankSummaryAsync(accessToken, xeroTenantId, fromDate).ConfigureAwait(false); + var response = await instance.GetReportBankSummaryAsync(accessToken, xeroTenantId, null).ConfigureAwait(false); Assert.IsType(response); } @@ -2348,7 +2497,7 @@ public async Task GetReportBudgetSummaryTest() DateTime? date = AutoFaker.Generate(); int? period = AutoFaker.Generate(); int? timeframe = AutoFaker.Generate(); - var response = await instance.GetReportBudgetSummaryAsync(accessToken, xeroTenantId, date, period, timeframe).ConfigureAwait(false); + var response = await instance.GetReportBudgetSummaryAsync(accessToken, xeroTenantId, null, period, timeframe).ConfigureAwait(false); Assert.IsType(response); } @@ -2361,7 +2510,7 @@ public async Task GetReportExecutiveSummaryTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); DateTime? date = AutoFaker.Generate(); - var response = await instance.GetReportExecutiveSummaryAsync(accessToken, xeroTenantId, date).ConfigureAwait(false); + var response = await instance.GetReportExecutiveSummaryAsync(accessToken, xeroTenantId).ConfigureAwait(false); Assert.IsType(response); } @@ -2376,14 +2525,14 @@ public async Task GetReportProfitAndLossTest() DateTime? fromDate = AutoFaker.Generate(); DateTime? toDate = AutoFaker.Generate(); int? periods = AutoFaker.Generate(); - string timeframe = AutoFaker.Generate(); + string timeframe = "MONTH"; string trackingCategoryID = AutoFaker.Generate(); string trackingCategoryID2 = AutoFaker.Generate(); string trackingOptionID = AutoFaker.Generate(); string trackingOptionID2 = AutoFaker.Generate(); bool? standardLayout = AutoFaker.Generate(); bool? paymentsOnly = AutoFaker.Generate(); - var response = await instance.GetReportProfitAndLossAsync(accessToken, xeroTenantId, fromDate, toDate, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly).ConfigureAwait(false); + var response = await instance.GetReportProfitAndLossAsync(accessToken, xeroTenantId, null, null, periods, timeframe, trackingCategoryID, trackingCategoryID2, trackingOptionID, trackingOptionID2, standardLayout, paymentsOnly).ConfigureAwait(false); Assert.IsType(response); } @@ -2410,7 +2559,7 @@ public async Task GetReportTrialBalanceTest() string xeroTenantId = AutoFaker.Generate(); DateTime? date = AutoFaker.Generate(); bool? paymentsOnly = AutoFaker.Generate(); - var response = await instance.GetReportTrialBalanceAsync(accessToken, xeroTenantId, date, paymentsOnly).ConfigureAwait(false); + var response = await instance.GetReportTrialBalanceAsync(accessToken, xeroTenantId, null, paymentsOnly).ConfigureAwait(false); Assert.IsType(response); } @@ -2596,7 +2745,16 @@ public async Task UpdateContactGroupTest() // TODO uncomment below to test the method and replace null with proper value string xeroTenantId = AutoFaker.Generate(); Guid contactGroupID = AutoFaker.Generate(); - ContactGroups contactGroups = new ContactGroups(); + ContactGroups contactGroups = new ContactGroups() + { + _ContactGroups = new List() + { + new ContactGroup() + { + Name = "Suppliers" + } + } + }; var response = await instance.UpdateContactGroupAsync(accessToken, xeroTenantId, contactGroupID, contactGroups).ConfigureAwait(false); Assert.IsType(response); } diff --git a/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs b/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs index 62e8ad6a..cce9bb32 100644 --- a/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs +++ b/Xero.NetStandard.OAuth2.Test/Api/PayrollAuApiTests.cs @@ -77,9 +77,13 @@ public void InstanceTest() [Fact] public async Task CreateEmployeeTest() { - List employee = - new List { new Employee() }; - var response = await instance.CreateEmployeeAsync(accessToken, xeroTenantId, employee); + List employees = new List { new Employee() + { + FirstName = "Adam", + LastName = "Adamson", + DateOfBirth = new DateTime(2000, 10, 10) + }}; + var response = await instance.CreateEmployeeAsync(accessToken, xeroTenantId, employees); Assert.IsType(response); } @@ -112,7 +116,10 @@ public async Task CreatePayItemTest() [Fact] public async Task CreatePayRunTest() { - List payRun = new List { new PayRun() }; + List payRun = new List { new PayRun() + { + PayrollCalendarID = Guid.Parse("00000000-0000-0000-0000-000000000000") + }}; var response = await instance.CreatePayRunAsync(accessToken, xeroTenantId, payRun); Assert.IsType(response); } @@ -134,7 +141,10 @@ public async Task CreatePayrollCalendarTest() [Fact] public async Task CreateSuperfundTest() { - List superFund = new List { new SuperFund() }; + List superFund = new List { new SuperFund() + { + Type = SuperFundType.REGULATED + }}; var response = await instance.CreateSuperfundAsync(accessToken, xeroTenantId, superFund); Assert.IsType(response); } @@ -145,7 +155,14 @@ public async Task CreateSuperfundTest() [Fact] public async Task CreateTimesheetTest() { - List timesheet = new List { new Timesheet() }; + var startDate = new DateTime(2020, 10, 23); + var endDate = new DateTime(2020, 10, 30); + List timesheet = new List { new Timesheet() + { + EmployeeID = Guid.Parse("00000000-0000-0000-0000-000000000000"), + StartDate = startDate, + EndDate = endDate, + }}; var response = await instance.CreateTimesheetAsync(accessToken, xeroTenantId, timesheet); Assert.IsType(response); } @@ -354,7 +371,12 @@ public async Task GetTimesheetsTest() public async Task UpdateEmployeeTest() { Guid employeeId = AutoFaker.Generate(); - List employee = new List { new Employee() }; + List employee = new List { new Employee() + { + FirstName = "Adam", + LastName = "Adamson", + DateOfBirth = new DateTime(2000, 10, 10) + }}; string idempotencyKey = AutoFaker.Generate(); var response = await instance.UpdateEmployeeAsync(accessToken, xeroTenantId, employeeId, employee, idempotencyKey); Assert.IsType(response); @@ -380,7 +402,10 @@ public async Task UpdatePayRunTest() { Guid payRunID = AutoFaker.Generate(); string idempotencyKey = AutoFaker.Generate(); - List payRun = new List { new PayRun() }; + List payRun = new List { new PayRun() + { + PayrollCalendarID = Guid.Parse("00000000-0000-0000-0000-000000000000") + }}; var response = await instance.UpdatePayRunAsync(accessToken, xeroTenantId, payRunID, payRun, idempotencyKey); Assert.IsType(response); } @@ -406,7 +431,10 @@ public async Task UpdateSuperfundTest() { Guid superFundID = AutoFaker.Generate(); string idempotencyKey = AutoFaker.Generate(); - List superFund = new List { new SuperFund() }; + List superFund = new List { new SuperFund() + { + Type = SuperFundType.REGULATED + }}; var response = await instance.UpdateSuperfundAsync(accessToken, xeroTenantId, superFundID, superFund, idempotencyKey); Assert.IsType(response); } @@ -419,7 +447,14 @@ public async Task UpdateTimesheetTest() { Guid timesheetID = AutoFaker.Generate(); string idempotencyKey = AutoFaker.Generate(); - List timesheet = new List { new Timesheet() }; + var startDate = new DateTime(2020, 10, 23); + var endDate = new DateTime(2020, 10, 30); + List timesheet = new List { new Timesheet() + { + EmployeeID = Guid.Parse("00000000-0000-0000-0000-000000000000"), + StartDate = startDate, + EndDate = endDate, + }}; var response = await instance.UpdateTimesheetAsync(accessToken, xeroTenantId, timesheetID, timesheet, idempotencyKey); Assert.IsType(response); } diff --git a/Xero.NetStandard.OAuth2.Test/appsettings.json b/Xero.NetStandard.OAuth2.Test/appsettings.json index ed89de04..0190fadc 100644 --- a/Xero.NetStandard.OAuth2.Test/appsettings.json +++ b/Xero.NetStandard.OAuth2.Test/appsettings.json @@ -1,7 +1,7 @@ { "XeroConfiguration": { - "AccountingBaseUrl": "https://25faf04a-c71e-40e7-b7ce-f1fae0149465.mock.pstmn.io/api.xro/2.0", - "BankfeedsBaseUrl": "https://3e140044-4914-47dd-b4e1-df0cc040a44f.mock.pstmn.io/bankfeeds.xro/1.0", - "PayrollAuBaseUrl": "https://5f9f95f1-25c8-40dd-8b10-8192c658dd79.mock.pstmn.io/payroll.xro/1.0" + "AccountingBaseUrl": "http://127.0.0.1:4010", + "BankfeedsBaseUrl": "http://127.0.0.1:4013", + "PayrollAuBaseUrl": "http://127.0.0.1:4017" } } \ No newline at end of file diff --git a/Xero.NetStandard.OAuth2.Test/util/start-prism.sh b/Xero.NetStandard.OAuth2.Test/util/start-prism.sh new file mode 100644 index 00000000..b9b564dd --- /dev/null +++ b/Xero.NetStandard.OAuth2.Test/util/start-prism.sh @@ -0,0 +1,9 @@ +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_bankfeeds.yaml --host 127.0.0.1 --port 4013 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-finance.yaml --host 127.0.0.1 --port 4014 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-uk.yaml --host 127.0.0.1 --port 4015 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-nz.yaml --host 127.0.0.1 --port 4016 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-payroll-au.yaml --host 127.0.0.1 --port 4017 & +prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-projects.yaml --host 127.0.0.1 --port 4018 \ No newline at end of file diff --git a/Xero.NetStandard.OAuth2/Api/AccountingApi.cs b/Xero.NetStandard.OAuth2/Api/AccountingApi.cs index fe11292c..e5c98bc3 100644 --- a/Xero.NetStandard.OAuth2/Api/AccountingApi.cs +++ b/Xero.NetStandard.OAuth2/Api/AccountingApi.cs @@ -7779,7 +7779,7 @@ public async System.Threading.Tasks.Task CreateBankTransaction if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -8154,7 +8154,7 @@ public async System.Threading.Tasks.Task CreateBatchPaymentAsync if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -8791,7 +8791,7 @@ public async System.Threading.Tasks.Task CreateContactsAsync (string a if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -8890,7 +8890,7 @@ public async System.Threading.Tasks.Task CreateCreditNoteAllocation if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -8997,7 +8997,7 @@ public async System.Threading.Tasks.Task CreateCreditNoteAttachment if (includeOnline != null) { - requestOptions.QueryParameters.Add("IncludeOnline", includeOnline.ToString()); + requestOptions.QueryParameters.Add("IncludeOnline", includeOnline.ToString().ToLower()); } if (xeroTenantId != null) @@ -9181,7 +9181,7 @@ public async System.Threading.Tasks.Task CreateCreditNotesAsync (st if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -9366,7 +9366,7 @@ public async System.Threading.Tasks.Task CreateEmployeesAsync (string if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -9647,7 +9647,7 @@ public async System.Threading.Tasks.Task CreateInvoiceAttachmentByF if (includeOnline != null) { - requestOptions.QueryParameters.Add("IncludeOnline", includeOnline.ToString()); + requestOptions.QueryParameters.Add("IncludeOnline", includeOnline.ToString().ToLower()); } if (xeroTenantId != null) @@ -9831,7 +9831,7 @@ public async System.Threading.Tasks.Task CreateInvoicesAsync (string a if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -10026,7 +10026,7 @@ public async System.Threading.Tasks.Task CreateItemsAsync (string accessT if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -10401,7 +10401,7 @@ public async System.Threading.Tasks.Task CreateManualJournalsAsy if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -10500,7 +10500,7 @@ public async System.Threading.Tasks.Task CreateOverpaymentAllocatio if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -10939,7 +10939,7 @@ public async System.Threading.Tasks.Task CreatePaymentsAsync (string a if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -11038,7 +11038,7 @@ public async System.Threading.Tasks.Task CreatePrepaymentAllocation if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -11410,7 +11410,7 @@ public async System.Threading.Tasks.Task CreatePurchaseOrdersAsy if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -11691,7 +11691,7 @@ public async System.Threading.Tasks.Task CreateQuotesAsync (string acces if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -12258,7 +12258,7 @@ public async System.Threading.Tasks.Task CreateRepeatingInvoi if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -16858,13 +16858,13 @@ public async System.Threading.Tasks.Task GetContactsAsync (string acce if (includeArchived != null) { - requestOptions.QueryParameters.Add("includeArchived", includeArchived.ToString()); + requestOptions.QueryParameters.Add("includeArchived", includeArchived.ToString().ToLower()); } if (summaryOnly != null) { - requestOptions.QueryParameters.Add("summaryOnly", summaryOnly.ToString()); + requestOptions.QueryParameters.Add("summaryOnly", summaryOnly.ToString().ToLower()); } @@ -18855,13 +18855,13 @@ public async System.Threading.Tasks.Task GetInvoicesAsync (string acce if (includeArchived != null) { - requestOptions.QueryParameters.Add("includeArchived", includeArchived.ToString()); + requestOptions.QueryParameters.Add("includeArchived", includeArchived.ToString().ToLower()); } if (createdByMyApp != null) { - requestOptions.QueryParameters.Add("createdByMyApp", createdByMyApp.ToString()); + requestOptions.QueryParameters.Add("createdByMyApp", createdByMyApp.ToString().ToLower()); } @@ -18878,7 +18878,7 @@ public async System.Threading.Tasks.Task GetInvoicesAsync (string acce if (summaryOnly != null) { - requestOptions.QueryParameters.Add("summaryOnly", summaryOnly.ToString()); + requestOptions.QueryParameters.Add("summaryOnly", summaryOnly.ToString().ToLower()); } @@ -19439,7 +19439,7 @@ public async System.Threading.Tasks.Task GetJournalsAsync (string acce if (paymentsOnly != null) { - requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString()); + requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString().ToLower()); } if (xeroTenantId != null) @@ -24389,13 +24389,13 @@ public async System.Threading.Tasks.Task GetReportBalanceSheetAs if (standardLayout != null) { - requestOptions.QueryParameters.Add("standardLayout", standardLayout.ToString()); + requestOptions.QueryParameters.Add("standardLayout", standardLayout.ToString().ToLower()); } if (paymentsOnly != null) { - requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString()); + requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString().ToLower()); } if (xeroTenantId != null) @@ -24950,13 +24950,13 @@ public async System.Threading.Tasks.Task GetReportProfitAndLossA if (standardLayout != null) { - requestOptions.QueryParameters.Add("standardLayout", standardLayout.ToString()); + requestOptions.QueryParameters.Add("standardLayout", standardLayout.ToString().ToLower()); } if (paymentsOnly != null) { - requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString()); + requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString().ToLower()); } if (xeroTenantId != null) @@ -25132,7 +25132,7 @@ public async System.Threading.Tasks.Task GetReportTrialBalanceAs if (paymentsOnly != null) { - requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString()); + requestOptions.QueryParameters.Add("paymentsOnly", paymentsOnly.ToString().ToLower()); } if (xeroTenantId != null) @@ -25484,7 +25484,7 @@ public async System.Threading.Tasks.Task GetTrackingCategori if (includeArchived != null) { - requestOptions.QueryParameters.Add("includeArchived", includeArchived.ToString()); + requestOptions.QueryParameters.Add("includeArchived", includeArchived.ToString().ToLower()); } if (xeroTenantId != null) @@ -27571,7 +27571,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateBankTra if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -27673,7 +27673,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateContactsAsync ( if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -27766,7 +27766,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateCreditNotesA if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -27868,7 +27868,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateEmployeesAsync if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -27961,7 +27961,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateInvoicesAsync ( if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -28065,7 +28065,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateItemsAsync (string if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } @@ -28167,7 +28167,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateManualJou if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -28258,7 +28258,7 @@ public async System.Threading.Tasks.Task UpdateOrCreatePurchaseO if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -28349,7 +28349,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateQuotesAsync (stri if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) @@ -28440,7 +28440,7 @@ public async System.Threading.Tasks.Task UpdateOrCreateRepeat if (summarizeErrors != null) { - requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString()); + requestOptions.QueryParameters.Add("summarizeErrors", summarizeErrors.ToString().ToLower()); } if (xeroTenantId != null) diff --git a/Xero.NetStandard.OAuth2/Api/FinanceApi.cs b/Xero.NetStandard.OAuth2/Api/FinanceApi.cs index 8a550ce8..0cf23765 100644 --- a/Xero.NetStandard.OAuth2/Api/FinanceApi.cs +++ b/Xero.NetStandard.OAuth2/Api/FinanceApi.cs @@ -953,7 +953,7 @@ public async System.Threading.Tasks.Task GetBan if (summaryOnly != null) { - requestOptions.QueryParameters.Add("SummaryOnly", summaryOnly.ToString()); + requestOptions.QueryParameters.Add("SummaryOnly", summaryOnly.ToString().ToLower()); } if (xeroTenantId != null) @@ -1340,7 +1340,7 @@ public async System.Threading.Tasks.Task GetFinancialSt if (includeManualJournals != null) { - requestOptions.QueryParameters.Add("includeManualJournals", includeManualJournals.ToString()); + requestOptions.QueryParameters.Add("includeManualJournals", includeManualJournals.ToString().ToLower()); } @@ -1458,7 +1458,7 @@ public async System.Threading.Tasks.Task GetFinancialSt if (includeManualJournals != null) { - requestOptions.QueryParameters.Add("includeManualJournals", includeManualJournals.ToString()); + requestOptions.QueryParameters.Add("includeManualJournals", includeManualJournals.ToString().ToLower()); } diff --git a/Xero.NetStandard.OAuth2/Api/PayrollNZApi.cs b/Xero.NetStandard.OAuth2/Api/PayrollNZApi.cs index 37cacfc4..c1f477f9 100644 --- a/Xero.NetStandard.OAuth2/Api/PayrollNZApi.cs +++ b/Xero.NetStandard.OAuth2/Api/PayrollNZApi.cs @@ -6227,7 +6227,7 @@ public async System.Threading.Tasks.Task GetLeaveTypesAsync (string if (activeOnly != null) { - requestOptions.QueryParameters.Add("ActiveOnly", activeOnly.ToString()); + requestOptions.QueryParameters.Add("ActiveOnly", activeOnly.ToString().ToLower()); } if (xeroTenantId != null) diff --git a/Xero.NetStandard.OAuth2/Api/PayrollUkApi.cs b/Xero.NetStandard.OAuth2/Api/PayrollUkApi.cs index 28801ae9..77ad7868 100644 --- a/Xero.NetStandard.OAuth2/Api/PayrollUkApi.cs +++ b/Xero.NetStandard.OAuth2/Api/PayrollUkApi.cs @@ -6323,7 +6323,7 @@ public async System.Threading.Tasks.Task GetLeaveTypesAsync (string if (activeOnly != null) { - requestOptions.QueryParameters.Add("ActiveOnly", activeOnly.ToString()); + requestOptions.QueryParameters.Add("ActiveOnly", activeOnly.ToString().ToLower()); } if (xeroTenantId != null) @@ -7163,7 +7163,7 @@ public async System.Threading.Tasks.Task GetSt if (activeOnly != null) { - requestOptions.QueryParameters.Add("activeOnly", activeOnly.ToString()); + requestOptions.QueryParameters.Add("activeOnly", activeOnly.ToString().ToLower()); } if (xeroTenantId != null) diff --git a/Xero.NetStandard.OAuth2/Api/ProjectApi.cs b/Xero.NetStandard.OAuth2/Api/ProjectApi.cs index 77c9d3d7..9cf95a30 100644 --- a/Xero.NetStandard.OAuth2/Api/ProjectApi.cs +++ b/Xero.NetStandard.OAuth2/Api/ProjectApi.cs @@ -1779,7 +1779,7 @@ public async System.Threading.Tasks.Task GetTimeEntriesAsync (strin if (isChargeable != null) { - requestOptions.QueryParameters.Add("isChargeable", isChargeable.ToString()); + requestOptions.QueryParameters.Add("isChargeable", isChargeable.ToString().ToLower()); }