Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1299,11 +1299,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

{{#hasOAuthMethods}}
// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1317,8 +1315,10 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
}
}
}

{{/hasOAuthMethods}}
final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

if (statusCode == Status.NO_CONTENT.getStatusCode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1299,11 +1299,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

{{#hasOAuthMethods}}
// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1319,6 +1317,8 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
}

{{/hasOAuthMethods}}
final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

if (statusCode == Status.NO_CONTENT.getStatusCode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1213,10 +1213,8 @@ public <T> ApiResponse<T> invokeAPI(
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1230,6 +1228,8 @@ public <T> ApiResponse<T> invokeAPI(
}
}
}

final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1213,10 +1213,8 @@ public <T> ApiResponse<T> invokeAPI(
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1230,6 +1228,8 @@ public <T> ApiResponse<T> invokeAPI(
}
}
}

final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1295,10 +1295,8 @@ public <T> ApiResponse<T> invokeAPI(
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1313,6 +1311,8 @@ public <T> ApiResponse<T> invokeAPI(
}
}

final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

if (statusCode == Status.NO_CONTENT.getStatusCode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1197,10 +1197,8 @@ public <T> ApiResponse<T> invokeAPI(
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1214,6 +1212,8 @@ public <T> ApiResponse<T> invokeAPI(
}
}
}

final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1197,10 +1197,8 @@ public <T> ApiResponse<T> invokeAPI(
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1214,6 +1212,8 @@ public <T> ApiResponse<T> invokeAPI(
}
}
}

final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1295,10 +1295,8 @@ public <T> ApiResponse<T> invokeAPI(
try {
response = sendRequest(method, invocationBuilder, entity);

final int statusCode = response.getStatusInfo().getStatusCode();

// If OAuth is used and a status 401 is received, renew the access token and retry the request
if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) {
if (authNames != null && response.getStatusInfo().getStatusCode() == Status.UNAUTHORIZED.getStatusCode()) {
for (String authName : authNames) {
Authentication authentication = authentications.get(authName);
if (authentication instanceof OAuth) {
Expand All @@ -1312,6 +1310,8 @@ public <T> ApiResponse<T> invokeAPI(
}
}
}

final int statusCode = response.getStatusInfo().getStatusCode();

Map<String, List<String>> responseHeaders = buildResponseHeaders(response);

Expand Down
Loading