Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/url length #331

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/XeroRateLimitException.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Integer getMinuteLimitRemaining() {
/** get retry after seconds
* @return Long the number of seconds to wait before resuming API calls
*/
public long getRetryAfterSeconds() {
lancedfr marked this conversation as resolved.
Show resolved Hide resolved
public Long getRetryAfterSeconds() {
return retryAfterSeconds;
}
}
358 changes: 179 additions & 179 deletions src/main/java/com/xero/api/client/AccountingApi.java

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/main/java/com/xero/api/client/AssetApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ public HttpResponse getAssetsForHttpResponse(
String key = "status";
Object value = status;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -689,7 +689,7 @@ public HttpResponse getAssetsForHttpResponse(
String key = "page";
Object value = page;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -700,7 +700,7 @@ public HttpResponse getAssetsForHttpResponse(
String key = "pageSize";
Object value = pageSize;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -711,7 +711,7 @@ public HttpResponse getAssetsForHttpResponse(
String key = "orderBy";
Object value = orderBy;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -722,7 +722,7 @@ public HttpResponse getAssetsForHttpResponse(
String key = "sortDirection";
Object value = sortDirection;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -733,7 +733,7 @@ public HttpResponse getAssetsForHttpResponse(
String key = "filterBy";
Object value = filterBy;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/xero/api/client/BankFeedsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ public HttpResponse getFeedConnectionsForHttpResponse(
String key = "page";
Object value = page;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -606,7 +606,7 @@ public HttpResponse getFeedConnectionsForHttpResponse(
String key = "pageSize";
Object value = pageSize;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -820,7 +820,7 @@ public HttpResponse getStatementsForHttpResponse(
String key = "page";
Object value = page;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -831,7 +831,7 @@ public HttpResponse getStatementsForHttpResponse(
String key = "pageSize";
Object value = pageSize;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/xero/api/client/FilesApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ public HttpResponse getFilesForHttpResponse(
String key = "pagesize";
Object value = pagesize;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1000,7 +1000,7 @@ public HttpResponse getFilesForHttpResponse(
String key = "page";
Object value = page;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1011,7 +1011,7 @@ public HttpResponse getFilesForHttpResponse(
String key = "sort";
Object value = sort;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -1190,7 +1190,7 @@ public HttpResponse getFoldersForHttpResponse(
String key = "sort";
Object value = sort;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down
52 changes: 26 additions & 26 deletions src/main/java/com/xero/api/client/FinanceApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public HttpResponse getAccountingActivityAccountUsageForHttpResponse(
String key = "startMonth";
Object value = startMonth;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -212,7 +212,7 @@ public HttpResponse getAccountingActivityAccountUsageForHttpResponse(
String key = "endMonth";
Object value = endMonth;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -320,7 +320,7 @@ public HttpResponse getAccountingActivityLockHistoryForHttpResponse(
String key = "endDate";
Object value = endDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -428,7 +428,7 @@ public HttpResponse getAccountingActivityReportHistoryForHttpResponse(
String key = "endDate";
Object value = endDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -539,7 +539,7 @@ public HttpResponse getAccountingActivityUserActivitiesForHttpResponse(
String key = "dataMonth";
Object value = dataMonth;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -687,7 +687,7 @@ public HttpResponse getBankStatementAccountingForHttpResponse(
String key = "BankAccountID";
Object value = bankAccountID;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -698,7 +698,7 @@ public HttpResponse getBankStatementAccountingForHttpResponse(
String key = "FromDate";
Object value = fromDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -709,7 +709,7 @@ public HttpResponse getBankStatementAccountingForHttpResponse(
String key = "ToDate";
Object value = toDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -720,7 +720,7 @@ public HttpResponse getBankStatementAccountingForHttpResponse(
String key = "SummaryOnly";
Object value = summaryOnly;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -871,7 +871,7 @@ public HttpResponse getCashValidationForHttpResponse(
String key = "balanceDate";
Object value = balanceDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -882,7 +882,7 @@ public HttpResponse getCashValidationForHttpResponse(
String key = "asAtSystemDate";
Object value = asAtSystemDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -893,7 +893,7 @@ public HttpResponse getCashValidationForHttpResponse(
String key = "beginDate";
Object value = beginDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -999,7 +999,7 @@ public HttpResponse getFinancialStatementBalanceSheetForHttpResponse(
String key = "balanceDate";
Object value = balanceDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -1114,7 +1114,7 @@ public HttpResponse getFinancialStatementCashflowForHttpResponse(
String key = "startDate";
Object value = startDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1125,7 +1125,7 @@ public HttpResponse getFinancialStatementCashflowForHttpResponse(
String key = "endDate";
Object value = endDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -1265,7 +1265,7 @@ public HttpResponse getFinancialStatementContactsExpenseForHttpResponse(
String key = "contactIds";
Object value = contactIds;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1276,7 +1276,7 @@ public HttpResponse getFinancialStatementContactsExpenseForHttpResponse(
String key = "includeManualJournals";
Object value = includeManualJournals;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1287,7 +1287,7 @@ public HttpResponse getFinancialStatementContactsExpenseForHttpResponse(
String key = "startDate";
Object value = startDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1298,7 +1298,7 @@ public HttpResponse getFinancialStatementContactsExpenseForHttpResponse(
String key = "endDate";
Object value = endDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -1438,7 +1438,7 @@ public HttpResponse getFinancialStatementContactsRevenueForHttpResponse(
String key = "contactIds";
Object value = contactIds;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1449,7 +1449,7 @@ public HttpResponse getFinancialStatementContactsRevenueForHttpResponse(
String key = "includeManualJournals";
Object value = includeManualJournals;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1460,7 +1460,7 @@ public HttpResponse getFinancialStatementContactsRevenueForHttpResponse(
String key = "startDate";
Object value = startDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1471,7 +1471,7 @@ public HttpResponse getFinancialStatementContactsRevenueForHttpResponse(
String key = "endDate";
Object value = endDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -1580,7 +1580,7 @@ public HttpResponse getFinancialStatementProfitAndLossForHttpResponse(
String key = "startDate";
Object value = startDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand All @@ -1591,7 +1591,7 @@ public HttpResponse getFinancialStatementProfitAndLossForHttpResponse(
String key = "endDate";
Object value = endDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down Expand Up @@ -1693,7 +1693,7 @@ public HttpResponse getFinancialStatementTrialBalanceForHttpResponse(
String key = "endDate";
Object value = endDate;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/client/IdentityApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public HttpResponse getConnectionsForHttpResponse(String accessToken, UUID authE
String key = "authEventId";
Object value = authEventId;
if (value instanceof Collection) {
uriBuilder = uriBuilder.queryParam(key, ((Collection) value).toArray());
uriBuilder = uriBuilder.queryParam(key, String.join(",", (Collection) value));
} else if (value instanceof Object[]) {
uriBuilder = uriBuilder.queryParam(key, (Object[]) value);
} else {
Expand Down
Loading