Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .codegen/_openapi_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dc3fd0bcbbe1ab3e17b634432d301cc0ee796f05
8e2bc4c67d9f4c3aed496549fed9f3e29e4874b1
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3204,6 +3204,7 @@
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/Language.java linguist-generated=true
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListAclsRequest.java linguist-generated=true
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListAclsResponse.java linguist-generated=true
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListCredentialsRequest.java linguist-generated=true
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListCredentialsResponse.java linguist-generated=true
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListReposRequest.java linguist-generated=true
/home/ubuntu/workspace/databricks-sdk-java/databricks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/ListReposResponse.java linguist-generated=true
Expand Down
5 changes: 5 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@
### Internal Changes

### API Changes
* Add `principalId` field for `com.databricks.sdk.service.workspace.CreateCredentialsRequest`.
* Add `principalId` field for `com.databricks.sdk.service.workspace.DeleteCredentialsRequest`.
* Add `principalId` field for `com.databricks.sdk.service.workspace.GetCredentialsRequest`.
* Add `principalId` field for `com.databricks.sdk.service.workspace.ListCredentialsRequest`.
* Add `principalId` field for `com.databricks.sdk.service.workspace.UpdateCredentialsRequest`.
28 changes: 26 additions & 2 deletions ...sdk-java/src/main/java/com/databricks/sdk/service/workspace/CreateCredentialsRequest.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ public class CreateCredentialsRequest {
@JsonProperty("personal_access_token")
private String personalAccessToken;

/**
* The ID of the service principal whose credentials will be modified. Only service principal
* managers can perform this action.
*/
@JsonProperty("principal_id")
private Long principalId;

public CreateCredentialsRequest setGitEmail(String gitEmail) {
this.gitEmail = gitEmail;
return this;
Expand Down Expand Up @@ -106,6 +113,15 @@ public String getPersonalAccessToken() {
return personalAccessToken;
}

public CreateCredentialsRequest setPrincipalId(Long principalId) {
this.principalId = principalId;
return this;
}

public Long getPrincipalId() {
return principalId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -116,13 +132,20 @@ public boolean equals(Object o) {
&& Objects.equals(gitUsername, that.gitUsername)
&& Objects.equals(isDefaultForProvider, that.isDefaultForProvider)
&& Objects.equals(name, that.name)
&& Objects.equals(personalAccessToken, that.personalAccessToken);
&& Objects.equals(personalAccessToken, that.personalAccessToken)
&& Objects.equals(principalId, that.principalId);
}

@Override
public int hashCode() {
return Objects.hash(
gitEmail, gitProvider, gitUsername, isDefaultForProvider, name, personalAccessToken);
gitEmail,
gitProvider,
gitUsername,
isDefaultForProvider,
name,
personalAccessToken,
principalId);
}

@Override
Expand All @@ -134,6 +157,7 @@ public String toString() {
.add("isDefaultForProvider", isDefaultForProvider)
.add("name", name)
.add("personalAccessToken", personalAccessToken)
.add("principalId", principalId)
.toString();
}
}
24 changes: 22 additions & 2 deletions ...sdk-java/src/main/java/com/databricks/sdk/service/workspace/DeleteCredentialsRequest.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package com.databricks.sdk.service.workspace;

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

/**
* The ID of the service principal whose credentials will be modified. Only service principal
* managers can perform this action.
*/
@JsonIgnore
@QueryParam("principal_id")
private Long principalId;

public DeleteCredentialsRequest setCredentialId(Long credentialId) {
this.credentialId = credentialId;
return this;
Expand All @@ -21,23 +30,34 @@ public Long getCredentialId() {
return credentialId;
}

public DeleteCredentialsRequest setPrincipalId(Long principalId) {
this.principalId = principalId;
return this;
}

public Long getPrincipalId() {
return principalId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DeleteCredentialsRequest that = (DeleteCredentialsRequest) o;
return Objects.equals(credentialId, that.credentialId);
return Objects.equals(credentialId, that.credentialId)
&& Objects.equals(principalId, that.principalId);
}

@Override
public int hashCode() {
return Objects.hash(credentialId);
return Objects.hash(credentialId, principalId);
}

@Override
public String toString() {
return new ToStringer(DeleteCredentialsRequest.class)
.add("credentialId", credentialId)
.add("principalId", principalId)
.toString();
}
}
28 changes: 25 additions & 3 deletions ...ks-sdk-java/src/main/java/com/databricks/sdk/service/workspace/GetCredentialsRequest.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package com.databricks.sdk.service.workspace;

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

/**
* The ID of the service principal whose credentials will be modified. Only service principal
* managers can perform this action.
*/
@JsonIgnore
@QueryParam("principal_id")
private Long principalId;

public GetCredentialsRequest setCredentialId(Long credentialId) {
this.credentialId = credentialId;
return this;
Expand All @@ -21,21 +30,34 @@ public Long getCredentialId() {
return credentialId;
}

public GetCredentialsRequest setPrincipalId(Long principalId) {
this.principalId = principalId;
return this;
}

public Long getPrincipalId() {
return principalId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GetCredentialsRequest that = (GetCredentialsRequest) o;
return Objects.equals(credentialId, that.credentialId);
return Objects.equals(credentialId, that.credentialId)
&& Objects.equals(principalId, that.principalId);
}

@Override
public int hashCode() {
return Objects.hash(credentialId);
return Objects.hash(credentialId, principalId);
}

@Override
public String toString() {
return new ToStringer(GetCredentialsRequest.class).add("credentialId", credentialId).toString();
return new ToStringer(GetCredentialsRequest.class)
.add("credentialId", credentialId)
.add("principalId", principalId)
.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ public GetCredentialsResponse get(GetCredentialsRequest request) {
return impl.get(request);
}

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

/** Updates the specified Git credential. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ public GetCredentialsResponse get(GetCredentialsRequest request) {
}

@Override
public ListCredentialsResponse list() {
public ListCredentialsResponse list(ListCredentialsRequest request) {
String path = "/api/2.0/git-credentials";
try {
Request req = new Request("GET", path);

ApiClient.setQuery(req, request);
req.withHeader("Accept", "application/json");
return apiClient.execute(req, ListCredentialsResponse.class);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public interface GitCredentialsService {
/** Gets the Git credential with the specified credential ID. */
GetCredentialsResponse get(GetCredentialsRequest getCredentialsRequest);

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

/** Updates the specified Git credential. */
void update(UpdateCredentialsRequest updateCredentialsRequest);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.

package com.databricks.sdk.service.workspace;

import com.databricks.sdk.support.Generated;
import com.databricks.sdk.support.QueryParam;
import com.databricks.sdk.support.ToStringer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Objects;

@Generated
public class ListCredentialsRequest {
/**
* The ID of the service principal whose credentials will be modified. Only service principal
* managers can perform this action.
*/
@JsonIgnore
@QueryParam("principal_id")
private Long principalId;

public ListCredentialsRequest setPrincipalId(Long principalId) {
this.principalId = principalId;
return this;
}

public Long getPrincipalId() {
return principalId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ListCredentialsRequest that = (ListCredentialsRequest) o;
return Objects.equals(principalId, that.principalId);
}

@Override
public int hashCode() {
return Objects.hash(principalId);
}

@Override
public String toString() {
return new ToStringer(ListCredentialsRequest.class).add("principalId", principalId).toString();
}
}
23 changes: 21 additions & 2 deletions ...sdk-java/src/main/java/com/databricks/sdk/service/workspace/UpdateCredentialsRequest.java
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public class UpdateCredentialsRequest {
@JsonProperty("personal_access_token")
private String personalAccessToken;

/**
* The ID of the service principal whose credentials will be modified. Only service principal
* managers can perform this action.
*/
@JsonProperty("principal_id")
private Long principalId;

public UpdateCredentialsRequest setCredentialId(Long credentialId) {
this.credentialId = credentialId;
return this;
Expand Down Expand Up @@ -119,6 +126,15 @@ public String getPersonalAccessToken() {
return personalAccessToken;
}

public UpdateCredentialsRequest setPrincipalId(Long principalId) {
this.principalId = principalId;
return this;
}

public Long getPrincipalId() {
return principalId;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -130,7 +146,8 @@ public boolean equals(Object o) {
&& Objects.equals(gitUsername, that.gitUsername)
&& Objects.equals(isDefaultForProvider, that.isDefaultForProvider)
&& Objects.equals(name, that.name)
&& Objects.equals(personalAccessToken, that.personalAccessToken);
&& Objects.equals(personalAccessToken, that.personalAccessToken)
&& Objects.equals(principalId, that.principalId);
}

@Override
Expand All @@ -142,7 +159,8 @@ public int hashCode() {
gitUsername,
isDefaultForProvider,
name,
personalAccessToken);
personalAccessToken,
principalId);
}

@Override
Expand All @@ -155,6 +173,7 @@ public String toString() {
.add("isDefaultForProvider", isDefaultForProvider)
.add("name", name)
.add("personalAccessToken", personalAccessToken)
.add("principalId", principalId)
.toString();
}
}
Loading