Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/addTests' into addTests
Browse files Browse the repository at this point in the history
# Conflicts:
#	equinix-openapi-fabric/src/main/java/com/equinix/openapi/fabric/v4/model/CustomField.java
#	equinix-openapi-fabric/src/main/java/com/equinix/openapi/fabric/v4/model/Port.java
  • Loading branch information
tutkat committed Sep 10, 2024
2 parents a8c7f95 + e94b85d commit a62711b
Show file tree
Hide file tree
Showing 7 changed files with 641 additions and 645 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
public class ApiClient {
private String basePath = "https://api.equinix.com";
protected List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>(Arrays.asList(
new ServerConfiguration(
basePath,
"Equinix Inc",
new HashMap<String, ServerVariable>()
)
));
new ServerConfiguration(
basePath,
"Equinix Inc",
new HashMap<String, ServerVariable>()
)
));
protected Integer serverIndex = 0;
protected Map<String, String> serverVariables = null;
private boolean debugging = false;
Expand Down Expand Up @@ -129,7 +129,7 @@ private void initHttpClient(List<Interceptor> interceptors) {
builder.writeTimeout(0, TimeUnit.SECONDS);
builder.callTimeout(60, TimeUnit.SECONDS);
builder.addNetworkInterceptor(getProgressInterceptor());
for (Interceptor interceptor : interceptors) {
for (Interceptor interceptor: interceptors) {
builder.addInterceptor(interceptor);
}
builder.addInterceptor(new HttpLoggingInterceptor().setLevel(Level.BODY));
Expand All @@ -147,8 +147,8 @@ private void init() {
authentications = new HashMap<String, Authentication>();
}

public int getStatusCode() {
return response.code();
public int getStatusCode(){
return response.code();
}

/**
Expand Down Expand Up @@ -390,11 +390,10 @@ public Authentication getAuthentication(String authName) {
return authentications.get(authName);
}

/**
* Helper method to set access token for the first Bearer authentication.
*
* @param bearerToken Bearer token
*/
/**
* Helper method to set access token for the first Bearer authentication.
* @param bearerToken Bearer token
*/
public void setBearerToken(String bearerToken) {
for (Authentication auth : authentications.values()) {
if (auth instanceof HttpBearerAuth) {
Expand Down Expand Up @@ -766,7 +765,7 @@ public String collectionPathParameterToString(String collectionFormat, Collectio
delimiter = "|";
}

StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder() ;
for (Object item : value) {
sb.append(delimiter);
sb.append(parameterToString(item));
Expand Down Expand Up @@ -1248,7 +1247,7 @@ public String buildUrl(String baseUrl, String path, List<Pair> queryParams, List
if (serverIndex != null) {
if (serverIndex < 0 || serverIndex >= servers.size()) {
throw new ArrayIndexOutOfBoundsException(String.format(
"Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size()
"Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size()
));
}
baseURL = servers.get(serverIndex).URL(serverVariables);
Expand Down Expand Up @@ -1381,7 +1380,7 @@ public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), file);
} else if (param.getValue() instanceof List) {
List list = (List) param.getValue();
for (Object item : list) {
for (Object item: list) {
if (item instanceof File) {
addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item);
} else {
Expand Down Expand Up @@ -1461,8 +1460,8 @@ public Response intercept(Interceptor.Chain chain) throws IOException {
if (request.tag() instanceof ApiCallback) {
final ApiCallback callback = (ApiCallback) request.tag();
return originalResponse.newBuilder()
.body(new ProgressResponseBody(originalResponse.body(), callback))
.build();
.body(new ProgressResponseBody(originalResponse.body(), callback))
.build();
}
return originalResponse;
}
Expand Down Expand Up @@ -1527,9 +1526,9 @@ public boolean verify(String hostname, SSLSession session) {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(keyManagers, trustManagers, new SecureRandom());
httpClient = httpClient.newBuilder()
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0])
.hostnameVerifier(hostnameVerifier)
.build();
.sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0])
.hostnameVerifier(hostnameVerifier)
.build();
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
Expand Down
Loading

0 comments on commit a62711b

Please sign in to comment.