Skip to content

Commit b4f8237

Browse files
committed
Expose only a single method from the internal API client
1 parent 6b76d2a commit b4f8237

File tree

135 files changed

+814
-798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+814
-798
lines changed

databricks-sdk-java/src/main/java/com/databricks/sdk/core/ApiClient.java

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -198,65 +198,10 @@ protected <I, O> O withJavaType(
198198
}
199199
}
200200

201-
public <O> O HEAD(String path, Class<O> target, Map<String, String> headers) {
202-
return HEAD(path, null, target, headers);
203-
}
204-
205-
public <I, O> O HEAD(String path, I in, Class<O> target, Map<String, String> headers) {
206-
try {
207-
return execute(prepareRequest("HEAD", path, in, headers), target);
208-
} catch (IOException e) {
209-
throw new DatabricksException("IO error: " + e.getMessage(), e);
210-
}
211-
}
212-
213-
public <O> O GET(String path, Class<O> target, Map<String, String> headers) {
214-
return GET(path, null, target, headers);
215-
}
216-
217-
public <I, O> O GET(String path, I in, Class<O> target, Map<String, String> headers) {
218-
try {
219-
return execute(prepareRequest("GET", path, in, headers), target);
220-
} catch (IOException e) {
221-
throw new DatabricksException("IO error: " + e.getMessage(), e);
222-
}
223-
}
224-
225-
public <O> O POST(String path, Class<O> target, Map<String, String> headers) {
226-
try {
227-
return execute(prepareRequest("POST", path, null, headers), target);
228-
} catch (IOException e) {
229-
throw new DatabricksException("IO error: " + e.getMessage(), e);
230-
}
231-
}
232-
233-
public <I, O> O POST(String path, I in, Class<O> target, Map<String, String> headers) {
234-
try {
235-
return execute(prepareRequest("POST", path, in, headers), target);
236-
} catch (IOException e) {
237-
throw new DatabricksException("IO error: " + e.getMessage(), e);
238-
}
239-
}
240-
241-
public <I, O> O PUT(String path, I in, Class<O> target, Map<String, String> headers) {
242-
try {
243-
return execute(prepareRequest("PUT", path, in, headers), target);
244-
} catch (IOException e) {
245-
throw new DatabricksException("IO error: " + e.getMessage(), e);
246-
}
247-
}
248-
249-
public <I, O> O PATCH(String path, I in, Class<O> target, Map<String, String> headers) {
250-
try {
251-
return execute(prepareRequest("PATCH", path, in, headers), target);
252-
} catch (IOException e) {
253-
throw new DatabricksException("IO error: " + e.getMessage(), e);
254-
}
255-
}
256-
257-
public <I, O> O DELETE(String path, I in, Class<O> target, Map<String, String> headers) {
201+
public <I, O> O execute(
202+
String method, String path, I in, Class<O> target, Map<String, String> headers) {
258203
try {
259-
return execute(prepareRequest("DELETE", path, in, headers), target);
204+
return execute(prepareRequest(method, path, in, headers), target);
260205
} catch (IOException e) {
261206
throw new DatabricksException("IO error: " + e.getMessage(), e);
262207
}

databricks-sdk-java/src/main/java/com/databricks/sdk/core/DatabricksConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,9 @@ private OpenIDConnectEndpoints fetchDefaultOidcEndpoints() throws IOException {
586586
.withHttpClient(getHttpClient())
587587
.withGetHostFunc(v -> getHost())
588588
.build();
589-
return apiClient.GET(
589+
return apiClient.execute("GET",
590590
"/oidc/.well-known/oauth-authorization-server",
591+
null,
591592
OpenIDConnectEndpoints.class,
592593
new HashMap<>());
593594
}

databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/RefreshableTokenSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected static Token retrieveToken(
6565
ApiClient apiClient = new ApiClient.Builder().withHttpClient(hc).build();
6666

6767
OAuthResponse resp =
68-
apiClient.POST(
68+
apiClient.execute("POST",
6969
tokenUrl, FormRequest.wrapValuesInList(params), OAuthResponse.class, headers);
7070
if (resp.getErrorCode() != null) {
7171
throw new IllegalArgumentException(resp.getErrorCode() + ": " + resp.getErrorSummary());

databricks-sdk-java/src/main/java/com/databricks/sdk/service/apps/AppsImpl.java

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/billing/BillableUsageImpl.java

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/billing/BudgetsImpl.java

Lines changed: 7 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/billing/LogDeliveryImpl.java

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/billing/UsageDashboardsImpl.java

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/catalog/AccountMetastoreAssignmentsImpl.java

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)