// Code generated by openapi-nexus. DO NOT EDIT.
//
// Array of Inline Objects Test — 1.0.0
// Test case for array of inline objects with snake_case to camelCase conversion (main case from user issue)
package com.example.sdk.runtime;
import okhttp3.Request;
public class ApiKeyAuth implements Authenticator {
private final String key;
private final String name;
private final ApiKeyLocation location;
public ApiKeyAuth(String key, String name, ApiKeyLocation location) {
this.key = key;
this.name = name;
this.location = location;
}
@Override
public void authenticate(Request.Builder builder) {
if (location == ApiKeyLocation.HEADER) {
builder.header(name, key);
} else if (location == ApiKeyLocation.QUERY) {
builder.url(builder.build().url().newBuilder()
.addQueryParameter(name, key)
.build());
}
}
}