Skip to content

Commit 161be0f

Browse files
Update SDK API to 8e2bc4c67d9f4c3aed496549fed9f3e29e4874b1 (#623)
This PR updates the SDK to the latest API changes. NO_CHANGELOG=true Co-authored-by: databricks-ci-ghec-1[bot] <184311507+databricks-ci-ghec-1[bot]@users.noreply.github.com>
1 parent e95d299 commit 161be0f

File tree

11 files changed

+155
-16
lines changed

11 files changed

+155
-16
lines changed

.codegen/_openapi_sha

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
dc3fd0bcbbe1ab3e17b634432d301cc0ee796f05
1+
8e2bc4c67d9f4c3aed496549fed9f3e29e4874b1

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,6 +3204,7 @@
32043204
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/Language.java linguist-generated=true
32053205
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListAclsRequest.java linguist-generated=true
32063206
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListAclsResponse.java linguist-generated=true
3207+
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListCredentialsRequest.java linguist-generated=true
32073208
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListCredentialsResponse.java linguist-generated=true
32083209
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListReposRequest.java linguist-generated=true
32093210
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListReposResponse.java linguist-generated=true

NEXT_CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@
1313
### Internal Changes
1414

1515
### API Changes
16+
* Add `principalId` field for `com.databricks.sdk.service.workspace.CreateCredentialsRequest`.
17+
* Add `principalId` field for `com.databricks.sdk.service.workspace.DeleteCredentialsRequest`.
18+
* Add `principalId` field for `com.databricks.sdk.service.workspace.GetCredentialsRequest`.
19+
* Add `principalId` field for `com.databricks.sdk.service.workspace.ListCredentialsRequest`.
20+
* Add `principalId` field for `com.databricks.sdk.service.workspace.UpdateCredentialsRequest`.

databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/CreateCredentialsRequest.java

100755100644
Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ public class CreateCredentialsRequest {
5252
@JsonProperty("personal_access_token")
5353
private String personalAccessToken;
5454

55+
/**
56+
* The ID of the service principal whose credentials will be modified. Only service principal
57+
* managers can perform this action.
58+
*/
59+
@JsonProperty("principal_id")
60+
private Long principalId;
61+
5562
public CreateCredentialsRequest setGitEmail(String gitEmail) {
5663
this.gitEmail = gitEmail;
5764
return this;
@@ -106,6 +113,15 @@ public String getPersonalAccessToken() {
106113
return personalAccessToken;
107114
}
108115

116+
public CreateCredentialsRequest setPrincipalId(Long principalId) {
117+
this.principalId = principalId;
118+
return this;
119+
}
120+
121+
public Long getPrincipalId() {
122+
return principalId;
123+
}
124+
109125
@Override
110126
public boolean equals(Object o) {
111127
if (this == o) return true;
@@ -116,13 +132,20 @@ public boolean equals(Object o) {
116132
&& Objects.equals(gitUsername, that.gitUsername)
117133
&& Objects.equals(isDefaultForProvider, that.isDefaultForProvider)
118134
&& Objects.equals(name, that.name)
119-
&& Objects.equals(personalAccessToken, that.personalAccessToken);
135+
&& Objects.equals(personalAccessToken, that.personalAccessToken)
136+
&& Objects.equals(principalId, that.principalId);
120137
}
121138

122139
@Override
123140
public int hashCode() {
124141
return Objects.hash(
125-
gitEmail, gitProvider, gitUsername, isDefaultForProvider, name, personalAccessToken);
142+
gitEmail,
143+
gitProvider,
144+
gitUsername,
145+
isDefaultForProvider,
146+
name,
147+
personalAccessToken,
148+
principalId);
126149
}
127150

128151
@Override
@@ -134,6 +157,7 @@ public String toString() {
134157
.add("isDefaultForProvider", isDefaultForProvider)
135158
.add("name", name)
136159
.add("personalAccessToken", personalAccessToken)
160+
.add("principalId", principalId)
137161
.toString();
138162
}
139163
}

databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/DeleteCredentialsRequest.java

100755100644
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package com.databricks.sdk.service.workspace;
44

55
import com.databricks.sdk.support.Generated;
6+
import com.databricks.sdk.support.QueryParam;
67
import com.databricks.sdk.support.ToStringer;
78
import com.fasterxml.jackson.annotation.JsonIgnore;
89
import java.util.Objects;
@@ -12,6 +13,14 @@ public class DeleteCredentialsRequest {
1213
/** The ID for the corresponding credential to access. */
1314
@JsonIgnore private Long credentialId;
1415

16+
/**
17+
* The ID of the service principal whose credentials will be modified. Only service principal
18+
* managers can perform this action.
19+
*/
20+
@JsonIgnore
21+
@QueryParam("principal_id")
22+
private Long principalId;
23+
1524
public DeleteCredentialsRequest setCredentialId(Long credentialId) {
1625
this.credentialId = credentialId;
1726
return this;
@@ -21,23 +30,34 @@ public Long getCredentialId() {
2130
return credentialId;
2231
}
2332

33+
public DeleteCredentialsRequest setPrincipalId(Long principalId) {
34+
this.principalId = principalId;
35+
return this;
36+
}
37+
38+
public Long getPrincipalId() {
39+
return principalId;
40+
}
41+
2442
@Override
2543
public boolean equals(Object o) {
2644
if (this == o) return true;
2745
if (o == null || getClass() != o.getClass()) return false;
2846
DeleteCredentialsRequest that = (DeleteCredentialsRequest) o;
29-
return Objects.equals(credentialId, that.credentialId);
47+
return Objects.equals(credentialId, that.credentialId)
48+
&& Objects.equals(principalId, that.principalId);
3049
}
3150

3251
@Override
3352
public int hashCode() {
34-
return Objects.hash(credentialId);
53+
return Objects.hash(credentialId, principalId);
3554
}
3655

3756
@Override
3857
public String toString() {
3958
return new ToStringer(DeleteCredentialsRequest.class)
4059
.add("credentialId", credentialId)
60+
.add("principalId", principalId)
4161
.toString();
4262
}
4363
}

databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/GetCredentialsRequest.java

100755100644
Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package com.databricks.sdk.service.workspace;
44

55
import com.databricks.sdk.support.Generated;
6+
import com.databricks.sdk.support.QueryParam;
67
import com.databricks.sdk.support.ToStringer;
78
import com.fasterxml.jackson.annotation.JsonIgnore;
89
import java.util.Objects;
@@ -12,6 +13,14 @@ public class GetCredentialsRequest {
1213
/** The ID for the corresponding credential to access. */
1314
@JsonIgnore private Long credentialId;
1415

16+
/**
17+
* The ID of the service principal whose credentials will be modified. Only service principal
18+
* managers can perform this action.
19+
*/
20+
@JsonIgnore
21+
@QueryParam("principal_id")
22+
private Long principalId;
23+
1524
public GetCredentialsRequest setCredentialId(Long credentialId) {
1625
this.credentialId = credentialId;
1726
return this;
@@ -21,21 +30,34 @@ public Long getCredentialId() {
2130
return credentialId;
2231
}
2332

33+
public GetCredentialsRequest setPrincipalId(Long principalId) {
34+
this.principalId = principalId;
35+
return this;
36+
}
37+
38+
public Long getPrincipalId() {
39+
return principalId;
40+
}
41+
2442
@Override
2543
public boolean equals(Object o) {
2644
if (this == o) return true;
2745
if (o == null || getClass() != o.getClass()) return false;
2846
GetCredentialsRequest that = (GetCredentialsRequest) o;
29-
return Objects.equals(credentialId, that.credentialId);
47+
return Objects.equals(credentialId, that.credentialId)
48+
&& Objects.equals(principalId, that.principalId);
3049
}
3150

3251
@Override
3352
public int hashCode() {
34-
return Objects.hash(credentialId);
53+
return Objects.hash(credentialId, principalId);
3554
}
3655

3756
@Override
3857
public String toString() {
39-
return new ToStringer(GetCredentialsRequest.class).add("credentialId", credentialId).toString();
58+
return new ToStringer(GetCredentialsRequest.class)
59+
.add("credentialId", credentialId)
60+
.add("principalId", principalId)
61+
.toString();
4062
}
4163
}

databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/GitCredentialsAPI.java

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ public GetCredentialsResponse get(GetCredentialsRequest request) {
5757
return impl.get(request);
5858
}
5959

60-
/** Lists the calling user's Git credentials. One credential per user is supported. */
61-
public Iterable<CredentialInfo> list() {
60+
/** Lists the calling user's Git credentials. */
61+
public Iterable<CredentialInfo> list(ListCredentialsRequest request) {
6262
return new Paginator<>(
63-
null, (Void v) -> impl.list(), ListCredentialsResponse::getCredentials, response -> null);
63+
request, impl::list, ListCredentialsResponse::getCredentials, response -> null);
6464
}
6565

6666
/** Updates the specified Git credential. */

databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/GitCredentialsImpl.java

100755100644
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ public GetCredentialsResponse get(GetCredentialsRequest request) {
6060
}
6161

6262
@Override
63-
public ListCredentialsResponse list() {
63+
public ListCredentialsResponse list(ListCredentialsRequest request) {
6464
String path = "/api/2.0/git-credentials";
6565
try {
6666
Request req = new Request("GET", path);
6767

68+
ApiClient.setQuery(req, request);
6869
req.withHeader("Accept", "application/json");
6970
return apiClient.execute(req, ListCredentialsResponse.class);
7071
} catch (IOException e) {

databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/GitCredentialsService.java

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public interface GitCredentialsService {
2929
/** Gets the Git credential with the specified credential ID. */
3030
GetCredentialsResponse get(GetCredentialsRequest getCredentialsRequest);
3131

32-
/** Lists the calling user's Git credentials. One credential per user is supported. */
33-
ListCredentialsResponse list();
32+
/** Lists the calling user's Git credentials. */
33+
ListCredentialsResponse list(ListCredentialsRequest listCredentialsRequest);
3434

3535
/** Updates the specified Git credential. */
3636
void update(UpdateCredentialsRequest updateCredentialsRequest);
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
2+
3+
package com.databricks.sdk.service.workspace;
4+
5+
import com.databricks.sdk.support.Generated;
6+
import com.databricks.sdk.support.QueryParam;
7+
import com.databricks.sdk.support.ToStringer;
8+
import com.fasterxml.jackson.annotation.JsonIgnore;
9+
import java.util.Objects;
10+
11+
@Generated
12+
public class ListCredentialsRequest {
13+
/**
14+
* The ID of the service principal whose credentials will be modified. Only service principal
15+
* managers can perform this action.
16+
*/
17+
@JsonIgnore
18+
@QueryParam("principal_id")
19+
private Long principalId;
20+
21+
public ListCredentialsRequest setPrincipalId(Long principalId) {
22+
this.principalId = principalId;
23+
return this;
24+
}
25+
26+
public Long getPrincipalId() {
27+
return principalId;
28+
}
29+
30+
@Override
31+
public boolean equals(Object o) {
32+
if (this == o) return true;
33+
if (o == null || getClass() != o.getClass()) return false;
34+
ListCredentialsRequest that = (ListCredentialsRequest) o;
35+
return Objects.equals(principalId, that.principalId);
36+
}
37+
38+
@Override
39+
public int hashCode() {
40+
return Objects.hash(principalId);
41+
}
42+
43+
@Override
44+
public String toString() {
45+
return new ToStringer(ListCredentialsRequest.class).add("principalId", principalId).toString();
46+
}
47+
}

0 commit comments

Comments
 (0)