@@ -54,9 +54,6 @@ public class AuthApi {
5454 private final Consumer <HttpResponse <InputStream >> memberVarResponseInterceptor ;
5555 private final Consumer <HttpResponse <String >> memberVarAsyncResponseInterceptor ;
5656
57- // Custom headers to be sent with every request from this API client
58- private final Map <String , String > extraHeaders = new java .util .HashMap <>();
59-
6057 public AuthApi () {
6158 this (Configuration .getDefaultApiClient ());
6259 }
@@ -71,27 +68,6 @@ public AuthApi(ApiClient apiClient) {
7168 memberVarAsyncResponseInterceptor = apiClient .getAsyncResponseInterceptor ();
7269 }
7370
74- /**
75- * Add a custom header to be sent with every request from this API client.
76- * @param name Header name
77- * @param value Header value
78- * @return this
79- */
80- public AuthApi addHeader (String name , String value ) {
81- this .extraHeaders .put (name , value );
82- return this ;
83- }
84-
85- /**
86- * Remove a custom header.
87- * @param name Header name
88- * @return this
89- */
90- public AuthApi removeHeader (String name ) {
91- this .extraHeaders .remove (name );
92- return this ;
93- }
94-
9571
9672 protected ApiException getApiException (String operationId , HttpResponse <InputStream > response ) throws IOException {
9773 String body = response .body () == null ? null : new String (response .body ().readAllBytes ());
@@ -113,7 +89,18 @@ private String formatExceptionMessage(String operationId, int statusCode, String
11389 * @throws ApiException if fails to make API call
11490 */
11591 public String testAuthHttpBasic () throws ApiException {
116- ApiResponse <String > localVarResponse = testAuthHttpBasicWithHttpInfo ();
92+ return testAuthHttpBasic (null );
93+ }
94+
95+ /**
96+ * To test HTTP basic authentication
97+ * To test HTTP basic authentication
98+ * @param headers Optional headers to include in the request
99+ * @return String
100+ * @throws ApiException if fails to make API call
101+ */
102+ public String testAuthHttpBasic (Map <String , String > headers ) throws ApiException {
103+ ApiResponse <String > localVarResponse = testAuthHttpBasicWithHttpInfo (headers );
117104 return localVarResponse .getData ();
118105 }
119106
@@ -124,7 +111,18 @@ public String testAuthHttpBasic() throws ApiException {
124111 * @throws ApiException if fails to make API call
125112 */
126113 public ApiResponse <String > testAuthHttpBasicWithHttpInfo () throws ApiException {
127- HttpRequest .Builder localVarRequestBuilder = testAuthHttpBasicRequestBuilder ();
114+ return testAuthHttpBasicWithHttpInfo (null );
115+ }
116+
117+ /**
118+ * To test HTTP basic authentication
119+ * To test HTTP basic authentication
120+ * @param headers Optional headers to include in the request
121+ * @return ApiResponse<String>
122+ * @throws ApiException if fails to make API call
123+ */
124+ public ApiResponse <String > testAuthHttpBasicWithHttpInfo (Map <String , String > headers ) throws ApiException {
125+ HttpRequest .Builder localVarRequestBuilder = testAuthHttpBasicRequestBuilder (headers );
128126 try {
129127 HttpResponse <InputStream > localVarResponse = memberVarHttpClient .send (
130128 localVarRequestBuilder .build (),
@@ -160,7 +158,7 @@ public ApiResponse<String> testAuthHttpBasicWithHttpInfo() throws ApiException {
160158 }
161159 }
162160
163- private HttpRequest .Builder testAuthHttpBasicRequestBuilder () throws ApiException {
161+ private HttpRequest .Builder testAuthHttpBasicRequestBuilder (Map < String , String > headers ) throws ApiException {
164162
165163 HttpRequest .Builder localVarRequestBuilder = HttpRequest .newBuilder ();
166164
@@ -174,9 +172,11 @@ private HttpRequest.Builder testAuthHttpBasicRequestBuilder() throws ApiExceptio
174172 if (memberVarReadTimeout != null ) {
175173 localVarRequestBuilder .timeout (memberVarReadTimeout );
176174 }
177- // Add custom headers
178- for (Map .Entry <String , String > entry : extraHeaders .entrySet ()) {
179- localVarRequestBuilder .header (entry .getKey (), entry .getValue ());
175+ // Add custom headers if provided
176+ if (headers != null ) {
177+ for (Map .Entry <String , String > entry : headers .entrySet ()) {
178+ localVarRequestBuilder .header (entry .getKey (), entry .getValue ());
179+ }
180180 }
181181 if (memberVarInterceptor != null ) {
182182 memberVarInterceptor .accept (localVarRequestBuilder );
@@ -191,7 +191,18 @@ private HttpRequest.Builder testAuthHttpBasicRequestBuilder() throws ApiExceptio
191191 * @throws ApiException if fails to make API call
192192 */
193193 public String testAuthHttpBearer () throws ApiException {
194- ApiResponse <String > localVarResponse = testAuthHttpBearerWithHttpInfo ();
194+ return testAuthHttpBearer (null );
195+ }
196+
197+ /**
198+ * To test HTTP bearer authentication
199+ * To test HTTP bearer authentication
200+ * @param headers Optional headers to include in the request
201+ * @return String
202+ * @throws ApiException if fails to make API call
203+ */
204+ public String testAuthHttpBearer (Map <String , String > headers ) throws ApiException {
205+ ApiResponse <String > localVarResponse = testAuthHttpBearerWithHttpInfo (headers );
195206 return localVarResponse .getData ();
196207 }
197208
@@ -202,7 +213,18 @@ public String testAuthHttpBearer() throws ApiException {
202213 * @throws ApiException if fails to make API call
203214 */
204215 public ApiResponse <String > testAuthHttpBearerWithHttpInfo () throws ApiException {
205- HttpRequest .Builder localVarRequestBuilder = testAuthHttpBearerRequestBuilder ();
216+ return testAuthHttpBearerWithHttpInfo (null );
217+ }
218+
219+ /**
220+ * To test HTTP bearer authentication
221+ * To test HTTP bearer authentication
222+ * @param headers Optional headers to include in the request
223+ * @return ApiResponse<String>
224+ * @throws ApiException if fails to make API call
225+ */
226+ public ApiResponse <String > testAuthHttpBearerWithHttpInfo (Map <String , String > headers ) throws ApiException {
227+ HttpRequest .Builder localVarRequestBuilder = testAuthHttpBearerRequestBuilder (headers );
206228 try {
207229 HttpResponse <InputStream > localVarResponse = memberVarHttpClient .send (
208230 localVarRequestBuilder .build (),
@@ -238,7 +260,7 @@ public ApiResponse<String> testAuthHttpBearerWithHttpInfo() throws ApiException
238260 }
239261 }
240262
241- private HttpRequest .Builder testAuthHttpBearerRequestBuilder () throws ApiException {
263+ private HttpRequest .Builder testAuthHttpBearerRequestBuilder (Map < String , String > headers ) throws ApiException {
242264
243265 HttpRequest .Builder localVarRequestBuilder = HttpRequest .newBuilder ();
244266
@@ -252,9 +274,11 @@ private HttpRequest.Builder testAuthHttpBearerRequestBuilder() throws ApiExcepti
252274 if (memberVarReadTimeout != null ) {
253275 localVarRequestBuilder .timeout (memberVarReadTimeout );
254276 }
255- // Add custom headers
256- for (Map .Entry <String , String > entry : extraHeaders .entrySet ()) {
257- localVarRequestBuilder .header (entry .getKey (), entry .getValue ());
277+ // Add custom headers if provided
278+ if (headers != null ) {
279+ for (Map .Entry <String , String > entry : headers .entrySet ()) {
280+ localVarRequestBuilder .header (entry .getKey (), entry .getValue ());
281+ }
258282 }
259283 if (memberVarInterceptor != null ) {
260284 memberVarInterceptor .accept (localVarRequestBuilder );
0 commit comments