Source:
static HttpPipeline buildPipeline(TablesSharedKeyCredential tablesSharedKeyCredential, TokenCredential tokenCredential, SasTokenCredential sasTokenCredential, String endpoint, RequestRetryOptions retryOptions, HttpLogOptions logOptions, HttpClient httpClient, List<HttpPipelinePolicy> additionalPolicies, Configuration configuration, ClientLogger logger) { List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(getUserAgentPolicy(configuration)); policies.add(new RequestIdPolicy()); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RequestRetryPolicy(retryOptions)); policies.add(new AddDatePolicy()); HttpPipelinePolicy credentialPolicy; if (tablesSharedKeyCredential != null) { credentialPolicy = new TablesSharedKeyCredentialPolicy(tablesSharedKeyCredential); } else if (tokenCredential != null) { httpsValidation(tokenCredential, "bearer token", endpoint, logger); credentialPolicy = new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", getPrimaryEndpointForTokenAuth(endpoint))); } else if (sasTokenCredential != null) { credentialPolicy = new SasTokenCredentialPolicy(sasTokenCredential); } else { credentialPolicy = null; } if (credentialPolicy != null) { policies.add(credentialPolicy); } policies.addAll(additionalPolicies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(getResponseValidationPolicy()); policies.add(new HttpLoggingPolicy(logOptions)); policies.add(new ScrubEtagPolicy()); return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); }

Target:
static HttpPipeline buildPipeline(TablesSharedKeyCredential tablesSharedKeyCredential, TokenCredential tokenCredential, SasTokenCredential sasTokenCredential, String endpoint, RequestRetryOptions retryOptions, HttpLogOptions logOptions, HttpClient httpClient, List<HttpPipelinePolicy> additionalPolicies, Configuration configuration, ClientLogger logger) { List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(getUserAgentPolicy(configuration)); policies.add(new RequestIdPolicy()); policies.add(new AddHeadersPolicy(new HttpHeaders().put("Accept", "application/json"))); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RequestRetryPolicy(retryOptions)); policies.add(new AddDatePolicy()); HttpPipelinePolicy credentialPolicy; if (tablesSharedKeyCredential != null) { credentialPolicy = new TablesSharedKeyCredentialPolicy(tablesSharedKeyCredential); } else if (tokenCredential != null) { httpsValidation(tokenCredential, "bearer token", endpoint, logger); credentialPolicy = new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", getPrimaryEndpointForTokenAuth(endpoint))); } else if (sasTokenCredential != null) { credentialPolicy = new SasTokenCredentialPolicy(sasTokenCredential); } else { credentialPolicy = null; } if (credentialPolicy != null) { policies.add(credentialPolicy); } policies.addAll(additionalPolicies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(getResponseValidationPolicy()); policies.add(new HttpLoggingPolicy(logOptions)); policies.add(new ScrubEtagPolicy()); return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(httpClient) .build(); }