diff --git a/.codegen/_last_sha b/.codegen/_last_sha index 7dec683f4..b2c9c89d9 100644 --- a/.codegen/_last_sha +++ b/.codegen/_last_sha @@ -1 +1 @@ -e70a22231111e4c68080544b08d28ab7aa0d86b5 \ No newline at end of file +b8604ef9fce0fe42f56306cd36ef5e11e013074a \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 725449b79..cab8ca62a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Version changelog +## Release v0.175.0 (2026-11-04) + +### API Changes +* Add `com.databricks.sdk.service.lakewatch` package. +* Add `workspaceClient.lakewatch()` service. +* Add `cancelBatch()`, `createBatch()`, `getBatch()` and `listBatches()` methods for `workspaceClient.aiFunctions()` service. +* Add `createFeatureSpec()`, `deleteFeatureSpec()` and `getFeatureSpec()` methods for `workspaceClient.featureEngineering()` service. +* [Breaking] Remove `CRITICAL` enum value for `com.databricks.sdk.service.jobs.AiRuntimeTaskPriorityClass`. + ## Release v0.174.0 (2026-11-03) ### API Changes diff --git a/databricks-sdk-java/lockfile.json b/databricks-sdk-java/lockfile.json index 5562252e2..93e2e7e80 100644 --- a/databricks-sdk-java/lockfile.json +++ b/databricks-sdk-java/lockfile.json @@ -1,7 +1,7 @@ { "artifactId": "databricks-sdk-java", "groupId": "com.databricks", - "version": "0.174.0", + "version": "0.175.0", "lockFileVersion": 1, "dependencies": [ { diff --git a/databricks-sdk-java/pom.xml b/databricks-sdk-java/pom.xml index c4a3deac0..a6bbe65c6 100644 --- a/databricks-sdk-java/pom.xml +++ b/databricks-sdk-java/pom.xml @@ -5,7 +5,7 @@ com.databricks databricks-sdk-parent - 0.174.0 + 0.175.0 databricks-sdk-java Databricks SDK for Java diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java index b4ce5c01c..36e5aff18 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/WorkspaceClient.java @@ -162,6 +162,8 @@ import com.databricks.sdk.service.jobs.PolicyComplianceForJobsService; import com.databricks.sdk.service.knowledgeassistants.KnowledgeAssistantsAPI; import com.databricks.sdk.service.knowledgeassistants.KnowledgeAssistantsService; +import com.databricks.sdk.service.lakewatch.LakewatchAPI; +import com.databricks.sdk.service.lakewatch.LakewatchService; import com.databricks.sdk.service.marketplace.ConsumerFulfillmentsAPI; import com.databricks.sdk.service.marketplace.ConsumerFulfillmentsService; import com.databricks.sdk.service.marketplace.ConsumerInstallationsAPI; @@ -359,6 +361,7 @@ public class WorkspaceClient { private KnowledgeAssistantsAPI knowledgeAssistantsAPI; private LakeviewAPI lakeviewAPI; private LakeviewEmbeddedAPI lakeviewEmbeddedAPI; + private LakewatchAPI lakewatchAPI; private LibrariesAPI librariesAPI; private MaterializedFeaturesAPI materializedFeaturesAPI; private MetastoresAPI metastoresAPI; @@ -507,6 +510,7 @@ public WorkspaceClient(DatabricksConfig config) { knowledgeAssistantsAPI = new KnowledgeAssistantsAPI(apiClient); lakeviewAPI = new LakeviewAPI(apiClient); lakeviewEmbeddedAPI = new LakeviewEmbeddedAPI(apiClient); + lakewatchAPI = new LakewatchAPI(apiClient); librariesAPI = new LibrariesAPI(apiClient); materializedFeaturesAPI = new MaterializedFeaturesAPI(apiClient); metastoresAPI = new MetastoresAPI(apiClient); @@ -1302,6 +1306,14 @@ public LakeviewEmbeddedAPI lakeviewEmbedded() { return lakeviewEmbeddedAPI; } + /** + * Manage Lakewatch: security-analytics data sources, detection rules, and per-catalog + * configuration. + */ + public LakewatchAPI lakewatch() { + return lakewatchAPI; + } + /** * The Libraries API allows you to install and uninstall libraries and get the status of libraries * on a cluster. @@ -3063,6 +3075,17 @@ public WorkspaceClient withLakeviewEmbeddedAPI(LakeviewEmbeddedAPI lakeviewEmbed return this; } + /** Replace the default LakewatchService with a custom implementation. */ + public WorkspaceClient withLakewatchImpl(LakewatchService lakewatch) { + return this.withLakewatchAPI(new LakewatchAPI(lakewatch)); + } + + /** Replace the default LakewatchAPI with a custom implementation. */ + public WorkspaceClient withLakewatchAPI(LakewatchAPI lakewatch) { + this.lakewatchAPI = lakewatch; + return this; + } + /** Replace the default LibrariesService with a custom implementation. */ public WorkspaceClient withLibrariesImpl(LibrariesService libraries) { return this.withLibrariesAPI(new LibrariesAPI(libraries)); diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java index 7c9fb2204..97a8a79e9 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/core/UserAgent.java @@ -36,7 +36,7 @@ public String getValue() { // TODO: check if reading from // /META-INF/maven/com.databricks/databrics-sdk-java/pom.properties // or getClass().getPackage().getImplementationVersion() is enough. - private static final String version = "0.174.0"; + private static final String version = "0.175.0"; public static void withProduct(String product, String productVersion) { UserAgent.product = product; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java index 9044b6f01..bef2d4032 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsAPI.java @@ -5,6 +5,7 @@ import com.databricks.sdk.core.logging.Logger; import com.databricks.sdk.core.logging.LoggerFactory; import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.Paginator; /** Transform and enrich data with AI on Databricks. */ @Generated @@ -54,6 +55,46 @@ public AiParseDocumentResponse aiParseDocument(AiParseDocumentRequest request) { return impl.aiParseDocument(request); } + /** + * Cancel a batch. Cancellation is asynchronous: requests in flight drain first, so read the batch + * to observe the `CANCELLING` and `CANCELLED` statuses. + */ + public CancelBatchResponse cancelBatch(CancelBatchRequest request) { + return impl.cancelBatch(request); + } + + /** + * Run an AI function over every request in a file on a Unity Catalog volume. The batch runs + * asynchronously; read it to follow its progress. + */ + public Batch createBatch(CreateBatchRequest request) { + return impl.createBatch(request); + } + + public Batch getBatch(String name) { + return getBatch(new GetBatchRequest().setName(name)); + } + + /** Read one batch, with its status and progress. */ + public Batch getBatch(GetBatchRequest request) { + return impl.getBatch(request); + } + + /** List the batches the caller created in this workspace. */ + public Iterable listBatches(ListBatchesRequest request) { + return Paginator.newTokenPagination( + request, + impl::listBatches, + ListBatchesResponse::getBatches, + response -> { + String token = response.getNextPageToken(); + if (token == null || token.isEmpty()) { + return null; + } + return request.setPageToken(token); + }); + } + public AiFunctionsService impl() { return impl; } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsImpl.java index 2a311d65d..0c41cbc40 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsImpl.java @@ -87,4 +87,74 @@ public AiParseDocumentResponse aiParseDocument(AiParseDocumentRequest request) { throw new DatabricksException("IO error: " + e.getMessage(), e); } } + + @Override + public CancelBatchResponse cancelBatch(CancelBatchRequest request) { + String path = String.format("/api/2.0/ai-functions/batches/%s/cancel", request.getName()); + try { + Request req = new Request("POST", path, apiClient.serialize(request)); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, CancelBatchResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public Batch createBatch(CreateBatchRequest request) { + String path = "/api/2.0/ai-functions/batches"; + try { + Request req = new Request("POST", path, apiClient.serialize(request.getBatch())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Batch.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public Batch getBatch(GetBatchRequest request) { + String path = String.format("/api/2.0/ai-functions/batches/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Batch.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public ListBatchesResponse listBatches(ListBatchesRequest request) { + String path = "/api/2.0/ai-functions/batches"; + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, ListBatchesResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java index b6a21d11d..e3b17a61f 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/AiFunctionsService.java @@ -34,4 +34,22 @@ public interface AiFunctionsService { /** Parse structured content from unstructured documents. */ AiParseDocumentResponse aiParseDocument(AiParseDocumentRequest aiParseDocumentRequest); + + /** + * Cancel a batch. Cancellation is asynchronous: requests in flight drain first, so read the batch + * to observe the `CANCELLING` and `CANCELLED` statuses. + */ + CancelBatchResponse cancelBatch(CancelBatchRequest cancelBatchRequest); + + /** + * Run an AI function over every request in a file on a Unity Catalog volume. The batch runs + * asynchronously; read it to follow its progress. + */ + Batch createBatch(CreateBatchRequest createBatchRequest); + + /** Read one batch, with its status and progress. */ + Batch getBatch(GetBatchRequest getBatchRequest); + + /** List the batches the caller created in this workspace. */ + ListBatchesResponse listBatches(ListBatchesRequest listBatchesRequest); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/Batch.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/Batch.java new file mode 100644 index 000000000..e965a788e --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/Batch.java @@ -0,0 +1,184 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.protobuf.Timestamp; +import java.util.Map; +import java.util.Objects; + +/** An asynchronous run of one AI function over a file of requests. */ +@Generated +public class Batch { + /** Output only. Time the batch was created. */ + @JsonProperty("create_time") + private Timestamp createTime; + + /** The AI function to run for every request, for example `ai_extract`. */ + @JsonProperty("endpoint") + private String endpoint; + + /** Path of the JSONL input file on a Unity Catalog volume. Each line is one request. */ + @JsonProperty("input_ref") + private String inputRef; + + /** ID of the batch, in the form `batch_`. The service assigns it. */ + @JsonProperty("name") + private String name; + + /** + * Path on a Unity Catalog volume to write the JSONL output to. When it is omitted, the output + * stays on Databricks-managed storage and a finished batch returns a short-lived download URL in + * this field instead. + */ + @JsonProperty("output_ref") + private String outputRef; + + /** Function options applied to every request in the batch, for example the extraction schema. */ + @JsonProperty("params") + private Map params; + + /** + * Output only. Percentage of the requests that finished, from 0 to 100. Returned when one batch + * is read, not when batches are listed. + */ + @JsonProperty("percent_complete") + private Double percentComplete; + + /** Output only. Request counts. Returned when one batch is read, not when batches are listed. */ + @JsonProperty("request_counts") + private BatchRequestCounts requestCounts; + + /** Output only. Status of the batch. */ + @JsonProperty("status") + private BatchStatus status; + + public Batch setCreateTime(Timestamp createTime) { + this.createTime = createTime; + return this; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public Batch setEndpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + public String getEndpoint() { + return endpoint; + } + + public Batch setInputRef(String inputRef) { + this.inputRef = inputRef; + return this; + } + + public String getInputRef() { + return inputRef; + } + + public Batch setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public Batch setOutputRef(String outputRef) { + this.outputRef = outputRef; + return this; + } + + public String getOutputRef() { + return outputRef; + } + + public Batch setParams(Map params) { + this.params = params; + return this; + } + + public Map getParams() { + return params; + } + + public Batch setPercentComplete(Double percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + public Double getPercentComplete() { + return percentComplete; + } + + public Batch setRequestCounts(BatchRequestCounts requestCounts) { + this.requestCounts = requestCounts; + return this; + } + + public BatchRequestCounts getRequestCounts() { + return requestCounts; + } + + public Batch setStatus(BatchStatus status) { + this.status = status; + return this; + } + + public BatchStatus getStatus() { + return status; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Batch that = (Batch) o; + return Objects.equals(createTime, that.createTime) + && Objects.equals(endpoint, that.endpoint) + && Objects.equals(inputRef, that.inputRef) + && Objects.equals(name, that.name) + && Objects.equals(outputRef, that.outputRef) + && Objects.equals(params, that.params) + && Objects.equals(percentComplete, that.percentComplete) + && Objects.equals(requestCounts, that.requestCounts) + && Objects.equals(status, that.status); + } + + @Override + public int hashCode() { + return Objects.hash( + createTime, + endpoint, + inputRef, + name, + outputRef, + params, + percentComplete, + requestCounts, + status); + } + + @Override + public String toString() { + return new ToStringer(Batch.class) + .add("createTime", createTime) + .add("endpoint", endpoint) + .add("inputRef", inputRef) + .add("name", name) + .add("outputRef", outputRef) + .add("params", params) + .add("percentComplete", percentComplete) + .add("requestCounts", requestCounts) + .add("status", status) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/BatchRequestCounts.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/BatchRequestCounts.java new file mode 100644 index 000000000..2ce0c5cff --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/BatchRequestCounts.java @@ -0,0 +1,75 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Counts of the requests in a batch. */ +@Generated +public class BatchRequestCounts { + /** Output only. Number of requests that failed and will not be retried. */ + @JsonProperty("failed") + private Long failed; + + /** Output only. Number of requests that finished successfully. */ + @JsonProperty("succeeded") + private Long succeeded; + + /** Output only. Number of requests in the input file. */ + @JsonProperty("total") + private Long total; + + public BatchRequestCounts setFailed(Long failed) { + this.failed = failed; + return this; + } + + public Long getFailed() { + return failed; + } + + public BatchRequestCounts setSucceeded(Long succeeded) { + this.succeeded = succeeded; + return this; + } + + public Long getSucceeded() { + return succeeded; + } + + public BatchRequestCounts setTotal(Long total) { + this.total = total; + return this; + } + + public Long getTotal() { + return total; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + BatchRequestCounts that = (BatchRequestCounts) o; + return Objects.equals(failed, that.failed) + && Objects.equals(succeeded, that.succeeded) + && Objects.equals(total, that.total); + } + + @Override + public int hashCode() { + return Objects.hash(failed, succeeded, total); + } + + @Override + public String toString() { + return new ToStringer(BatchRequestCounts.class) + .add("failed", failed) + .add("succeeded", succeeded) + .add("total", total) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/BatchStatus.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/BatchStatus.java new file mode 100644 index 000000000..cf197b8cc --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/BatchStatus.java @@ -0,0 +1,18 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; + +/** The status of a batch. */ +@Generated +public enum BatchStatus { + CANCELLED, + CANCELLING, + COMPLETED, + EXPIRED, + FAILED, + FINALIZING, + IN_PROGRESS, + PENDING, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchRequest.java new file mode 100644 index 000000000..5ebf1201d --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class CancelBatchRequest { + /** ID of the batch, in the form `batch_`. */ + @JsonIgnore private String name; + + public CancelBatchRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CancelBatchRequest that = (CancelBatchRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(CancelBatchRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchResponse.java new file mode 100644 index 000000000..eb6d0d3ff --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CancelBatchResponse.java @@ -0,0 +1,28 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import java.util.Objects; + +@Generated +public class CancelBatchResponse { + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + return new ToStringer(CancelBatchResponse.class).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CreateBatchRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CreateBatchRequest.java new file mode 100644 index 000000000..46937b009 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/CreateBatchRequest.java @@ -0,0 +1,42 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class CreateBatchRequest { + /** The batch to create. */ + @JsonProperty("batch") + private Batch batch; + + public CreateBatchRequest setBatch(Batch batch) { + this.batch = batch; + return this; + } + + public Batch getBatch() { + return batch; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CreateBatchRequest that = (CreateBatchRequest) o; + return Objects.equals(batch, that.batch); + } + + @Override + public int hashCode() { + return Objects.hash(batch); + } + + @Override + public String toString() { + return new ToStringer(CreateBatchRequest.class).add("batch", batch).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/GetBatchRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/GetBatchRequest.java new file mode 100644 index 000000000..14e8dc4b1 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/GetBatchRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetBatchRequest { + /** ID of the batch, in the form `batch_`. */ + @JsonIgnore private String name; + + public GetBatchRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetBatchRequest that = (GetBatchRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetBatchRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/ListBatchesRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/ListBatchesRequest.java new file mode 100644 index 000000000..f728d96f7 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/ListBatchesRequest.java @@ -0,0 +1,61 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +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 ListBatchesRequest { + /** Maximum number of batches to return in one page. */ + @JsonIgnore + @QueryParam("page_size") + private Long pageSize; + + /** Page token from an earlier response. Omit it to read the first page. */ + @JsonIgnore + @QueryParam("page_token") + private String pageToken; + + public ListBatchesRequest setPageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + public Long getPageSize() { + return pageSize; + } + + public ListBatchesRequest setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPageToken() { + return pageToken; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListBatchesRequest that = (ListBatchesRequest) o; + return Objects.equals(pageSize, that.pageSize) && Objects.equals(pageToken, that.pageToken); + } + + @Override + public int hashCode() { + return Objects.hash(pageSize, pageToken); + } + + @Override + public String toString() { + return new ToStringer(ListBatchesRequest.class) + .add("pageSize", pageSize) + .add("pageToken", pageToken) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/ListBatchesResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/ListBatchesResponse.java new file mode 100644 index 000000000..f2cd0cfbd --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/aifunctions/ListBatchesResponse.java @@ -0,0 +1,60 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.aifunctions; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +@Generated +public class ListBatchesResponse { + /** The batches in this page. */ + @JsonProperty("batches") + private Collection batches; + + /** Token that reads the next page. It is empty on the last page. */ + @JsonProperty("next_page_token") + private String nextPageToken; + + public ListBatchesResponse setBatches(Collection batches) { + this.batches = batches; + return this; + } + + public Collection getBatches() { + return batches; + } + + public ListBatchesResponse setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListBatchesResponse that = (ListBatchesResponse) o; + return Objects.equals(batches, that.batches) + && Objects.equals(nextPageToken, that.nextPageToken); + } + + @Override + public int hashCode() { + return Objects.hash(batches, nextPageToken); + } + + @Override + public String toString() { + return new ToStringer(ListBatchesResponse.class) + .add("batches", batches) + .add("nextPageToken", nextPageToken) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateInstancePool.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateInstancePool.java index b46f9c56b..39594374d 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateInstancePool.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/CreateInstancePool.java @@ -91,7 +91,7 @@ public class CreateInstancePool { * This field encodes, through a single value, the resources available to each of the Spark nodes * in this cluster. For example, the Spark nodes can be provisioned and optimized for memory or * compute intensive workloads. A list of available node types can be retrieved by using the - * [clusters/listNodeTypes] API call. + * [clusters/listNodeTypes] API call. The node type cannot be changed after the pool is created. * *

[clusters/listNodeTypes]: https://docs.databricks.com/api/workspace/clusters/listnodetypes */ diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/EditInstancePool.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/EditInstancePool.java index ea4d5d4e7..8dd20a9b3 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/EditInstancePool.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/EditInstancePool.java @@ -56,7 +56,7 @@ public class EditInstancePool { * This field encodes, through a single value, the resources available to each of the Spark nodes * in this cluster. For example, the Spark nodes can be provisioned and optimized for memory or * compute intensive workloads. A list of available node types can be retrieved by using the - * [clusters/listNodeTypes] API call. + * [clusters/listNodeTypes] API call. The node type cannot be changed after the pool is created. * *

[clusters/listNodeTypes]: https://docs.databricks.com/api/workspace/clusters/listnodetypes */ diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetInstancePool.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetInstancePool.java index 34093c31d..413dc1d0a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetInstancePool.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/GetInstancePool.java @@ -109,7 +109,7 @@ public class GetInstancePool { * This field encodes, through a single value, the resources available to each of the Spark nodes * in this cluster. For example, the Spark nodes can be provisioned and optimized for memory or * compute intensive workloads. A list of available node types can be retrieved by using the - * [clusters/listNodeTypes] API call. + * [clusters/listNodeTypes] API call. The node type cannot be changed after the pool is created. * *

[clusters/listNodeTypes]: https://docs.databricks.com/api/workspace/clusters/listnodetypes */ diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/InstancePoolAndStats.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/InstancePoolAndStats.java index a2d48745e..2db4d4309 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/InstancePoolAndStats.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/compute/InstancePoolAndStats.java @@ -109,7 +109,7 @@ public class InstancePoolAndStats { * This field encodes, through a single value, the resources available to each of the Spark nodes * in this cluster. For example, the Spark nodes can be provisioned and optimized for memory or * compute intensive workloads. A list of available node types can be retrieved by using the - * [clusters/listNodeTypes] API call. + * [clusters/listNodeTypes] API call. The node type cannot be changed after the pool is created. * *

[clusters/listNodeTypes]: https://docs.databricks.com/api/workspace/clusters/listnodetypes */ diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java index e776a88af..fb2d7b5d1 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/dataquality/NotificationDestination.java @@ -12,10 +12,10 @@ @Generated public class NotificationDestination { /** - * The notification-destination IDs (Slack / Teams / webhook) to send the notification to. The - * destinations must already exist in the workspace; a workspace admin creates them. A maximum of - * 25 destination IDs is supported. Only supported on schema monitors, via - * `anomaly_detection_config`; rejected on table monitors. + * The notification-destination IDs (Slack / Teams / webhook / Asana / ServiceNow / AWS + * EventBridge) to send the notification to. The destinations must already exist in the workspace; + * a workspace admin creates them. A maximum of 25 destination IDs is supported. Only supported on + * schema monitors, via `anomaly_detection_config`; rejected on table monitors. */ @JsonProperty("destination_ids") private Collection destinationIds; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java index 15e2c8a76..0e2408698 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/jobs/AiRuntimeTaskPriorityClass.java @@ -11,6 +11,5 @@ @Generated public enum AiRuntimeTaskPriorityClass { BEST_EFFORT, - CRITICAL, NORMAL, } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AlertConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AlertConfig.java new file mode 100644 index 000000000..1c1ed740e --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AlertConfig.java @@ -0,0 +1,250 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Objects; + +/** Per-catalog alert-related config. Singleton. Name format: `catalogs/{catalog}/alertConfig`. */ +@Generated +public class AlertConfig { + /** + * Window for collating Signals into security alerts. Duration string — compact + * day/hour/minute/second components, e.g. `1d`, `12h` (see `Schedule.at_least_every` in + * common.proto for the grammar). Reads return the value as supplied. When unset or empty, the + * window is `1h`; the window in effect is reported in + * `effective_default_security_alert_collation_window`. + */ + @JsonProperty("default_security_alert_collation_window") + private String defaultSecurityAlertCollationWindow; + + /** + * Window for collating SystemEvents into system alerts. Duration string — compact + * day/hour/minute/second components, e.g. `1d`, `12h` (see `Schedule.at_least_every` in + * common.proto for the grammar). Reads return the value as supplied. When unset or empty, the + * window is `1d`; the window in effect is reported in + * `effective_default_system_alert_collation_window`. + */ + @JsonProperty("default_system_alert_collation_window") + private String defaultSystemAlertCollationWindow; + + /** + * The security alert collation window in effect: `default_security_alert_collation_window` when + * set, otherwise `1h`. + */ + @JsonProperty("effective_default_security_alert_collation_window") + private String effectiveDefaultSecurityAlertCollationWindow; + + /** + * The system alert collation window in effect: `default_system_alert_collation_window` when set, + * otherwise `1d`. + */ + @JsonProperty("effective_default_system_alert_collation_window") + private String effectiveDefaultSystemAlertCollationWindow; + + /** + * Opaque entity tag for optimistic concurrency. Returned on every read; pass it back as the + * Update request's `etag` to make the update conditional on the resource being unchanged. + */ + @JsonProperty("etag") + private String etag; + + /** */ + @JsonProperty("name") + private String name; + + /** + * Export destination for security alerts. When unset, export is off and reads return `{"enabled": + * false}`. + */ + @JsonProperty("security_alert_export_config") + private ExportConfig securityAlertExportConfig; + + /** + * Export destination for system alerts. When unset, export is off and reads return `{"enabled": + * false}`. + */ + @JsonProperty("system_alert_export_config") + private ExportConfig systemAlertExportConfig; + + /** */ + @JsonProperty("update_time") + private Timestamp updateTime; + + /** */ + @JsonProperty("updated_by") + private Principal updatedBy; + + /** + * Monotonic version, bumped on each update. Informational; use `etag` for optimistic concurrency. + */ + @JsonProperty("version") + private Long version; + + public AlertConfig setDefaultSecurityAlertCollationWindow( + String defaultSecurityAlertCollationWindow) { + this.defaultSecurityAlertCollationWindow = defaultSecurityAlertCollationWindow; + return this; + } + + public String getDefaultSecurityAlertCollationWindow() { + return defaultSecurityAlertCollationWindow; + } + + public AlertConfig setDefaultSystemAlertCollationWindow( + String defaultSystemAlertCollationWindow) { + this.defaultSystemAlertCollationWindow = defaultSystemAlertCollationWindow; + return this; + } + + public String getDefaultSystemAlertCollationWindow() { + return defaultSystemAlertCollationWindow; + } + + public AlertConfig setEffectiveDefaultSecurityAlertCollationWindow( + String effectiveDefaultSecurityAlertCollationWindow) { + this.effectiveDefaultSecurityAlertCollationWindow = + effectiveDefaultSecurityAlertCollationWindow; + return this; + } + + public String getEffectiveDefaultSecurityAlertCollationWindow() { + return effectiveDefaultSecurityAlertCollationWindow; + } + + public AlertConfig setEffectiveDefaultSystemAlertCollationWindow( + String effectiveDefaultSystemAlertCollationWindow) { + this.effectiveDefaultSystemAlertCollationWindow = effectiveDefaultSystemAlertCollationWindow; + return this; + } + + public String getEffectiveDefaultSystemAlertCollationWindow() { + return effectiveDefaultSystemAlertCollationWindow; + } + + public AlertConfig setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public AlertConfig setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public AlertConfig setSecurityAlertExportConfig(ExportConfig securityAlertExportConfig) { + this.securityAlertExportConfig = securityAlertExportConfig; + return this; + } + + public ExportConfig getSecurityAlertExportConfig() { + return securityAlertExportConfig; + } + + public AlertConfig setSystemAlertExportConfig(ExportConfig systemAlertExportConfig) { + this.systemAlertExportConfig = systemAlertExportConfig; + return this; + } + + public ExportConfig getSystemAlertExportConfig() { + return systemAlertExportConfig; + } + + public AlertConfig setUpdateTime(Timestamp updateTime) { + this.updateTime = updateTime; + return this; + } + + public Timestamp getUpdateTime() { + return updateTime; + } + + public AlertConfig setUpdatedBy(Principal updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + public Principal getUpdatedBy() { + return updatedBy; + } + + public AlertConfig setVersion(Long version) { + this.version = version; + return this; + } + + public Long getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + AlertConfig that = (AlertConfig) o; + return Objects.equals( + defaultSecurityAlertCollationWindow, that.defaultSecurityAlertCollationWindow) + && Objects.equals(defaultSystemAlertCollationWindow, that.defaultSystemAlertCollationWindow) + && Objects.equals( + effectiveDefaultSecurityAlertCollationWindow, + that.effectiveDefaultSecurityAlertCollationWindow) + && Objects.equals( + effectiveDefaultSystemAlertCollationWindow, + that.effectiveDefaultSystemAlertCollationWindow) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(securityAlertExportConfig, that.securityAlertExportConfig) + && Objects.equals(systemAlertExportConfig, that.systemAlertExportConfig) + && Objects.equals(updateTime, that.updateTime) + && Objects.equals(updatedBy, that.updatedBy) + && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultSecurityAlertCollationWindow, + defaultSystemAlertCollationWindow, + effectiveDefaultSecurityAlertCollationWindow, + effectiveDefaultSystemAlertCollationWindow, + etag, + name, + securityAlertExportConfig, + systemAlertExportConfig, + updateTime, + updatedBy, + version); + } + + @Override + public String toString() { + return new ToStringer(AlertConfig.class) + .add("defaultSecurityAlertCollationWindow", defaultSecurityAlertCollationWindow) + .add("defaultSystemAlertCollationWindow", defaultSystemAlertCollationWindow) + .add( + "effectiveDefaultSecurityAlertCollationWindow", + effectiveDefaultSecurityAlertCollationWindow) + .add( + "effectiveDefaultSystemAlertCollationWindow", + effectiveDefaultSystemAlertCollationWindow) + .add("etag", etag) + .add("name", name) + .add("securityAlertExportConfig", securityAlertExportConfig) + .add("systemAlertExportConfig", systemAlertExportConfig) + .add("updateTime", updateTime) + .add("updatedBy", updatedBy) + .add("version", version) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AutoLoader.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AutoLoader.java new file mode 100644 index 000000000..2d5cd2d83 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AutoLoader.java @@ -0,0 +1,267 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; + +/** + * Ingests files from cloud storage with Auto Loader. Mutually exclusive with + * `unity_catalog_connection` and `existing_table`. + */ +@Generated +public class AutoLoader { + /** + * Name of the workspace secret scope that holds the AWS access key ID and secret access key, + * under the keys `awsAccessKeyId` and `awsSecretAccessKey`. + */ + @JsonProperty("aws_secret_scope") + private String awsSecretScope; + + /** + * Whether ingestion started with the files already present at `location`. Populated on get, + * create, and update responses. + */ + @JsonProperty("effective_include_existing_files") + private Boolean effectiveIncludeExistingFiles; + + /** + * The table that the raw data is written to: `raw_table` in the datasource's catalog and schema, + * under their current Unity Catalog names. Populated on get, create, and update responses. + */ + @JsonProperty("effective_raw_table") + private TableName effectiveRawTable; + + /** + * How to unwrap a transport envelope around the source records before parsing. Supported only for + * the JSON and JSONL formats. If unset, each source record is treated as one event. + */ + @JsonProperty("envelope") + private Envelope envelope; + + /** File format of the source files. Required. */ + @JsonProperty("format") + private AutoLoaderFormat format; + + /** + * Format-specific parsing options, passed to Auto Loader. Supported for the CSV, JSON, JSONL, and + * XML formats, each of which accepts a fixed set of options. The XML format requires the `rowTag` + * option. + */ + @JsonProperty("format_options") + private Map formatOptions; + + /** + * Whether to ingest the files already present at `location` when ingestion first starts. Set true + * to ingest the existing files and then every new file. Set false, or leave unset, to ingest only + * files that arrive after the datasource starts. Defaults to false. Cannot be changed after + * creation. Reads return the value as supplied; the setting in effect is reported in + * `effective_include_existing_files`. + */ + @JsonProperty("include_existing_files") + private Boolean includeExistingFiles; + + /** + * URI of the source files: a path in a Unity Catalog volume or external location, or a cloud + * storage URL such as an Amazon S3 path. Required, including when new files are discovered + * through `queue_url`. Cannot be changed after creation. + */ + @JsonProperty("location") + private String location; + + /** + * Hive-style partition columns to derive from the source file paths. If unset, no partition + * columns are derived. + */ + @JsonProperty("override_partition_columns") + private Collection overridePartitionColumns; + + /** + * URL of a customer-managed Amazon SQS queue that receives file-arrival notifications. Set it to + * discover new files through the queue. If unset, new files are discovered through the file + * events of the source's Unity Catalog external location when it has them configured, and by + * directory listing otherwise. Cannot be changed after creation. + */ + @JsonProperty("queue_url") + private String queueUrl; + + /** + * Table that stores the raw data before parsers schematize it. Every Auto Loader datasource + * writes its raw rows to this table before any parser reads them. The table must be in the + * datasource's catalog and schema; an omitted `catalog_name` or `schema_name` defaults to them. + * Cannot be changed after creation. Reads return the value as supplied; the table the data is + * written to is reported in `effective_raw_table`. + */ + @JsonProperty("raw_table") + private TableName rawTable; + + /** Name of the Unity Catalog service credential to use. */ + @JsonProperty("service_credentials") + private String serviceCredentials; + + public AutoLoader setAwsSecretScope(String awsSecretScope) { + this.awsSecretScope = awsSecretScope; + return this; + } + + public String getAwsSecretScope() { + return awsSecretScope; + } + + public AutoLoader setEffectiveIncludeExistingFiles(Boolean effectiveIncludeExistingFiles) { + this.effectiveIncludeExistingFiles = effectiveIncludeExistingFiles; + return this; + } + + public Boolean getEffectiveIncludeExistingFiles() { + return effectiveIncludeExistingFiles; + } + + public AutoLoader setEffectiveRawTable(TableName effectiveRawTable) { + this.effectiveRawTable = effectiveRawTable; + return this; + } + + public TableName getEffectiveRawTable() { + return effectiveRawTable; + } + + public AutoLoader setEnvelope(Envelope envelope) { + this.envelope = envelope; + return this; + } + + public Envelope getEnvelope() { + return envelope; + } + + public AutoLoader setFormat(AutoLoaderFormat format) { + this.format = format; + return this; + } + + public AutoLoaderFormat getFormat() { + return format; + } + + public AutoLoader setFormatOptions(Map formatOptions) { + this.formatOptions = formatOptions; + return this; + } + + public Map getFormatOptions() { + return formatOptions; + } + + public AutoLoader setIncludeExistingFiles(Boolean includeExistingFiles) { + this.includeExistingFiles = includeExistingFiles; + return this; + } + + public Boolean getIncludeExistingFiles() { + return includeExistingFiles; + } + + public AutoLoader setLocation(String location) { + this.location = location; + return this; + } + + public String getLocation() { + return location; + } + + public AutoLoader setOverridePartitionColumns(Collection overridePartitionColumns) { + this.overridePartitionColumns = overridePartitionColumns; + return this; + } + + public Collection getOverridePartitionColumns() { + return overridePartitionColumns; + } + + public AutoLoader setQueueUrl(String queueUrl) { + this.queueUrl = queueUrl; + return this; + } + + public String getQueueUrl() { + return queueUrl; + } + + public AutoLoader setRawTable(TableName rawTable) { + this.rawTable = rawTable; + return this; + } + + public TableName getRawTable() { + return rawTable; + } + + public AutoLoader setServiceCredentials(String serviceCredentials) { + this.serviceCredentials = serviceCredentials; + return this; + } + + public String getServiceCredentials() { + return serviceCredentials; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + AutoLoader that = (AutoLoader) o; + return Objects.equals(awsSecretScope, that.awsSecretScope) + && Objects.equals(effectiveIncludeExistingFiles, that.effectiveIncludeExistingFiles) + && Objects.equals(effectiveRawTable, that.effectiveRawTable) + && Objects.equals(envelope, that.envelope) + && Objects.equals(format, that.format) + && Objects.equals(formatOptions, that.formatOptions) + && Objects.equals(includeExistingFiles, that.includeExistingFiles) + && Objects.equals(location, that.location) + && Objects.equals(overridePartitionColumns, that.overridePartitionColumns) + && Objects.equals(queueUrl, that.queueUrl) + && Objects.equals(rawTable, that.rawTable) + && Objects.equals(serviceCredentials, that.serviceCredentials); + } + + @Override + public int hashCode() { + return Objects.hash( + awsSecretScope, + effectiveIncludeExistingFiles, + effectiveRawTable, + envelope, + format, + formatOptions, + includeExistingFiles, + location, + overridePartitionColumns, + queueUrl, + rawTable, + serviceCredentials); + } + + @Override + public String toString() { + return new ToStringer(AutoLoader.class) + .add("awsSecretScope", awsSecretScope) + .add("effectiveIncludeExistingFiles", effectiveIncludeExistingFiles) + .add("effectiveRawTable", effectiveRawTable) + .add("envelope", envelope) + .add("format", format) + .add("formatOptions", formatOptions) + .add("includeExistingFiles", includeExistingFiles) + .add("location", location) + .add("overridePartitionColumns", overridePartitionColumns) + .add("queueUrl", queueUrl) + .add("rawTable", rawTable) + .add("serviceCredentials", serviceCredentials) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AutoLoaderFormat.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AutoLoaderFormat.java new file mode 100644 index 000000000..2597d7bc8 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/AutoLoaderFormat.java @@ -0,0 +1,15 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** File format of the source files that Auto Loader reads. */ +@Generated +public enum AutoLoaderFormat { + AUTOLOADER_FORMAT_CSV, + AUTOLOADER_FORMAT_JSON, + AUTOLOADER_FORMAT_JSONL, + AUTOLOADER_FORMAT_PARQUET, + AUTOLOADER_FORMAT_XML, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CloudWatchLogsEnvelope.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CloudWatchLogsEnvelope.java new file mode 100644 index 000000000..cfa4535f7 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CloudWatchLogsEnvelope.java @@ -0,0 +1,51 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Unwraps an AWS CloudWatch Logs delivery envelope: each element of `logEvents` becomes its own + * row, with the element's `message` parsed as the event body. + */ +@Generated +public class CloudWatchLogsEnvelope { + /** + * Whether to keep the envelope's `owner`, `logGroup`, and `logStream` values in the + * `data.lw_header` field of each unwrapped row. Must be set explicitly to `true` or `false`. + */ + @JsonProperty("header_retention") + private Boolean headerRetention; + + public CloudWatchLogsEnvelope setHeaderRetention(Boolean headerRetention) { + this.headerRetention = headerRetention; + return this; + } + + public Boolean getHeaderRetention() { + return headerRetention; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CloudWatchLogsEnvelope that = (CloudWatchLogsEnvelope) o; + return Objects.equals(headerRetention, that.headerRetention); + } + + @Override + public int hashCode() { + return Objects.hash(headerRetention); + } + + @Override + public String toString() { + return new ToStringer(CloudWatchLogsEnvelope.class) + .add("headerRetention", headerRetention) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CommonConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CommonConfig.java new file mode 100644 index 000000000..a29279b19 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CommonConfig.java @@ -0,0 +1,179 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Objects; + +/** + * Catch-all per-catalog config — settings that don't belong to any one resource family. Singleton. + * Name format: `catalogs/{catalog}/commonConfig`. + */ +@Generated +public class CommonConfig { + /** + * UC volume path holding user-authored custom content packs, e.g. + * `/Volumes/{catalog}/{schema}/{volume}`. User-provided with no default: when unset, custom + * content packs are unavailable (referencing one is rejected) and only built-in content packs + * apply. + */ + @JsonProperty("custom_content_pack_path") + private String customContentPackPath; + + /** + * UC volume path holding user-authored custom presets, e.g. + * `/Volumes/{catalog}/{schema}/{volume}`. User-provided with no default: when unset, custom + * presets are unavailable and only built-in presets apply. + */ + @JsonProperty("custom_presets_path") + private String customPresetsPath; + + /** + * Opaque entity tag for optimistic concurrency. Returned on every read; pass it back as the + * Update request's `etag` to make the update conditional on the resource being unchanged. + */ + @JsonProperty("etag") + private String etag; + + /** */ + @JsonProperty("name") + private String name; + + /** + * Whether users may grant permissions on individual resources rather than only at the Folder + * level. + */ + @JsonProperty("per_resource_permissions_enabled") + private Boolean perResourcePermissionsEnabled; + + /** */ + @JsonProperty("update_time") + private Timestamp updateTime; + + /** */ + @JsonProperty("updated_by") + private Principal updatedBy; + + /** + * Monotonic version, bumped on each update. Informational; use `etag` for optimistic concurrency. + */ + @JsonProperty("version") + private Long version; + + public CommonConfig setCustomContentPackPath(String customContentPackPath) { + this.customContentPackPath = customContentPackPath; + return this; + } + + public String getCustomContentPackPath() { + return customContentPackPath; + } + + public CommonConfig setCustomPresetsPath(String customPresetsPath) { + this.customPresetsPath = customPresetsPath; + return this; + } + + public String getCustomPresetsPath() { + return customPresetsPath; + } + + public CommonConfig setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public CommonConfig setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public CommonConfig setPerResourcePermissionsEnabled(Boolean perResourcePermissionsEnabled) { + this.perResourcePermissionsEnabled = perResourcePermissionsEnabled; + return this; + } + + public Boolean getPerResourcePermissionsEnabled() { + return perResourcePermissionsEnabled; + } + + public CommonConfig setUpdateTime(Timestamp updateTime) { + this.updateTime = updateTime; + return this; + } + + public Timestamp getUpdateTime() { + return updateTime; + } + + public CommonConfig setUpdatedBy(Principal updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + public Principal getUpdatedBy() { + return updatedBy; + } + + public CommonConfig setVersion(Long version) { + this.version = version; + return this; + } + + public Long getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CommonConfig that = (CommonConfig) o; + return Objects.equals(customContentPackPath, that.customContentPackPath) + && Objects.equals(customPresetsPath, that.customPresetsPath) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(perResourcePermissionsEnabled, that.perResourcePermissionsEnabled) + && Objects.equals(updateTime, that.updateTime) + && Objects.equals(updatedBy, that.updatedBy) + && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash( + customContentPackPath, + customPresetsPath, + etag, + name, + perResourcePermissionsEnabled, + updateTime, + updatedBy, + version); + } + + @Override + public String toString() { + return new ToStringer(CommonConfig.class) + .add("customContentPackPath", customContentPackPath) + .add("customPresetsPath", customPresetsPath) + .add("etag", etag) + .add("name", name) + .add("perResourcePermissionsEnabled", perResourcePermissionsEnabled) + .add("updateTime", updateTime) + .add("updatedBy", updatedBy) + .add("version", version) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ContentPackReference.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ContentPackReference.java new file mode 100644 index 000000000..a3bcef6d1 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ContentPackReference.java @@ -0,0 +1,59 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Reference to the ContentPack (and pack version) a resource was originally installed from. */ +@Generated +public class ContentPackReference { + /** UUID of the content pack. */ + @JsonProperty("uuid") + private String uuid; + + /** Pack version the resource was installed from. */ + @JsonProperty("version") + private String version; + + public ContentPackReference setUuid(String uuid) { + this.uuid = uuid; + return this; + } + + public String getUuid() { + return uuid; + } + + public ContentPackReference setVersion(String version) { + this.version = version; + return this; + } + + public String getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ContentPackReference that = (ContentPackReference) o; + return Objects.equals(uuid, that.uuid) && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, version); + } + + @Override + public String toString() { + return new ToStringer(ContentPackReference.class) + .add("uuid", uuid) + .add("version", version) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CreateDatasourceRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CreateDatasourceRequest.java new file mode 100644 index 000000000..3e340ae9e --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CreateDatasourceRequest.java @@ -0,0 +1,42 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class CreateDatasourceRequest { + /** */ + @JsonProperty("datasource") + private Datasource datasource; + + public CreateDatasourceRequest setDatasource(Datasource datasource) { + this.datasource = datasource; + return this; + } + + public Datasource getDatasource() { + return datasource; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CreateDatasourceRequest that = (CreateDatasourceRequest) o; + return Objects.equals(datasource, that.datasource); + } + + @Override + public int hashCode() { + return Objects.hash(datasource); + } + + @Override + public String toString() { + return new ToStringer(CreateDatasourceRequest.class).add("datasource", datasource).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CreateRuleRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CreateRuleRequest.java new file mode 100644 index 000000000..a4b92cfe9 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/CreateRuleRequest.java @@ -0,0 +1,45 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class CreateRuleRequest { + /** + * The rule to create. Server-assigned fields (`name`, `rule_id`, timestamps, `etag`, …) are + * ignored on the request. + */ + @JsonProperty("rule") + private Rule rule; + + public CreateRuleRequest setRule(Rule rule) { + this.rule = rule; + return this; + } + + public Rule getRule() { + return rule; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CreateRuleRequest that = (CreateRuleRequest) o; + return Objects.equals(rule, that.rule); + } + + @Override + public int hashCode() { + return Objects.hash(rule); + } + + @Override + public String toString() { + return new ToStringer(CreateRuleRequest.class).add("rule", rule).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Datasource.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Datasource.java new file mode 100644 index 000000000..87de50e32 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Datasource.java @@ -0,0 +1,562 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; + +/** + * A Lakewatch datasource: a pipeline that ingests security data and writes it to Unity Catalog + * tables. + * + *

What a datasource ingests is defined by its ingestion method (`autoloader`, + * `unity_catalog_connection`, or `existing_table`), which sets how the data arrives, together with + * its `parsers`, which define the schemas that the arriving data is matched against and written as. + */ +@Generated +public class Datasource { + /** Free-form key-value annotations on the datasource, managed by the client. */ + @JsonProperty("annotations") + private Map annotations; + + /** */ + @JsonProperty("autoloader") + private AutoLoader autoloader; + + /** + * Name of the Unity Catalog catalog that contains the datasource. Required on create and cannot + * be changed afterward. Reads return the value as supplied; the catalog's current name is + * reported in `effective_catalog_name`. + */ + @JsonProperty("catalog_name") + private String catalogName; + + /** + * Compute mode for the datasource's ingestion job. If unset, the `default_compute_mode` of the + * catalog's datasource configuration applies, or `DS_COMPUTE_PERFORMANCE_OPTIMIZED` if the + * catalog has none. + */ + @JsonProperty("compute_mode") + private DatasourceComputeMode computeMode; + + /** + * ID of the workspace whose compute runs this datasource's ingestion job and owns its associated + * resources, such as the storage the ingested data lands in. Server-assigned. + */ + @JsonProperty("compute_workspace_id") + private String computeWorkspaceId; + + /** */ + @JsonProperty("create_time") + private Timestamp createTime; + + /** */ + @JsonProperty("created_by") + private Principal createdBy; + + /** + * Unity Catalog securable ID (a UUID) of the datasource. It never changes, including when the + * datasource is renamed in Unity Catalog, and is the final segment of `name`. + */ + @JsonProperty("datasource_id") + private String datasourceId; + + /** + * Name of the datasource in Unity Catalog, unique within its schema. Required on create and + * cannot be changed afterward. Reads return the value as supplied; the datasource's current Unity + * Catalog name, which reflects renames, is reported in `effective_datasource_name`. + */ + @JsonProperty("datasource_name") + private String datasourceName; + + /** Free-form description of the datasource. */ + @JsonProperty("description") + private String description; + + /** + * Current name of the Unity Catalog catalog that contains the datasource, which reflects catalog + * renames without a change to `catalog_name`. Populated on get, create, and update responses; + * list responses omit it. + */ + @JsonProperty("effective_catalog_name") + private String effectiveCatalogName; + + /** + * Current UC leaf name of the datasource (server-owned). Tracks UC renames so callers can observe + * the live name without having to update the client-owned `datasource_name`; unset until + * resolved. + */ + @JsonProperty("effective_datasource_name") + private String effectiveDatasourceName; + + /** + * The identity the datasource runs as: the resolved `run_as_principal`, or the requester's + * identity if `run_as_principal` was omitted on create or cleared on update. Given as a user + * email or service principal application ID, or as the numeric principal ID if the identity can + * no longer be resolved. Populated on get, create, and update responses; list responses omit it. + */ + @JsonProperty("effective_run_as_principal") + private String effectiveRunAsPrincipal; + + /** + * Current name of the Unity Catalog schema that contains the datasource, which reflects schema + * renames without a change to `schema_name`. Populated on get, create, and update responses; list + * responses omit it. + */ + @JsonProperty("effective_schema_name") + private String effectiveSchemaName; + + /** + * Opaque entity tag for optimistic concurrency control. Returned by get, create, and update + * responses and by list responses in the `DATASOURCE_VIEW_FULL` view. To make an update + * conditional on the datasource not having changed since it was read, pass this value as the + * update request's `etag`. Changes to `status` do not change the etag. + */ + @JsonProperty("etag") + private String etag; + + /** */ + @JsonProperty("existing_table") + private ExistingTable existingTable; + + /** + * Resource name of the datasource, in the format `datasources/{datasource_id}`. Unlike the + * datasource's Unity Catalog location (`catalog_name`, `schema_name`, and `datasource_name`), the + * name does not change when the datasource or its catalog or schema is renamed in Unity Catalog. + */ + @JsonProperty("name") + private String name; + + /** Unity Catalog owner of the datasource, assigned by the server. Create responses omit it. */ + @JsonProperty("owner") + private Principal owner; + + /** + * Parsers that schematize the ingested data. Each record is matched against the parsers in order + * and written to the parsed table of the first parser that it matches. Existing-table and Unity + * Catalog connection datasources require at least one parser; an Auto Loader datasource with no + * parsers writes only its raw table. + */ + @JsonProperty("parsers") + private Collection parsers; + + /** + * The user or service principal that the datasource runs as, given as a user email or service + * principal application ID. When it is supplied on create or update, the requester must be + * authorized to run the datasource as that principal, or the request is rejected. When it is + * omitted on create, the datasource runs as the requester. On update, a mask that includes + * `run_as_principal` without a value clears it, so the datasource runs as the requester; a mask + * that omits it keeps the current identity. Reads return the value as supplied; the identity the + * datasource runs as is reported in `effective_run_as_principal`. + */ + @JsonProperty("run_as_principal") + private String runAsPrincipal; + + /** + * Schedule on which the datasource's ingestion job runs. A datasource cannot be paused, so a + * request that sets `schedule.enabled` to `false` is rejected. Continuous schedules are not + * supported for Unity Catalog connection datasources. + */ + @JsonProperty("schedule") + private Schedule schedule; + + /** + * Name of the Unity Catalog schema that contains the datasource. Required on create and cannot be + * changed afterward. Reads return the value as supplied; the schema's current name is reported in + * `effective_schema_name`. + */ + @JsonProperty("schema_name") + private String schemaName; + + /** Runtime status of the jobs and pipelines that run this datasource. */ + @JsonProperty("status") + private DatasourceStatus status; + + /** */ + @JsonProperty("unity_catalog_connection") + private UnityCatalogConnection unityCatalogConnection; + + /** */ + @JsonProperty("update_time") + private Timestamp updateTime; + + /** */ + @JsonProperty("updated_by") + private Principal updatedBy; + + /** + * Version number of the datasource, incremented on each update. Informational only; use `etag` + * for optimistic concurrency control. + */ + @JsonProperty("version") + private Long version; + + /** + * ID of the SQL warehouse that runs the checks Lakewatch performs to validate a create or update + * request, such as source and destination access checks. Required and non-blank on every create + * and update request; there is no default warehouse. The requester must be able to use the + * warehouse. Used only for those checks: it is not stored, is not returned on reads, and does not + * affect the compute that runs the ingestion job. + */ + @JsonProperty("warehouse_id") + private String warehouseId; + + public Datasource setAnnotations(Map annotations) { + this.annotations = annotations; + return this; + } + + public Map getAnnotations() { + return annotations; + } + + public Datasource setAutoloader(AutoLoader autoloader) { + this.autoloader = autoloader; + return this; + } + + public AutoLoader getAutoloader() { + return autoloader; + } + + public Datasource setCatalogName(String catalogName) { + this.catalogName = catalogName; + return this; + } + + public String getCatalogName() { + return catalogName; + } + + public Datasource setComputeMode(DatasourceComputeMode computeMode) { + this.computeMode = computeMode; + return this; + } + + public DatasourceComputeMode getComputeMode() { + return computeMode; + } + + public Datasource setComputeWorkspaceId(String computeWorkspaceId) { + this.computeWorkspaceId = computeWorkspaceId; + return this; + } + + public String getComputeWorkspaceId() { + return computeWorkspaceId; + } + + public Datasource setCreateTime(Timestamp createTime) { + this.createTime = createTime; + return this; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public Datasource setCreatedBy(Principal createdBy) { + this.createdBy = createdBy; + return this; + } + + public Principal getCreatedBy() { + return createdBy; + } + + public Datasource setDatasourceId(String datasourceId) { + this.datasourceId = datasourceId; + return this; + } + + public String getDatasourceId() { + return datasourceId; + } + + public Datasource setDatasourceName(String datasourceName) { + this.datasourceName = datasourceName; + return this; + } + + public String getDatasourceName() { + return datasourceName; + } + + public Datasource setDescription(String description) { + this.description = description; + return this; + } + + public String getDescription() { + return description; + } + + public Datasource setEffectiveCatalogName(String effectiveCatalogName) { + this.effectiveCatalogName = effectiveCatalogName; + return this; + } + + public String getEffectiveCatalogName() { + return effectiveCatalogName; + } + + public Datasource setEffectiveDatasourceName(String effectiveDatasourceName) { + this.effectiveDatasourceName = effectiveDatasourceName; + return this; + } + + public String getEffectiveDatasourceName() { + return effectiveDatasourceName; + } + + public Datasource setEffectiveRunAsPrincipal(String effectiveRunAsPrincipal) { + this.effectiveRunAsPrincipal = effectiveRunAsPrincipal; + return this; + } + + public String getEffectiveRunAsPrincipal() { + return effectiveRunAsPrincipal; + } + + public Datasource setEffectiveSchemaName(String effectiveSchemaName) { + this.effectiveSchemaName = effectiveSchemaName; + return this; + } + + public String getEffectiveSchemaName() { + return effectiveSchemaName; + } + + public Datasource setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public Datasource setExistingTable(ExistingTable existingTable) { + this.existingTable = existingTable; + return this; + } + + public ExistingTable getExistingTable() { + return existingTable; + } + + public Datasource setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public Datasource setOwner(Principal owner) { + this.owner = owner; + return this; + } + + public Principal getOwner() { + return owner; + } + + public Datasource setParsers(Collection parsers) { + this.parsers = parsers; + return this; + } + + public Collection getParsers() { + return parsers; + } + + public Datasource setRunAsPrincipal(String runAsPrincipal) { + this.runAsPrincipal = runAsPrincipal; + return this; + } + + public String getRunAsPrincipal() { + return runAsPrincipal; + } + + public Datasource setSchedule(Schedule schedule) { + this.schedule = schedule; + return this; + } + + public Schedule getSchedule() { + return schedule; + } + + public Datasource setSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + public String getSchemaName() { + return schemaName; + } + + public Datasource setStatus(DatasourceStatus status) { + this.status = status; + return this; + } + + public DatasourceStatus getStatus() { + return status; + } + + public Datasource setUnityCatalogConnection(UnityCatalogConnection unityCatalogConnection) { + this.unityCatalogConnection = unityCatalogConnection; + return this; + } + + public UnityCatalogConnection getUnityCatalogConnection() { + return unityCatalogConnection; + } + + public Datasource setUpdateTime(Timestamp updateTime) { + this.updateTime = updateTime; + return this; + } + + public Timestamp getUpdateTime() { + return updateTime; + } + + public Datasource setUpdatedBy(Principal updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + public Principal getUpdatedBy() { + return updatedBy; + } + + public Datasource setVersion(Long version) { + this.version = version; + return this; + } + + public Long getVersion() { + return version; + } + + public Datasource setWarehouseId(String warehouseId) { + this.warehouseId = warehouseId; + return this; + } + + public String getWarehouseId() { + return warehouseId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Datasource that = (Datasource) o; + return Objects.equals(annotations, that.annotations) + && Objects.equals(autoloader, that.autoloader) + && Objects.equals(catalogName, that.catalogName) + && Objects.equals(computeMode, that.computeMode) + && Objects.equals(computeWorkspaceId, that.computeWorkspaceId) + && Objects.equals(createTime, that.createTime) + && Objects.equals(createdBy, that.createdBy) + && Objects.equals(datasourceId, that.datasourceId) + && Objects.equals(datasourceName, that.datasourceName) + && Objects.equals(description, that.description) + && Objects.equals(effectiveCatalogName, that.effectiveCatalogName) + && Objects.equals(effectiveDatasourceName, that.effectiveDatasourceName) + && Objects.equals(effectiveRunAsPrincipal, that.effectiveRunAsPrincipal) + && Objects.equals(effectiveSchemaName, that.effectiveSchemaName) + && Objects.equals(etag, that.etag) + && Objects.equals(existingTable, that.existingTable) + && Objects.equals(name, that.name) + && Objects.equals(owner, that.owner) + && Objects.equals(parsers, that.parsers) + && Objects.equals(runAsPrincipal, that.runAsPrincipal) + && Objects.equals(schedule, that.schedule) + && Objects.equals(schemaName, that.schemaName) + && Objects.equals(status, that.status) + && Objects.equals(unityCatalogConnection, that.unityCatalogConnection) + && Objects.equals(updateTime, that.updateTime) + && Objects.equals(updatedBy, that.updatedBy) + && Objects.equals(version, that.version) + && Objects.equals(warehouseId, that.warehouseId); + } + + @Override + public int hashCode() { + return Objects.hash( + annotations, + autoloader, + catalogName, + computeMode, + computeWorkspaceId, + createTime, + createdBy, + datasourceId, + datasourceName, + description, + effectiveCatalogName, + effectiveDatasourceName, + effectiveRunAsPrincipal, + effectiveSchemaName, + etag, + existingTable, + name, + owner, + parsers, + runAsPrincipal, + schedule, + schemaName, + status, + unityCatalogConnection, + updateTime, + updatedBy, + version, + warehouseId); + } + + @Override + public String toString() { + return new ToStringer(Datasource.class) + .add("annotations", annotations) + .add("autoloader", autoloader) + .add("catalogName", catalogName) + .add("computeMode", computeMode) + .add("computeWorkspaceId", computeWorkspaceId) + .add("createTime", createTime) + .add("createdBy", createdBy) + .add("datasourceId", datasourceId) + .add("datasourceName", datasourceName) + .add("description", description) + .add("effectiveCatalogName", effectiveCatalogName) + .add("effectiveDatasourceName", effectiveDatasourceName) + .add("effectiveRunAsPrincipal", effectiveRunAsPrincipal) + .add("effectiveSchemaName", effectiveSchemaName) + .add("etag", etag) + .add("existingTable", existingTable) + .add("name", name) + .add("owner", owner) + .add("parsers", parsers) + .add("runAsPrincipal", runAsPrincipal) + .add("schedule", schedule) + .add("schemaName", schemaName) + .add("status", status) + .add("unityCatalogConnection", unityCatalogConnection) + .add("updateTime", updateTime) + .add("updatedBy", updatedBy) + .add("version", version) + .add("warehouseId", warehouseId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceComputeMode.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceComputeMode.java new file mode 100644 index 000000000..5159f83d9 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceComputeMode.java @@ -0,0 +1,12 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Compute mode for the datasource's ingestion job. */ +@Generated +public enum DatasourceComputeMode { + DS_COMPUTE_PERFORMANCE_OPTIMIZED, + DS_COMPUTE_STANDARD, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceConfig.java new file mode 100644 index 000000000..e1dfb8277 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceConfig.java @@ -0,0 +1,179 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Objects; + +/** + * Per-catalog datasource-related config. Singleton. Name format: + * `catalogs/{catalog}/datasourceConfig`. + */ +@Generated +public class DatasourceConfig { + /** + * Default compute mode applied to datasource ingestion jobs when the individual datasource + * doesn't override it. v1 `datasources.defaultComputeMode`. + */ + @JsonProperty("default_compute_mode") + private DatasourceComputeMode defaultComputeMode; + + /** + * Schema name of the registered folder (in this catalog) that a new datasource is placed in when + * the request does not specify a schema. Must name a schema registered as a folder. Omit to + * clear. Reads return the value as supplied; the folder's current schema name is reported in + * `effective_default_folder`. + */ + @JsonProperty("default_folder") + private String defaultFolder; + + /** + * The current schema name of the `default_folder` folder. Tracks UC schema renames. Unset when no + * default is configured, or when the folder's schema no longer exists or is not visible to the + * caller. + */ + @JsonProperty("effective_default_folder") + private String effectiveDefaultFolder; + + /** + * Opaque entity tag for optimistic concurrency. Returned on every read; pass it back as the + * Update request's `etag` to make the update conditional on the resource being unchanged. + */ + @JsonProperty("etag") + private String etag; + + /** */ + @JsonProperty("name") + private String name; + + /** */ + @JsonProperty("update_time") + private Timestamp updateTime; + + /** */ + @JsonProperty("updated_by") + private Principal updatedBy; + + /** + * Monotonic version, bumped on each update. Informational; use `etag` for optimistic concurrency. + */ + @JsonProperty("version") + private Long version; + + public DatasourceConfig setDefaultComputeMode(DatasourceComputeMode defaultComputeMode) { + this.defaultComputeMode = defaultComputeMode; + return this; + } + + public DatasourceComputeMode getDefaultComputeMode() { + return defaultComputeMode; + } + + public DatasourceConfig setDefaultFolder(String defaultFolder) { + this.defaultFolder = defaultFolder; + return this; + } + + public String getDefaultFolder() { + return defaultFolder; + } + + public DatasourceConfig setEffectiveDefaultFolder(String effectiveDefaultFolder) { + this.effectiveDefaultFolder = effectiveDefaultFolder; + return this; + } + + public String getEffectiveDefaultFolder() { + return effectiveDefaultFolder; + } + + public DatasourceConfig setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public DatasourceConfig setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public DatasourceConfig setUpdateTime(Timestamp updateTime) { + this.updateTime = updateTime; + return this; + } + + public Timestamp getUpdateTime() { + return updateTime; + } + + public DatasourceConfig setUpdatedBy(Principal updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + public Principal getUpdatedBy() { + return updatedBy; + } + + public DatasourceConfig setVersion(Long version) { + this.version = version; + return this; + } + + public Long getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DatasourceConfig that = (DatasourceConfig) o; + return Objects.equals(defaultComputeMode, that.defaultComputeMode) + && Objects.equals(defaultFolder, that.defaultFolder) + && Objects.equals(effectiveDefaultFolder, that.effectiveDefaultFolder) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(updateTime, that.updateTime) + && Objects.equals(updatedBy, that.updatedBy) + && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultComputeMode, + defaultFolder, + effectiveDefaultFolder, + etag, + name, + updateTime, + updatedBy, + version); + } + + @Override + public String toString() { + return new ToStringer(DatasourceConfig.class) + .add("defaultComputeMode", defaultComputeMode) + .add("defaultFolder", defaultFolder) + .add("effectiveDefaultFolder", effectiveDefaultFolder) + .add("etag", etag) + .add("name", name) + .add("updateTime", updateTime) + .add("updatedBy", updatedBy) + .add("version", version) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceStatus.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceStatus.java new file mode 100644 index 000000000..b1a2da09d --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceStatus.java @@ -0,0 +1,65 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Read-only runtime status of a datasource, with the status of each job and pipeline that runs it. + */ +@Generated +public class DatasourceStatus { + /** Status of the datasource's ingestion job. */ + @JsonProperty("ingestion_job") + private ResourceStatus ingestionJob; + + /** + * Status of the managed ingestion pipeline. Populated only when `unity_catalog_connection` is + * set, with `pipeline_id` identifying the pipeline. + */ + @JsonProperty("ingestion_pipeline") + private ResourceStatus ingestionPipeline; + + public DatasourceStatus setIngestionJob(ResourceStatus ingestionJob) { + this.ingestionJob = ingestionJob; + return this; + } + + public ResourceStatus getIngestionJob() { + return ingestionJob; + } + + public DatasourceStatus setIngestionPipeline(ResourceStatus ingestionPipeline) { + this.ingestionPipeline = ingestionPipeline; + return this; + } + + public ResourceStatus getIngestionPipeline() { + return ingestionPipeline; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DatasourceStatus that = (DatasourceStatus) o; + return Objects.equals(ingestionJob, that.ingestionJob) + && Objects.equals(ingestionPipeline, that.ingestionPipeline); + } + + @Override + public int hashCode() { + return Objects.hash(ingestionJob, ingestionPipeline); + } + + @Override + public String toString() { + return new ToStringer(DatasourceStatus.class) + .add("ingestionJob", ingestionJob) + .add("ingestionPipeline", ingestionPipeline) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceView.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceView.java new file mode 100644 index 000000000..da8f09158 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DatasourceView.java @@ -0,0 +1,12 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Which fields list responses return for each datasource. */ +@Generated +public enum DatasourceView { + DATASOURCE_VIEW_BASIC, + DATASOURCE_VIEW_FULL, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DeleteDatasourceRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DeleteDatasourceRequest.java new file mode 100644 index 000000000..221185cc8 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DeleteDatasourceRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class DeleteDatasourceRequest { + /** */ + @JsonIgnore private String name; + + public DeleteDatasourceRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DeleteDatasourceRequest that = (DeleteDatasourceRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(DeleteDatasourceRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DeleteRuleRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DeleteRuleRequest.java new file mode 100644 index 000000000..57c3db237 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/DeleteRuleRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class DeleteRuleRequest { + /** Resource name of the rule to delete. Format: `rules/{rule_id}`. */ + @JsonIgnore private String name; + + public DeleteRuleRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DeleteRuleRequest that = (DeleteRuleRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(DeleteRuleRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Envelope.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Envelope.java new file mode 100644 index 000000000..63878d6bc --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Envelope.java @@ -0,0 +1,63 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Unwraps a transport envelope from the source data so that each contained event becomes its own + * row. Applied when the source data is read, before parsing. + */ +@Generated +public class Envelope { + /** */ + @JsonProperty("cloud_watch_logs") + private CloudWatchLogsEnvelope cloudWatchLogs; + + /** */ + @JsonProperty("json_array") + private JsonArrayEnvelope jsonArray; + + public Envelope setCloudWatchLogs(CloudWatchLogsEnvelope cloudWatchLogs) { + this.cloudWatchLogs = cloudWatchLogs; + return this; + } + + public CloudWatchLogsEnvelope getCloudWatchLogs() { + return cloudWatchLogs; + } + + public Envelope setJsonArray(JsonArrayEnvelope jsonArray) { + this.jsonArray = jsonArray; + return this; + } + + public JsonArrayEnvelope getJsonArray() { + return jsonArray; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Envelope that = (Envelope) o; + return Objects.equals(cloudWatchLogs, that.cloudWatchLogs) + && Objects.equals(jsonArray, that.jsonArray); + } + + @Override + public int hashCode() { + return Objects.hash(cloudWatchLogs, jsonArray); + } + + @Override + public String toString() { + return new ToStringer(Envelope.class) + .add("cloudWatchLogs", cloudWatchLogs) + .add("jsonArray", jsonArray) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ExistingTable.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ExistingTable.java new file mode 100644 index 000000000..65700fb01 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ExistingTable.java @@ -0,0 +1,166 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Uses an existing Unity Catalog Delta table or view as the datasource's source. Mutually exclusive + * with `autoloader` and `unity_catalog_connection`. + */ +@Generated +public class ExistingTable { + /** + * Name of the catalog the existing table lives in. Optional on create and defaults to the + * datasource's own catalog. Cannot be changed. Reads return the value as supplied; the catalog in + * use is reported in `effective_catalog`. + */ + @JsonProperty("catalog") + private String catalog; + + /** + * Current Unity Catalog catalog name of the source table, resolved from its stable table ID, so a + * rename of the source table is reported here without changing `catalog`. + */ + @JsonProperty("effective_catalog") + private String effectiveCatalog; + + /** Current Unity Catalog name of the source table, resolved from its stable table ID. */ + @JsonProperty("effective_name") + private String effectiveName; + + /** Current Unity Catalog schema name of the source table, resolved from its stable table ID. */ + @JsonProperty("effective_schema") + private String effectiveSchema; + + /** + * Whether to ingest the rows already present in the source table when ingestion first starts. Set + * true to ingest the existing rows and then every new commit. Set false, or leave unset, to + * ingest only rows written after the datasource starts. Defaults to false, and must be true for a + * Delta Sharing source table. Takes effect only at first start and cannot be changed. Reads + * return the value as supplied. + */ + @JsonProperty("include_existing_rows") + private Boolean includeExistingRows; + + /** + * Name of the source table or view. Required on create and cannot be changed. Reads return the + * value as supplied; the table's current name is reported in `effective_name`. + */ + @JsonProperty("name") + private String name; + + /** + * Name of the schema the existing table lives in. Optional, but required when `catalog` is set; + * supplying `catalog` without `schema` is rejected. Defaults to the datasource's own schema. + * Cannot be changed. Reads return the value as supplied; the schema in use is reported in + * `effective_schema`. + */ + @JsonProperty("schema") + private String schema; + + public ExistingTable setCatalog(String catalog) { + this.catalog = catalog; + return this; + } + + public String getCatalog() { + return catalog; + } + + public ExistingTable setEffectiveCatalog(String effectiveCatalog) { + this.effectiveCatalog = effectiveCatalog; + return this; + } + + public String getEffectiveCatalog() { + return effectiveCatalog; + } + + public ExistingTable setEffectiveName(String effectiveName) { + this.effectiveName = effectiveName; + return this; + } + + public String getEffectiveName() { + return effectiveName; + } + + public ExistingTable setEffectiveSchema(String effectiveSchema) { + this.effectiveSchema = effectiveSchema; + return this; + } + + public String getEffectiveSchema() { + return effectiveSchema; + } + + public ExistingTable setIncludeExistingRows(Boolean includeExistingRows) { + this.includeExistingRows = includeExistingRows; + return this; + } + + public Boolean getIncludeExistingRows() { + return includeExistingRows; + } + + public ExistingTable setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public ExistingTable setSchema(String schema) { + this.schema = schema; + return this; + } + + public String getSchema() { + return schema; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ExistingTable that = (ExistingTable) o; + return Objects.equals(catalog, that.catalog) + && Objects.equals(effectiveCatalog, that.effectiveCatalog) + && Objects.equals(effectiveName, that.effectiveName) + && Objects.equals(effectiveSchema, that.effectiveSchema) + && Objects.equals(includeExistingRows, that.includeExistingRows) + && Objects.equals(name, that.name) + && Objects.equals(schema, that.schema); + } + + @Override + public int hashCode() { + return Objects.hash( + catalog, + effectiveCatalog, + effectiveName, + effectiveSchema, + includeExistingRows, + name, + schema); + } + + @Override + public String toString() { + return new ToStringer(ExistingTable.class) + .add("catalog", catalog) + .add("effectiveCatalog", effectiveCatalog) + .add("effectiveName", effectiveName) + .add("effectiveSchema", effectiveSchema) + .add("includeExistingRows", includeExistingRows) + .add("name", name) + .add("schema", schema) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ExportConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ExportConfig.java new file mode 100644 index 000000000..3413a37d0 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ExportConfig.java @@ -0,0 +1,142 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Configuration for delivering events / alerts to an external destination. + * + *

Exactly one of the destination variants is set; the server picks it via the `oneof`. + */ +@Generated +public class ExportConfig { + /** Whether export is currently active. */ + @JsonProperty("enabled") + private Boolean enabled; + + /** */ + @JsonProperty("jira") + private JiraExportConfig jira; + + /** */ + @JsonProperty("service_now") + private ServiceNowExportConfig serviceNow; + + /** */ + @JsonProperty("slack") + private SlackExportConfig slack; + + /** */ + @JsonProperty("tines") + private TinesExportConfig tines; + + /** */ + @JsonProperty("webhook") + private WebhookExportConfig webhook; + + /** + * Deprecated and ignored: exports always egress through the request's own workspace. Kept so + * configs stored by older builds still round-trip. + */ + @JsonProperty("workspace_id") + private String workspaceId; + + public ExportConfig setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + public Boolean getEnabled() { + return enabled; + } + + public ExportConfig setJira(JiraExportConfig jira) { + this.jira = jira; + return this; + } + + public JiraExportConfig getJira() { + return jira; + } + + public ExportConfig setServiceNow(ServiceNowExportConfig serviceNow) { + this.serviceNow = serviceNow; + return this; + } + + public ServiceNowExportConfig getServiceNow() { + return serviceNow; + } + + public ExportConfig setSlack(SlackExportConfig slack) { + this.slack = slack; + return this; + } + + public SlackExportConfig getSlack() { + return slack; + } + + public ExportConfig setTines(TinesExportConfig tines) { + this.tines = tines; + return this; + } + + public TinesExportConfig getTines() { + return tines; + } + + public ExportConfig setWebhook(WebhookExportConfig webhook) { + this.webhook = webhook; + return this; + } + + public WebhookExportConfig getWebhook() { + return webhook; + } + + public ExportConfig setWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + public String getWorkspaceId() { + return workspaceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ExportConfig that = (ExportConfig) o; + return Objects.equals(enabled, that.enabled) + && Objects.equals(jira, that.jira) + && Objects.equals(serviceNow, that.serviceNow) + && Objects.equals(slack, that.slack) + && Objects.equals(tines, that.tines) + && Objects.equals(webhook, that.webhook) + && Objects.equals(workspaceId, that.workspaceId); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, jira, serviceNow, slack, tines, webhook, workspaceId); + } + + @Override + public String toString() { + return new ToStringer(ExportConfig.class) + .add("enabled", enabled) + .add("jira", jira) + .add("serviceNow", serviceNow) + .add("slack", slack) + .add("tines", tines) + .add("webhook", webhook) + .add("workspaceId", workspaceId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetAlertConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetAlertConfigRequest.java new file mode 100644 index 000000000..550826aeb --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetAlertConfigRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetAlertConfigRequest { + /** */ + @JsonIgnore private String name; + + public GetAlertConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetAlertConfigRequest that = (GetAlertConfigRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetAlertConfigRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetCommonConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetCommonConfigRequest.java new file mode 100644 index 000000000..5fae07ca5 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetCommonConfigRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetCommonConfigRequest { + /** */ + @JsonIgnore private String name; + + public GetCommonConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetCommonConfigRequest that = (GetCommonConfigRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetCommonConfigRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetDatasourceConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetDatasourceConfigRequest.java new file mode 100644 index 000000000..373ff1c80 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetDatasourceConfigRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetDatasourceConfigRequest { + /** */ + @JsonIgnore private String name; + + public GetDatasourceConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetDatasourceConfigRequest that = (GetDatasourceConfigRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetDatasourceConfigRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetDatasourceRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetDatasourceRequest.java new file mode 100644 index 000000000..b41da2453 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetDatasourceRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetDatasourceRequest { + /** */ + @JsonIgnore private String name; + + public GetDatasourceRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetDatasourceRequest that = (GetDatasourceRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetDatasourceRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetRuleConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetRuleConfigRequest.java new file mode 100644 index 000000000..63f5a2dfd --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetRuleConfigRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetRuleConfigRequest { + /** */ + @JsonIgnore private String name; + + public GetRuleConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetRuleConfigRequest that = (GetRuleConfigRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetRuleConfigRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetRuleRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetRuleRequest.java new file mode 100644 index 000000000..0fadfb0dc --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/GetRuleRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetRuleRequest { + /** Full resource name of the detection rule, in the form `rules/{rule_id}`. */ + @JsonIgnore private String name; + + public GetRuleRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetRuleRequest that = (GetRuleRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetRuleRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/JiraExportConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/JiraExportConfig.java new file mode 100644 index 000000000..8a629ca53 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/JiraExportConfig.java @@ -0,0 +1,113 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class JiraExportConfig { + /** + * Three-level Unity Catalog name (`catalog.schema.secret`) of the secret holding the Jira API + * token, paired with `user_email` as the Jira Cloud basic-auth credential (`email:token`). Only + * the name is stored; the token is read when an alert is exported, so rotating the secret takes + * effect without editing this config. + */ + @JsonProperty("api_token_uc_secret") + private String apiTokenUcSecret; + + /** + * Default issue type for created tickets (e.g. `Task`, `Incident`). Jira issue creation requires + * an issue type, so it is validated at config-save time rather than failing the export at Jira + * later. + */ + @JsonProperty("default_issue_type") + private String defaultIssueType; + + /** Jira instance URL (e.g. `https://acme.atlassian.net`). */ + @JsonProperty("instance_url") + private String instanceUrl; + + /** Jira project key the exported issues are created under. */ + @JsonProperty("project_key") + private String projectKey; + + /** User email paired with the API token for Jira Cloud basic auth. */ + @JsonProperty("user_email") + private String userEmail; + + public JiraExportConfig setApiTokenUcSecret(String apiTokenUcSecret) { + this.apiTokenUcSecret = apiTokenUcSecret; + return this; + } + + public String getApiTokenUcSecret() { + return apiTokenUcSecret; + } + + public JiraExportConfig setDefaultIssueType(String defaultIssueType) { + this.defaultIssueType = defaultIssueType; + return this; + } + + public String getDefaultIssueType() { + return defaultIssueType; + } + + public JiraExportConfig setInstanceUrl(String instanceUrl) { + this.instanceUrl = instanceUrl; + return this; + } + + public String getInstanceUrl() { + return instanceUrl; + } + + public JiraExportConfig setProjectKey(String projectKey) { + this.projectKey = projectKey; + return this; + } + + public String getProjectKey() { + return projectKey; + } + + public JiraExportConfig setUserEmail(String userEmail) { + this.userEmail = userEmail; + return this; + } + + public String getUserEmail() { + return userEmail; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + JiraExportConfig that = (JiraExportConfig) o; + return Objects.equals(apiTokenUcSecret, that.apiTokenUcSecret) + && Objects.equals(defaultIssueType, that.defaultIssueType) + && Objects.equals(instanceUrl, that.instanceUrl) + && Objects.equals(projectKey, that.projectKey) + && Objects.equals(userEmail, that.userEmail); + } + + @Override + public int hashCode() { + return Objects.hash(apiTokenUcSecret, defaultIssueType, instanceUrl, projectKey, userEmail); + } + + @Override + public String toString() { + return new ToStringer(JiraExportConfig.class) + .add("apiTokenUcSecret", apiTokenUcSecret) + .add("defaultIssueType", defaultIssueType) + .add("instanceUrl", instanceUrl) + .add("projectKey", projectKey) + .add("userEmail", userEmail) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/JsonArrayEnvelope.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/JsonArrayEnvelope.java new file mode 100644 index 000000000..5208081b0 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/JsonArrayEnvelope.java @@ -0,0 +1,46 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Unwraps a JSON array of events into one row per array element. */ +@Generated +public class JsonArrayEnvelope { + /** + * Name of the root-level key that holds the array of events, for example `Records`. Nested paths + * are not supported. + */ + @JsonProperty("path") + private String path; + + public JsonArrayEnvelope setPath(String path) { + this.path = path; + return this; + } + + public String getPath() { + return path; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + JsonArrayEnvelope that = (JsonArrayEnvelope) o; + return Objects.equals(path, that.path); + } + + @Override + public int hashCode() { + return Objects.hash(path); + } + + @Override + public String toString() { + return new ToStringer(JsonArrayEnvelope.class).add("path", path).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchAPI.java new file mode 100644 index 000000000..2e3c9fced --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchAPI.java @@ -0,0 +1,187 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.core.ApiClient; +import com.databricks.sdk.core.logging.Logger; +import com.databricks.sdk.core.logging.LoggerFactory; +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.Paginator; + +/** + * Manage Lakewatch: security-analytics data sources, detection rules, and per-catalog + * configuration. + */ +@Generated +public class LakewatchAPI { + private static final Logger LOG = LoggerFactory.getLogger(LakewatchAPI.class); + + private final LakewatchService impl; + + /** Regular-use constructor */ + public LakewatchAPI(ApiClient apiClient) { + impl = new LakewatchImpl(apiClient); + } + + /** Constructor for mocks */ + public LakewatchAPI(LakewatchService mock) { + impl = mock; + } + + /** Creates a new datasource. */ + public Datasource createDatasource(CreateDatasourceRequest request) { + return impl.createDatasource(request); + } + + /** Creates a new rule. */ + public Rule createRule(CreateRuleRequest request) { + return impl.createRule(request); + } + + public void deleteDatasource(String name) { + deleteDatasource(new DeleteDatasourceRequest().setName(name)); + } + + /** Deletes a datasource by its resource name. */ + public void deleteDatasource(DeleteDatasourceRequest request) { + impl.deleteDatasource(request); + } + + public void deleteRule(String name) { + deleteRule(new DeleteRuleRequest().setName(name)); + } + + /** Deletes a rule by its resource name. */ + public void deleteRule(DeleteRuleRequest request) { + impl.deleteRule(request); + } + + public AlertConfig getAlertConfig(String name) { + return getAlertConfig(new GetAlertConfigRequest().setName(name)); + } + + /** Returns the alert delivery configuration for a catalog. */ + public AlertConfig getAlertConfig(GetAlertConfigRequest request) { + return impl.getAlertConfig(request); + } + + public CommonConfig getCommonConfig(String name) { + return getCommonConfig(new GetCommonConfigRequest().setName(name)); + } + + /** Returns the common Lakewatch configuration for a catalog. */ + public CommonConfig getCommonConfig(GetCommonConfigRequest request) { + return impl.getCommonConfig(request); + } + + public Datasource getDatasource(String name) { + return getDatasource(new GetDatasourceRequest().setName(name)); + } + + /** Returns a single datasource by its resource name. */ + public Datasource getDatasource(GetDatasourceRequest request) { + return impl.getDatasource(request); + } + + public DatasourceConfig getDatasourceConfig(String name) { + return getDatasourceConfig(new GetDatasourceConfigRequest().setName(name)); + } + + /** Returns the datasource ingestion configuration for a catalog. */ + public DatasourceConfig getDatasourceConfig(GetDatasourceConfigRequest request) { + return impl.getDatasourceConfig(request); + } + + public Rule getRule(String name) { + return getRule(new GetRuleRequest().setName(name)); + } + + /** Returns a single rule by its resource name. */ + public Rule getRule(GetRuleRequest request) { + return impl.getRule(request); + } + + public RuleConfig getRuleConfig(String name) { + return getRuleConfig(new GetRuleConfigRequest().setName(name)); + } + + /** Returns the detection-rule configuration for a catalog. */ + public RuleConfig getRuleConfig(GetRuleConfigRequest request) { + return impl.getRuleConfig(request); + } + + public Iterable listDatasources(String catalogName) { + return listDatasources(new ListDatasourcesRequest().setCatalogName(catalogName)); + } + + /** + * Lists the datasources in a Unity Catalog catalog, optionally narrowed to one schema or filtered + * by name. Results are paginated. Datasources that are still being created or deleted are not + * listed. + */ + public Iterable listDatasources(ListDatasourcesRequest request) { + return Paginator.newTokenPagination( + request, + impl::listDatasources, + ListDatasourcesResponse::getDatasources, + response -> { + String token = response.getNextPageToken(); + if (token == null || token.isEmpty()) { + return null; + } + return request.setPageToken(token); + }); + } + + public Iterable listRules(String catalogName) { + return listRules(new ListRulesRequest().setCatalogName(catalogName)); + } + + /** Lists rules, with optional filtering and pagination. */ + public Iterable listRules(ListRulesRequest request) { + return Paginator.newTokenPagination( + request, + impl::listRules, + ListRulesResponse::getRules, + response -> { + String token = response.getNextPageToken(); + if (token == null || token.isEmpty()) { + return null; + } + return request.setPageToken(token); + }); + } + + /** Updates the alert delivery configuration for a catalog. */ + public AlertConfig updateAlertConfig(UpdateAlertConfigRequest request) { + return impl.updateAlertConfig(request); + } + + /** Updates the common Lakewatch configuration for a catalog. */ + public CommonConfig updateCommonConfig(UpdateCommonConfigRequest request) { + return impl.updateCommonConfig(request); + } + + /** Updates an existing datasource. */ + public Datasource updateDatasource(UpdateDatasourceRequest request) { + return impl.updateDatasource(request); + } + + /** Updates the datasource ingestion configuration for a catalog. */ + public DatasourceConfig updateDatasourceConfig(UpdateDatasourceConfigRequest request) { + return impl.updateDatasourceConfig(request); + } + + /** Updates an existing rule. */ + public Rule updateRule(UpdateRuleRequest request) { + return impl.updateRule(request); + } + + /** Updates the detection-rule configuration for a catalog. */ + public RuleConfig updateRuleConfig(UpdateRuleConfigRequest request) { + return impl.updateRuleConfig(request); + } + + public LakewatchService impl() { + return impl; + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchImpl.java new file mode 100644 index 000000000..cccf14068 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchImpl.java @@ -0,0 +1,332 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.core.ApiClient; +import com.databricks.sdk.core.DatabricksException; +import com.databricks.sdk.core.http.Request; +import com.databricks.sdk.support.Generated; +import java.io.IOException; + +/** Package-local implementation of Lakewatch */ +@Generated +class LakewatchImpl implements LakewatchService { + private final ApiClient apiClient; + + public LakewatchImpl(ApiClient apiClient) { + this.apiClient = apiClient; + } + + @Override + public Datasource createDatasource(CreateDatasourceRequest request) { + String path = "/api/2.0/lakewatch/datasources"; + try { + Request req = new Request("POST", path, apiClient.serialize(request.getDatasource())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Datasource.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public Rule createRule(CreateRuleRequest request) { + String path = "/api/2.0/lakewatch/rules"; + try { + Request req = new Request("POST", path, apiClient.serialize(request.getRule())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Rule.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public void deleteDatasource(DeleteDatasourceRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("DELETE", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + apiClient.execute(req, Void.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public void deleteRule(DeleteRuleRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("DELETE", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + apiClient.execute(req, Void.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public AlertConfig getAlertConfig(GetAlertConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, AlertConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public CommonConfig getCommonConfig(GetCommonConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, CommonConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public Datasource getDatasource(GetDatasourceRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Datasource.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public DatasourceConfig getDatasourceConfig(GetDatasourceConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, DatasourceConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public Rule getRule(GetRuleRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Rule.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public RuleConfig getRuleConfig(GetRuleConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, RuleConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public ListDatasourcesResponse listDatasources(ListDatasourcesRequest request) { + String path = "/api/2.0/lakewatch/datasources"; + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, ListDatasourcesResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public ListRulesResponse listRules(ListRulesRequest request) { + String path = "/api/2.0/lakewatch/rules"; + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, ListRulesResponse.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public AlertConfig updateAlertConfig(UpdateAlertConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("PATCH", path, apiClient.serialize(request.getAlertConfig())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, AlertConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public CommonConfig updateCommonConfig(UpdateCommonConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("PATCH", path, apiClient.serialize(request.getCommonConfig())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, CommonConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public Datasource updateDatasource(UpdateDatasourceRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("PATCH", path, apiClient.serialize(request.getDatasource())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Datasource.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public DatasourceConfig updateDatasourceConfig(UpdateDatasourceConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("PATCH", path, apiClient.serialize(request.getDatasourceConfig())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, DatasourceConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public Rule updateRule(UpdateRuleRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("PATCH", path, apiClient.serialize(request.getRule())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, Rule.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + + @Override + public RuleConfig updateRuleConfig(UpdateRuleConfigRequest request) { + String path = String.format("/api/2.0/lakewatch/%s", request.getName()); + try { + Request req = new Request("PATCH", path, apiClient.serialize(request.getRuleConfig())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, RuleConfig.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchService.java new file mode 100644 index 000000000..aeb8db62f --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/LakewatchService.java @@ -0,0 +1,74 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** + * Manage Lakewatch: security-analytics data sources, detection rules, and per-catalog + * configuration. + * + *

This is the high-level interface, that contains generated methods. + * + *

Evolving: this interface is under development. Method signatures may change. + */ +@Generated +public interface LakewatchService { + /** Creates a new datasource. */ + Datasource createDatasource(CreateDatasourceRequest createDatasourceRequest); + + /** Creates a new rule. */ + Rule createRule(CreateRuleRequest createRuleRequest); + + /** Deletes a datasource by its resource name. */ + void deleteDatasource(DeleteDatasourceRequest deleteDatasourceRequest); + + /** Deletes a rule by its resource name. */ + void deleteRule(DeleteRuleRequest deleteRuleRequest); + + /** Returns the alert delivery configuration for a catalog. */ + AlertConfig getAlertConfig(GetAlertConfigRequest getAlertConfigRequest); + + /** Returns the common Lakewatch configuration for a catalog. */ + CommonConfig getCommonConfig(GetCommonConfigRequest getCommonConfigRequest); + + /** Returns a single datasource by its resource name. */ + Datasource getDatasource(GetDatasourceRequest getDatasourceRequest); + + /** Returns the datasource ingestion configuration for a catalog. */ + DatasourceConfig getDatasourceConfig(GetDatasourceConfigRequest getDatasourceConfigRequest); + + /** Returns a single rule by its resource name. */ + Rule getRule(GetRuleRequest getRuleRequest); + + /** Returns the detection-rule configuration for a catalog. */ + RuleConfig getRuleConfig(GetRuleConfigRequest getRuleConfigRequest); + + /** + * Lists the datasources in a Unity Catalog catalog, optionally narrowed to one schema or filtered + * by name. Results are paginated. Datasources that are still being created or deleted are not + * listed. + */ + ListDatasourcesResponse listDatasources(ListDatasourcesRequest listDatasourcesRequest); + + /** Lists rules, with optional filtering and pagination. */ + ListRulesResponse listRules(ListRulesRequest listRulesRequest); + + /** Updates the alert delivery configuration for a catalog. */ + AlertConfig updateAlertConfig(UpdateAlertConfigRequest updateAlertConfigRequest); + + /** Updates the common Lakewatch configuration for a catalog. */ + CommonConfig updateCommonConfig(UpdateCommonConfigRequest updateCommonConfigRequest); + + /** Updates an existing datasource. */ + Datasource updateDatasource(UpdateDatasourceRequest updateDatasourceRequest); + + /** Updates the datasource ingestion configuration for a catalog. */ + DatasourceConfig updateDatasourceConfig( + UpdateDatasourceConfigRequest updateDatasourceConfigRequest); + + /** Updates an existing rule. */ + Rule updateRule(UpdateRuleRequest updateRuleRequest); + + /** Updates the detection-rule configuration for a catalog. */ + RuleConfig updateRuleConfig(UpdateRuleConfigRequest updateRuleConfigRequest); +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListDatasourcesRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListDatasourcesRequest.java new file mode 100644 index 000000000..a5f2e3715 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListDatasourcesRequest.java @@ -0,0 +1,145 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 ListDatasourcesRequest { + /** + * Name of the Unity Catalog catalog to list datasources from. Required; each request lists the + * datasources of a single catalog. + */ + @JsonIgnore + @QueryParam("catalog_name") + private String catalogName; + + /** + * Filter expression that restricts the results to datasources with a given name, for example + * `datasource_name = "my_source"`. Only a single exact-match comparison on `datasource_name` is + * supported, and it matches the datasource's current Unity Catalog name, which reads report in + * `effective_datasource_name`. Filtered results are returned in a single page. + */ + @JsonIgnore + @QueryParam("filter") + private String filter; + + /** + * Maximum number of results to return in one page. This is a best-effort upper bound, not a + * guarantee: the server may return fewer items than requested (even zero) while more results + * still exist. If unset or 0, the server picks a default. + */ + @JsonIgnore + @QueryParam("page_size") + private Long pageSize; + + /** */ + @JsonIgnore + @QueryParam("page_token") + private String pageToken; + + /** + * Name of a Unity Catalog schema in `catalog_name`. Optional; if set, only the datasources in + * this schema are returned, and if omitted, the datasources in all schemas of the catalog are + * returned. + */ + @JsonIgnore + @QueryParam("schema_name") + private String schemaName; + + /** + * Which fields to return for each datasource. Defaults to `DATASOURCE_VIEW_FULL`. + * `DATASOURCE_VIEW_BASIC` returns only the identity and Unity Catalog location fields. + */ + @JsonIgnore + @QueryParam("view") + private DatasourceView view; + + public ListDatasourcesRequest setCatalogName(String catalogName) { + this.catalogName = catalogName; + return this; + } + + public String getCatalogName() { + return catalogName; + } + + public ListDatasourcesRequest setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getFilter() { + return filter; + } + + public ListDatasourcesRequest setPageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + public Long getPageSize() { + return pageSize; + } + + public ListDatasourcesRequest setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public ListDatasourcesRequest setSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + public String getSchemaName() { + return schemaName; + } + + public ListDatasourcesRequest setView(DatasourceView view) { + this.view = view; + return this; + } + + public DatasourceView getView() { + return view; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListDatasourcesRequest that = (ListDatasourcesRequest) o; + return Objects.equals(catalogName, that.catalogName) + && Objects.equals(filter, that.filter) + && Objects.equals(pageSize, that.pageSize) + && Objects.equals(pageToken, that.pageToken) + && Objects.equals(schemaName, that.schemaName) + && Objects.equals(view, that.view); + } + + @Override + public int hashCode() { + return Objects.hash(catalogName, filter, pageSize, pageToken, schemaName, view); + } + + @Override + public String toString() { + return new ToStringer(ListDatasourcesRequest.class) + .add("catalogName", catalogName) + .add("filter", filter) + .add("pageSize", pageSize) + .add("pageToken", pageToken) + .add("schemaName", schemaName) + .add("view", view) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListDatasourcesResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListDatasourcesResponse.java new file mode 100644 index 000000000..e54f7010d --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListDatasourcesResponse.java @@ -0,0 +1,65 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +@Generated +public class ListDatasourcesResponse { + /** */ + @JsonProperty("datasources") + private Collection datasources; + + /** + * Opaque token for fetching the next page; pass it as `page_token` on the next call. It is empty + * only when there are no more results. Page size is best-effort, so a short or even empty page + * does not mean the end; keep paging until this token is empty, which is the only reliable + * end-of-results signal. + */ + @JsonProperty("next_page_token") + private String nextPageToken; + + public ListDatasourcesResponse setDatasources(Collection datasources) { + this.datasources = datasources; + return this; + } + + public Collection getDatasources() { + return datasources; + } + + public ListDatasourcesResponse setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListDatasourcesResponse that = (ListDatasourcesResponse) o; + return Objects.equals(datasources, that.datasources) + && Objects.equals(nextPageToken, that.nextPageToken); + } + + @Override + public int hashCode() { + return Objects.hash(datasources, nextPageToken); + } + + @Override + public String toString() { + return new ToStringer(ListDatasourcesResponse.class) + .add("datasources", datasources) + .add("nextPageToken", nextPageToken) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListRulesRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListRulesRequest.java new file mode 100644 index 000000000..260c9f5a6 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListRulesRequest.java @@ -0,0 +1,139 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 ListRulesRequest { + /** Name of the Unity Catalog catalog to list rules from. Required. */ + @JsonIgnore + @QueryParam("catalog_name") + private String catalogName; + + /** + * Filter expression that restricts the results, such as `rule_name = "my_rule"` to return only + * the rule with that name. The name is matched against the current UC name, which reads report in + * `effective_rule_name`. + */ + @JsonIgnore + @QueryParam("filter") + private String filter; + + /** + * Maximum number of rules to return. The server may return fewer. If unset or 0, the server picks + * a default page size. + */ + @JsonIgnore + @QueryParam("page_size") + private Long pageSize; + + /** Page token from a previous `ListRules` response, used to fetch the next page of results. */ + @JsonIgnore + @QueryParam("page_token") + private String pageToken; + + /** + * Name of a Unity Catalog schema in `catalog_name`. If set, only rules in this schema are + * returned. If unset, rules in all schemas of the catalog are returned. + */ + @JsonIgnore + @QueryParam("schema_name") + private String schemaName; + + /** + * How much of each rule to return. Defaults to `RULE_VIEW_FULL`. `RULE_VIEW_BASIC` returns only + * each rule's identity and Unity Catalog location. + */ + @JsonIgnore + @QueryParam("view") + private RuleView view; + + public ListRulesRequest setCatalogName(String catalogName) { + this.catalogName = catalogName; + return this; + } + + public String getCatalogName() { + return catalogName; + } + + public ListRulesRequest setFilter(String filter) { + this.filter = filter; + return this; + } + + public String getFilter() { + return filter; + } + + public ListRulesRequest setPageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + public Long getPageSize() { + return pageSize; + } + + public ListRulesRequest setPageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + public String getPageToken() { + return pageToken; + } + + public ListRulesRequest setSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + public String getSchemaName() { + return schemaName; + } + + public ListRulesRequest setView(RuleView view) { + this.view = view; + return this; + } + + public RuleView getView() { + return view; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListRulesRequest that = (ListRulesRequest) o; + return Objects.equals(catalogName, that.catalogName) + && Objects.equals(filter, that.filter) + && Objects.equals(pageSize, that.pageSize) + && Objects.equals(pageToken, that.pageToken) + && Objects.equals(schemaName, that.schemaName) + && Objects.equals(view, that.view); + } + + @Override + public int hashCode() { + return Objects.hash(catalogName, filter, pageSize, pageToken, schemaName, view); + } + + @Override + public String toString() { + return new ToStringer(ListRulesRequest.class) + .add("catalogName", catalogName) + .add("filter", filter) + .add("pageSize", pageSize) + .add("pageToken", pageToken) + .add("schemaName", schemaName) + .add("view", view) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListRulesResponse.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListRulesResponse.java new file mode 100644 index 000000000..e98ec2827 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ListRulesResponse.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +@Generated +public class ListRulesResponse { + /** + * Token to pass as `page_token` in a subsequent `ListRules` call to fetch the next page, or empty + * when there are no more results. + */ + @JsonProperty("next_page_token") + private String nextPageToken; + + /** The rules in this page of results. */ + @JsonProperty("rules") + private Collection rules; + + public ListRulesResponse setNextPageToken(String nextPageToken) { + this.nextPageToken = nextPageToken; + return this; + } + + public String getNextPageToken() { + return nextPageToken; + } + + public ListRulesResponse setRules(Collection rules) { + this.rules = rules; + return this; + } + + public Collection getRules() { + return rules; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ListRulesResponse that = (ListRulesResponse) o; + return Objects.equals(nextPageToken, that.nextPageToken) && Objects.equals(rules, that.rules); + } + + @Override + public int hashCode() { + return Objects.hash(nextPageToken, rules); + } + + @Override + public String toString() { + return new ToStringer(ListRulesResponse.class) + .add("nextPageToken", nextPageToken) + .add("rules", rules) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ParserRef.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ParserRef.java new file mode 100644 index 000000000..4d0e63252 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ParserRef.java @@ -0,0 +1,102 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Reference to a parser that the datasource uses. Each parser defines the schema of the parsed + * table that it writes. + */ +@Generated +public class ParserRef { + /** + * The table this parser's data is written to: `target_table` when supplied, otherwise the table + * derived from the datasource's catalog and schema and the parser name. Fixed once resolved, so a + * later parser rename does not move it. Populated on get, create, and update responses with the + * resolved table. + */ + @JsonProperty("effective_target_table") + private TableName effectiveTargetTable; + + /** Identifier of the parser. Stable across renames, unlike a parser name. */ + @JsonProperty("id") + private String id; + + /** + * Table that this parser's data is written to. The table must be in the datasource's catalog and + * schema. If unset, the table name is derived from the parser name. Reads return the value as + * supplied; the table the data is written to is reported in `effective_target_table`. + */ + @JsonProperty("target_table") + private TableName targetTable; + + /** Version of the parser to use, given as an explicit version number. */ + @JsonProperty("version") + private String version; + + public ParserRef setEffectiveTargetTable(TableName effectiveTargetTable) { + this.effectiveTargetTable = effectiveTargetTable; + return this; + } + + public TableName getEffectiveTargetTable() { + return effectiveTargetTable; + } + + public ParserRef setId(String id) { + this.id = id; + return this; + } + + public String getId() { + return id; + } + + public ParserRef setTargetTable(TableName targetTable) { + this.targetTable = targetTable; + return this; + } + + public TableName getTargetTable() { + return targetTable; + } + + public ParserRef setVersion(String version) { + this.version = version; + return this; + } + + public String getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ParserRef that = (ParserRef) o; + return Objects.equals(effectiveTargetTable, that.effectiveTargetTable) + && Objects.equals(id, that.id) + && Objects.equals(targetTable, that.targetTable) + && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash(effectiveTargetTable, id, targetTable, version); + } + + @Override + public String toString() { + return new ToStringer(ParserRef.class) + .add("effectiveTargetTable", effectiveTargetTable) + .add("id", id) + .add("targetTable", targetTable) + .add("version", version) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Principal.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Principal.java new file mode 100644 index 000000000..be51c988d --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Principal.java @@ -0,0 +1,93 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * A principal — user or service-principal — used as the value type for `created_by` / `updated_by` + * / `assignee` etc. across v2 resources. + */ +@Generated +public class Principal { + /** Display name (user or SP name). */ + @JsonProperty("display_name") + private String displayName; + + /** Email (regular users only). */ + @JsonProperty("email") + private String email; + + /** User / service-principal ID. */ + @JsonProperty("id") + private String id; + + /** Whether this principal is a regular user, service principal, or system principal. */ + @JsonProperty("principal_type") + private PrincipalType principalType; + + public Principal setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + public String getDisplayName() { + return displayName; + } + + public Principal setEmail(String email) { + this.email = email; + return this; + } + + public String getEmail() { + return email; + } + + public Principal setId(String id) { + this.id = id; + return this; + } + + public String getId() { + return id; + } + + public Principal setPrincipalType(PrincipalType principalType) { + this.principalType = principalType; + return this; + } + + public PrincipalType getPrincipalType() { + return principalType; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Principal that = (Principal) o; + return Objects.equals(displayName, that.displayName) + && Objects.equals(email, that.email) + && Objects.equals(id, that.id) + && Objects.equals(principalType, that.principalType); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, email, id, principalType); + } + + @Override + public String toString() { + return new ToStringer(Principal.class) + .add("displayName", displayName) + .add("email", email) + .add("id", id) + .add("principalType", principalType) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/PrincipalType.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/PrincipalType.java new file mode 100644 index 000000000..c8fb8ac48 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/PrincipalType.java @@ -0,0 +1,13 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Type of a principal (user / SP / system). */ +@Generated +public enum PrincipalType { + REGULAR_USER, + SERVICE_PRINCIPAL, + SYSTEM_USER, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatus.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatus.java new file mode 100644 index 000000000..18ef55574 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatus.java @@ -0,0 +1,197 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Objects; + +/** + * Read-only runtime status of one job or pipeline backing a resource. + * + *

Shared across resources: a Rule's single job, a Datasource's main / health / + * historical-ingestion jobs, and a Datasource's ingestion pipeline (the `pipeline_id` field is set + * only for the pipeline). For a datasource's historical ingestion, the shard count is simply the + * number of `historical_job_statuses` entries — there is no separate count field. + * + *

Two orthogonal axes are modeled separately (v1 conflated them into a single `jobStatus` enum): + * `lifecycle` (is it configured / does it still exist) and `run_state` (what the most recent or + * in-flight run did). + * + *

Every field that holds a `ResourceStatus` is OUTPUT_ONLY at its use site (Datasource + * ingest/health/historical/pipeline statuses, Rule status), so the inner fields don't repeat the + * annotation. + */ +@Generated +public class ResourceStatus { + /** */ + @JsonProperty("create_time") + private Timestamp createTime; + + /** Databricks Jobs API job ID. Unset for a pure ingestion pipeline. */ + @JsonProperty("job_id") + private String jobId; + + /** When the most recent run completed. Pairs with `run_state = SUCCEEDED`. */ + @JsonProperty("last_complete_time") + private Timestamp lastCompleteTime; + + /** Most recent error message, if any. Pairs with `run_state = FAILED`. */ + @JsonProperty("last_error_message") + private String lastErrorMessage; + + /** When the most recent run started. Pairs with `run_state = RUNNING`. */ + @JsonProperty("last_start_time") + private Timestamp lastStartTime; + + /** */ + @JsonProperty("last_status_change_time") + private Timestamp lastStatusChangeTime; + + /** + * Scheduling lifecycle of the resource's underlying job/pipeline: whether it is unscheduled, + * scheduled, stopped, or deleted. Distinct from `run_state`, which reports the outcome of the + * most recent run. + */ + @JsonProperty("lifecycle_state") + private ResourceStatusLifecycle lifecycleState; + + /** + * DLT ingestion-pipeline ID. Set only when this status represents the datasource's ingestion + * pipeline (unset for job statuses). + */ + @JsonProperty("pipeline_id") + private String pipelineId; + + /** */ + @JsonProperty("run_state") + private ResourceStatusRunState runState; + + public ResourceStatus setCreateTime(Timestamp createTime) { + this.createTime = createTime; + return this; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public ResourceStatus setJobId(String jobId) { + this.jobId = jobId; + return this; + } + + public String getJobId() { + return jobId; + } + + public ResourceStatus setLastCompleteTime(Timestamp lastCompleteTime) { + this.lastCompleteTime = lastCompleteTime; + return this; + } + + public Timestamp getLastCompleteTime() { + return lastCompleteTime; + } + + public ResourceStatus setLastErrorMessage(String lastErrorMessage) { + this.lastErrorMessage = lastErrorMessage; + return this; + } + + public String getLastErrorMessage() { + return lastErrorMessage; + } + + public ResourceStatus setLastStartTime(Timestamp lastStartTime) { + this.lastStartTime = lastStartTime; + return this; + } + + public Timestamp getLastStartTime() { + return lastStartTime; + } + + public ResourceStatus setLastStatusChangeTime(Timestamp lastStatusChangeTime) { + this.lastStatusChangeTime = lastStatusChangeTime; + return this; + } + + public Timestamp getLastStatusChangeTime() { + return lastStatusChangeTime; + } + + public ResourceStatus setLifecycleState(ResourceStatusLifecycle lifecycleState) { + this.lifecycleState = lifecycleState; + return this; + } + + public ResourceStatusLifecycle getLifecycleState() { + return lifecycleState; + } + + public ResourceStatus setPipelineId(String pipelineId) { + this.pipelineId = pipelineId; + return this; + } + + public String getPipelineId() { + return pipelineId; + } + + public ResourceStatus setRunState(ResourceStatusRunState runState) { + this.runState = runState; + return this; + } + + public ResourceStatusRunState getRunState() { + return runState; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ResourceStatus that = (ResourceStatus) o; + return Objects.equals(createTime, that.createTime) + && Objects.equals(jobId, that.jobId) + && Objects.equals(lastCompleteTime, that.lastCompleteTime) + && Objects.equals(lastErrorMessage, that.lastErrorMessage) + && Objects.equals(lastStartTime, that.lastStartTime) + && Objects.equals(lastStatusChangeTime, that.lastStatusChangeTime) + && Objects.equals(lifecycleState, that.lifecycleState) + && Objects.equals(pipelineId, that.pipelineId) + && Objects.equals(runState, that.runState); + } + + @Override + public int hashCode() { + return Objects.hash( + createTime, + jobId, + lastCompleteTime, + lastErrorMessage, + lastStartTime, + lastStatusChangeTime, + lifecycleState, + pipelineId, + runState); + } + + @Override + public String toString() { + return new ToStringer(ResourceStatus.class) + .add("createTime", createTime) + .add("jobId", jobId) + .add("lastCompleteTime", lastCompleteTime) + .add("lastErrorMessage", lastErrorMessage) + .add("lastStartTime", lastStartTime) + .add("lastStatusChangeTime", lastStatusChangeTime) + .add("lifecycleState", lifecycleState) + .add("pipelineId", pipelineId) + .add("runState", runState) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatusLifecycle.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatusLifecycle.java new file mode 100644 index 000000000..635090e64 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatusLifecycle.java @@ -0,0 +1,14 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Configured scheduling / existence of the job or pipeline. */ +@Generated +public enum ResourceStatusLifecycle { + DELETED, + SCHEDULED, + STOPPED, + UNSCHEDULED, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatusRunState.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatusRunState.java new file mode 100644 index 000000000..34d463afc --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ResourceStatusRunState.java @@ -0,0 +1,14 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Outcome / progress of the most recent (or in-flight) run. */ +@Generated +public enum ResourceStatusRunState { + CANCELED, + FAILED, + RUNNING, + SUCCEEDED, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Rule.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Rule.java new file mode 100644 index 000000000..dae1247c2 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Rule.java @@ -0,0 +1,690 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Collection; +import java.util.Map; +import java.util.Objects; + +/** + * A Lakewatch detection rule: a query that evaluates ingested data and generates a signal for each + * match. Each rule is a securable in a Unity Catalog schema. + */ +@Generated +public class Rule { + /** Free-form client-managed key/value annotations. */ + @JsonProperty("annotations") + private Map annotations; + + /** Batch SQL rule input. */ + @JsonProperty("batch") + private RuleInputBatch batch; + + /** + * Name of the Unity Catalog catalog that contains the rule. Required. Cannot be changed after + * creation. Reads return the value as supplied; the catalog's current name is reported in + * `effective_catalog_name`. + */ + @JsonProperty("catalog_name") + private String catalogName; + + /** Free-form rule category. */ + @JsonProperty("category") + private String category; + + /** + * ID of the workspace whose compute runs this rule's jobs and owns its associated resources, such + * as the SQL warehouse a scheduled rule runs on. Server-assigned; a rule's warehouse can only be + * changed from this workspace. + */ + @JsonProperty("compute_workspace_id") + private String computeWorkspaceId; + + /** Immutable UUIDv4 identifying the authored content resource installed as this rule. */ + @JsonProperty("content_resource_id") + private String contentResourceId; + + /** Time the rule was created. */ + @JsonProperty("create_time") + private Timestamp createTime; + + /** Principal that created the rule. */ + @JsonProperty("created_by") + private Principal createdBy; + + /** Signal deduplication mode. */ + @JsonProperty("deduplication") + private RuleDeduplication deduplication; + + /** Time window for deduplication, such as `1h`, `24h`, `7d`, or `automatic`. */ + @JsonProperty("deduplication_time_window") + private String deduplicationTimeWindow; + + /** Free-form description. */ + @JsonProperty("description") + private String description; + + /** + * Current name of the Unity Catalog catalog that contains the rule. Reflects catalog renames, + * which do not change `catalog_name`. Unset until resolved. + */ + @JsonProperty("effective_catalog_name") + private String effectiveCatalogName; + + /** + * Current UC leaf name of the rule (server-owned). Tracks UC renames so callers can observe the + * live name without having to update the client-owned `rule_name`; unset until resolved. + */ + @JsonProperty("effective_rule_name") + private String effectiveRuleName; + + /** + * The identity this rule's job runs as: the resolved `run_as_principal`, or the requester's + * identity when it was omitted on create or cleared on update. The value is a user email or + * service-principal application ID, falling back to the numeric principal ID if that identity can + * no longer be resolved. Populated on single-rule reads (get/create/update); list responses omit + * it. + */ + @JsonProperty("effective_run_as_principal") + private String effectiveRunAsPrincipal; + + /** + * Current name of the Unity Catalog schema that contains the rule. Reflects schema renames, which + * do not change `schema_name`. Unset until resolved. + */ + @JsonProperty("effective_schema_name") + private String effectiveSchemaName; + + /** + * Opaque entity tag for optimistic concurrency. Content-version ETags change on user edits and + * remain stable across runtime status updates. + */ + @JsonProperty("etag") + private String etag; + + /** Signal quality for this rule. */ + @JsonProperty("fidelity") + private RuleFidelity fidelity; + + /** Up to 64 MITRE ATT&CK mappings, producing at most 192 flattened alert tags. */ + @JsonProperty("mitre") + private Collection mitre; + + /** + * Resource name, in the form `rules/{rule_id}`. Assigned by the server on create; required on + * update. + */ + @JsonProperty("name") + private String name; + + /** Long-form description of what this rule detects. */ + @JsonProperty("objective") + private String objective; + + /** Reference to the content pack this rule was originally installed from. */ + @JsonProperty("original_content_pack") + private ContentPackReference originalContentPack; + + /** What to record in each signal. */ + @JsonProperty("output") + private RuleOutput output; + + /** Unity Catalog owner of the rule. Assigned by the server. Populated by `GetRule`. */ + @JsonProperty("owner") + private Principal owner; + + /** + * Ordered reference URLs carried from the authored rule metadata. A maximum of three references + * of up to 512 characters each is supported. Requests exceeding these limits are rejected. + */ + @JsonProperty("references") + private Collection references; + + /** + * Unity Catalog securable UUID of the rule, and the last segment of `name`. Never changes, + * including when the rule's catalog or schema is renamed. + */ + @JsonProperty("rule_id") + private String ruleId; + + /** + * Name of the rule within its Unity Catalog schema. Required. Cannot be changed after creation. + * Reads return the value as supplied; the current UC name is reported in `effective_rule_name`. + */ + @JsonProperty("rule_name") + private String ruleName; + + /** + * The principal whose identity this rule's job runs as, given as a user email or + * service-principal application ID. When supplied on create/update, Lakewatch resolves the + * principal, records it on the rule, and creates the delegation to run as that principal — the + * requester must be authorized to delegate to it, or the request is rejected. When omitted on + * create, the requester's own identity is used. An update whose mask does not include + * `run_as_principal` keeps the current identity, and the requester must still be authorized to + * delegate to it; an editor who is not must supply a run_as_principal they can delegate to (for + * example, their own identity), or clear it, either of which reassigns the rule. An update whose + * mask includes `run_as_principal` but supplies no value clears it: the rule then runs as the + * requester, exactly as when it is omitted on create. Reads return the value as supplied; the + * identity the rule runs as is reported in `effective_run_as_principal`. + */ + @JsonProperty("run_as_principal") + private String runAsPrincipal; + + /** + * Long-form operational guidance carried from the authored rule metadata. Supports up to 4096 + * characters. Requests exceeding this limit are rejected. + */ + @JsonProperty("runbook") + private String runbook; + + /** When the rule executes. */ + @JsonProperty("schedule") + private RuleSchedule schedule; + + /** + * Name of the Unity Catalog schema that contains the rule. Required. Cannot be changed after + * creation. Reads return the value as supplied; the schema's current name is reported in + * `effective_schema_name`. + */ + @JsonProperty("schema_name") + private String schemaName; + + /** Free-form severity label, such as `Informational`, `Medium`, `High`, or `Critical`. */ + @JsonProperty("severity") + private String severity; + + /** Read-only lifecycle status. */ + @JsonProperty("status") + private ResourceStatus status; + + /** If set, this rule's signals do not open new alerts until the given time. */ + @JsonProperty("suppress_until_time") + private Timestamp suppressUntilTime; + + /** + * Time-range configuration for batch rules. If unset, the execution time range is extended by a + * fixed `15m` lookback. + */ + @JsonProperty("timerange") + private RuleTimeRange timerange; + + /** Time the rule was last updated. */ + @JsonProperty("update_time") + private Timestamp updateTime; + + /** Principal that last updated the rule. */ + @JsonProperty("updated_by") + private Principal updatedBy; + + /** + * Monotonic version, bumped on each update. Informational; use `etag` for optimistic concurrency. + */ + @JsonProperty("version") + private Long version; + + public Rule setAnnotations(Map annotations) { + this.annotations = annotations; + return this; + } + + public Map getAnnotations() { + return annotations; + } + + public Rule setBatch(RuleInputBatch batch) { + this.batch = batch; + return this; + } + + public RuleInputBatch getBatch() { + return batch; + } + + public Rule setCatalogName(String catalogName) { + this.catalogName = catalogName; + return this; + } + + public String getCatalogName() { + return catalogName; + } + + public Rule setCategory(String category) { + this.category = category; + return this; + } + + public String getCategory() { + return category; + } + + public Rule setComputeWorkspaceId(String computeWorkspaceId) { + this.computeWorkspaceId = computeWorkspaceId; + return this; + } + + public String getComputeWorkspaceId() { + return computeWorkspaceId; + } + + public Rule setContentResourceId(String contentResourceId) { + this.contentResourceId = contentResourceId; + return this; + } + + public String getContentResourceId() { + return contentResourceId; + } + + public Rule setCreateTime(Timestamp createTime) { + this.createTime = createTime; + return this; + } + + public Timestamp getCreateTime() { + return createTime; + } + + public Rule setCreatedBy(Principal createdBy) { + this.createdBy = createdBy; + return this; + } + + public Principal getCreatedBy() { + return createdBy; + } + + public Rule setDeduplication(RuleDeduplication deduplication) { + this.deduplication = deduplication; + return this; + } + + public RuleDeduplication getDeduplication() { + return deduplication; + } + + public Rule setDeduplicationTimeWindow(String deduplicationTimeWindow) { + this.deduplicationTimeWindow = deduplicationTimeWindow; + return this; + } + + public String getDeduplicationTimeWindow() { + return deduplicationTimeWindow; + } + + public Rule setDescription(String description) { + this.description = description; + return this; + } + + public String getDescription() { + return description; + } + + public Rule setEffectiveCatalogName(String effectiveCatalogName) { + this.effectiveCatalogName = effectiveCatalogName; + return this; + } + + public String getEffectiveCatalogName() { + return effectiveCatalogName; + } + + public Rule setEffectiveRuleName(String effectiveRuleName) { + this.effectiveRuleName = effectiveRuleName; + return this; + } + + public String getEffectiveRuleName() { + return effectiveRuleName; + } + + public Rule setEffectiveRunAsPrincipal(String effectiveRunAsPrincipal) { + this.effectiveRunAsPrincipal = effectiveRunAsPrincipal; + return this; + } + + public String getEffectiveRunAsPrincipal() { + return effectiveRunAsPrincipal; + } + + public Rule setEffectiveSchemaName(String effectiveSchemaName) { + this.effectiveSchemaName = effectiveSchemaName; + return this; + } + + public String getEffectiveSchemaName() { + return effectiveSchemaName; + } + + public Rule setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public Rule setFidelity(RuleFidelity fidelity) { + this.fidelity = fidelity; + return this; + } + + public RuleFidelity getFidelity() { + return fidelity; + } + + public Rule setMitre(Collection mitre) { + this.mitre = mitre; + return this; + } + + public Collection getMitre() { + return mitre; + } + + public Rule setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public Rule setObjective(String objective) { + this.objective = objective; + return this; + } + + public String getObjective() { + return objective; + } + + public Rule setOriginalContentPack(ContentPackReference originalContentPack) { + this.originalContentPack = originalContentPack; + return this; + } + + public ContentPackReference getOriginalContentPack() { + return originalContentPack; + } + + public Rule setOutput(RuleOutput output) { + this.output = output; + return this; + } + + public RuleOutput getOutput() { + return output; + } + + public Rule setOwner(Principal owner) { + this.owner = owner; + return this; + } + + public Principal getOwner() { + return owner; + } + + public Rule setReferences(Collection references) { + this.references = references; + return this; + } + + public Collection getReferences() { + return references; + } + + public Rule setRuleId(String ruleId) { + this.ruleId = ruleId; + return this; + } + + public String getRuleId() { + return ruleId; + } + + public Rule setRuleName(String ruleName) { + this.ruleName = ruleName; + return this; + } + + public String getRuleName() { + return ruleName; + } + + public Rule setRunAsPrincipal(String runAsPrincipal) { + this.runAsPrincipal = runAsPrincipal; + return this; + } + + public String getRunAsPrincipal() { + return runAsPrincipal; + } + + public Rule setRunbook(String runbook) { + this.runbook = runbook; + return this; + } + + public String getRunbook() { + return runbook; + } + + public Rule setSchedule(RuleSchedule schedule) { + this.schedule = schedule; + return this; + } + + public RuleSchedule getSchedule() { + return schedule; + } + + public Rule setSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + public String getSchemaName() { + return schemaName; + } + + public Rule setSeverity(String severity) { + this.severity = severity; + return this; + } + + public String getSeverity() { + return severity; + } + + public Rule setStatus(ResourceStatus status) { + this.status = status; + return this; + } + + public ResourceStatus getStatus() { + return status; + } + + public Rule setSuppressUntilTime(Timestamp suppressUntilTime) { + this.suppressUntilTime = suppressUntilTime; + return this; + } + + public Timestamp getSuppressUntilTime() { + return suppressUntilTime; + } + + public Rule setTimerange(RuleTimeRange timerange) { + this.timerange = timerange; + return this; + } + + public RuleTimeRange getTimerange() { + return timerange; + } + + public Rule setUpdateTime(Timestamp updateTime) { + this.updateTime = updateTime; + return this; + } + + public Timestamp getUpdateTime() { + return updateTime; + } + + public Rule setUpdatedBy(Principal updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + public Principal getUpdatedBy() { + return updatedBy; + } + + public Rule setVersion(Long version) { + this.version = version; + return this; + } + + public Long getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Rule that = (Rule) o; + return Objects.equals(annotations, that.annotations) + && Objects.equals(batch, that.batch) + && Objects.equals(catalogName, that.catalogName) + && Objects.equals(category, that.category) + && Objects.equals(computeWorkspaceId, that.computeWorkspaceId) + && Objects.equals(contentResourceId, that.contentResourceId) + && Objects.equals(createTime, that.createTime) + && Objects.equals(createdBy, that.createdBy) + && Objects.equals(deduplication, that.deduplication) + && Objects.equals(deduplicationTimeWindow, that.deduplicationTimeWindow) + && Objects.equals(description, that.description) + && Objects.equals(effectiveCatalogName, that.effectiveCatalogName) + && Objects.equals(effectiveRuleName, that.effectiveRuleName) + && Objects.equals(effectiveRunAsPrincipal, that.effectiveRunAsPrincipal) + && Objects.equals(effectiveSchemaName, that.effectiveSchemaName) + && Objects.equals(etag, that.etag) + && Objects.equals(fidelity, that.fidelity) + && Objects.equals(mitre, that.mitre) + && Objects.equals(name, that.name) + && Objects.equals(objective, that.objective) + && Objects.equals(originalContentPack, that.originalContentPack) + && Objects.equals(output, that.output) + && Objects.equals(owner, that.owner) + && Objects.equals(references, that.references) + && Objects.equals(ruleId, that.ruleId) + && Objects.equals(ruleName, that.ruleName) + && Objects.equals(runAsPrincipal, that.runAsPrincipal) + && Objects.equals(runbook, that.runbook) + && Objects.equals(schedule, that.schedule) + && Objects.equals(schemaName, that.schemaName) + && Objects.equals(severity, that.severity) + && Objects.equals(status, that.status) + && Objects.equals(suppressUntilTime, that.suppressUntilTime) + && Objects.equals(timerange, that.timerange) + && Objects.equals(updateTime, that.updateTime) + && Objects.equals(updatedBy, that.updatedBy) + && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash( + annotations, + batch, + catalogName, + category, + computeWorkspaceId, + contentResourceId, + createTime, + createdBy, + deduplication, + deduplicationTimeWindow, + description, + effectiveCatalogName, + effectiveRuleName, + effectiveRunAsPrincipal, + effectiveSchemaName, + etag, + fidelity, + mitre, + name, + objective, + originalContentPack, + output, + owner, + references, + ruleId, + ruleName, + runAsPrincipal, + runbook, + schedule, + schemaName, + severity, + status, + suppressUntilTime, + timerange, + updateTime, + updatedBy, + version); + } + + @Override + public String toString() { + return new ToStringer(Rule.class) + .add("annotations", annotations) + .add("batch", batch) + .add("catalogName", catalogName) + .add("category", category) + .add("computeWorkspaceId", computeWorkspaceId) + .add("contentResourceId", contentResourceId) + .add("createTime", createTime) + .add("createdBy", createdBy) + .add("deduplication", deduplication) + .add("deduplicationTimeWindow", deduplicationTimeWindow) + .add("description", description) + .add("effectiveCatalogName", effectiveCatalogName) + .add("effectiveRuleName", effectiveRuleName) + .add("effectiveRunAsPrincipal", effectiveRunAsPrincipal) + .add("effectiveSchemaName", effectiveSchemaName) + .add("etag", etag) + .add("fidelity", fidelity) + .add("mitre", mitre) + .add("name", name) + .add("objective", objective) + .add("originalContentPack", originalContentPack) + .add("output", output) + .add("owner", owner) + .add("references", references) + .add("ruleId", ruleId) + .add("ruleName", ruleName) + .add("runAsPrincipal", runAsPrincipal) + .add("runbook", runbook) + .add("schedule", schedule) + .add("schemaName", schemaName) + .add("severity", severity) + .add("status", status) + .add("suppressUntilTime", suppressUntilTime) + .add("timerange", timerange) + .add("updateTime", updateTime) + .add("updatedBy", updatedBy) + .add("version", version) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleConfig.java new file mode 100644 index 000000000..458f88c3d --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleConfig.java @@ -0,0 +1,235 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Collection; +import java.util.Objects; + +/** Per-catalog rule-related config. Singleton. Name format: `catalogs/{catalog}/ruleConfig`. */ +@Generated +public class RuleConfig { + /** + * Schema name of the registered folder (in this catalog) that a new rule is placed in when the + * request does not specify a schema. Must name a schema registered as a folder. Omit to clear. + * Reads return the value as supplied; the folder's current schema name is reported in + * `effective_default_folder`. + */ + @JsonProperty("default_folder") + private String defaultFolder; + + /** Default schedule for rules that don't specify one. */ + @JsonProperty("default_schedule") + private RuleSchedule defaultSchedule; + + /** + * Default duration string for signal deduplication when a rule doesn't override it — compact + * day/hour/minute/second components, e.g. `5d`, `1h`. Reads return the value as supplied; there + * is no server default, so it is unset until set. An empty value clears it. + */ + @JsonProperty("default_signal_collation_window") + private String defaultSignalCollationWindow; + + /** + * Available detection categories a rule can be tagged with. Reads return the value as supplied. + * When empty, rules can be tagged with the default categories: `Static Signature`, `Fuzzy + * Signature`, `Behavioral`, `Statistical`, and `Learning (AI/ML)`. The categories in effect are + * reported in `effective_detection_categories`. + */ + @JsonProperty("detection_categories") + private Collection detectionCategories; + + /** + * The current schema name of the `default_folder` folder. Tracks UC schema renames. Unset when no + * default is configured, or when the folder's schema no longer exists or is not visible to the + * caller. + */ + @JsonProperty("effective_default_folder") + private String effectiveDefaultFolder; + + /** + * The detection categories in effect: `detection_categories` when set, otherwise the default + * categories. + */ + @JsonProperty("effective_detection_categories") + private Collection effectiveDetectionCategories; + + /** + * Opaque entity tag for optimistic concurrency. Returned on every read; pass it back as the + * Update request's `etag` to make the update conditional on the resource being unchanged. + */ + @JsonProperty("etag") + private String etag; + + /** */ + @JsonProperty("name") + private String name; + + /** */ + @JsonProperty("update_time") + private Timestamp updateTime; + + /** */ + @JsonProperty("updated_by") + private Principal updatedBy; + + /** + * Monotonic version, bumped on each update. Informational; use `etag` for optimistic concurrency. + */ + @JsonProperty("version") + private Long version; + + public RuleConfig setDefaultFolder(String defaultFolder) { + this.defaultFolder = defaultFolder; + return this; + } + + public String getDefaultFolder() { + return defaultFolder; + } + + public RuleConfig setDefaultSchedule(RuleSchedule defaultSchedule) { + this.defaultSchedule = defaultSchedule; + return this; + } + + public RuleSchedule getDefaultSchedule() { + return defaultSchedule; + } + + public RuleConfig setDefaultSignalCollationWindow(String defaultSignalCollationWindow) { + this.defaultSignalCollationWindow = defaultSignalCollationWindow; + return this; + } + + public String getDefaultSignalCollationWindow() { + return defaultSignalCollationWindow; + } + + public RuleConfig setDetectionCategories(Collection detectionCategories) { + this.detectionCategories = detectionCategories; + return this; + } + + public Collection getDetectionCategories() { + return detectionCategories; + } + + public RuleConfig setEffectiveDefaultFolder(String effectiveDefaultFolder) { + this.effectiveDefaultFolder = effectiveDefaultFolder; + return this; + } + + public String getEffectiveDefaultFolder() { + return effectiveDefaultFolder; + } + + public RuleConfig setEffectiveDetectionCategories( + Collection effectiveDetectionCategories) { + this.effectiveDetectionCategories = effectiveDetectionCategories; + return this; + } + + public Collection getEffectiveDetectionCategories() { + return effectiveDetectionCategories; + } + + public RuleConfig setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public RuleConfig setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public RuleConfig setUpdateTime(Timestamp updateTime) { + this.updateTime = updateTime; + return this; + } + + public Timestamp getUpdateTime() { + return updateTime; + } + + public RuleConfig setUpdatedBy(Principal updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + public Principal getUpdatedBy() { + return updatedBy; + } + + public RuleConfig setVersion(Long version) { + this.version = version; + return this; + } + + public Long getVersion() { + return version; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleConfig that = (RuleConfig) o; + return Objects.equals(defaultFolder, that.defaultFolder) + && Objects.equals(defaultSchedule, that.defaultSchedule) + && Objects.equals(defaultSignalCollationWindow, that.defaultSignalCollationWindow) + && Objects.equals(detectionCategories, that.detectionCategories) + && Objects.equals(effectiveDefaultFolder, that.effectiveDefaultFolder) + && Objects.equals(effectiveDetectionCategories, that.effectiveDetectionCategories) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(updateTime, that.updateTime) + && Objects.equals(updatedBy, that.updatedBy) + && Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultFolder, + defaultSchedule, + defaultSignalCollationWindow, + detectionCategories, + effectiveDefaultFolder, + effectiveDetectionCategories, + etag, + name, + updateTime, + updatedBy, + version); + } + + @Override + public String toString() { + return new ToStringer(RuleConfig.class) + .add("defaultFolder", defaultFolder) + .add("defaultSchedule", defaultSchedule) + .add("defaultSignalCollationWindow", defaultSignalCollationWindow) + .add("detectionCategories", detectionCategories) + .add("effectiveDefaultFolder", effectiveDefaultFolder) + .add("effectiveDetectionCategories", effectiveDetectionCategories) + .add("etag", etag) + .add("name", name) + .add("updateTime", updateTime) + .add("updatedBy", updatedBy) + .add("version", version) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleDeduplication.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleDeduplication.java new file mode 100644 index 000000000..d7b24a8e0 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleDeduplication.java @@ -0,0 +1,13 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Signal deduplication mode for a detection rule. */ +@Generated +public enum RuleDeduplication { + DEDUPLICATION_DEFAULT, + DEDUPLICATION_DISABLED, + DEDUPLICATION_ENABLED, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleFidelity.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleFidelity.java new file mode 100644 index 000000000..e2ce3ad34 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleFidelity.java @@ -0,0 +1,14 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Maturity of a detection rule. */ +@Generated +public enum RuleFidelity { + FIDELITY_DEVELOPMENT, + FIDELITY_HIGH, + FIDELITY_INVESTIGATIVE, + FIDELITY_MEDIUM, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputBatch.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputBatch.java new file mode 100644 index 000000000..7d6615f24 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputBatch.java @@ -0,0 +1,75 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Batch input for a detection rule. */ +@Generated +public class RuleInputBatch { + /** Custom-notebook user function. The output is used as input data for the rule. */ + @JsonProperty("custom") + private RuleInputCustomNotebook custom; + + /** SQL query evaluated as the rule input. */ + @JsonProperty("sql") + private RuleInputBatchSql sql; + + /** SQL warehouse used to run this batch rule. */ + @JsonProperty("warehouse_id") + private String warehouseId; + + public RuleInputBatch setCustom(RuleInputCustomNotebook custom) { + this.custom = custom; + return this; + } + + public RuleInputCustomNotebook getCustom() { + return custom; + } + + public RuleInputBatch setSql(RuleInputBatchSql sql) { + this.sql = sql; + return this; + } + + public RuleInputBatchSql getSql() { + return sql; + } + + public RuleInputBatch setWarehouseId(String warehouseId) { + this.warehouseId = warehouseId; + return this; + } + + public String getWarehouseId() { + return warehouseId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleInputBatch that = (RuleInputBatch) o; + return Objects.equals(custom, that.custom) + && Objects.equals(sql, that.sql) + && Objects.equals(warehouseId, that.warehouseId); + } + + @Override + public int hashCode() { + return Objects.hash(custom, sql, warehouseId); + } + + @Override + public String toString() { + return new ToStringer(RuleInputBatch.class) + .add("custom", custom) + .add("sql", sql) + .add("warehouseId", warehouseId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputBatchSql.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputBatchSql.java new file mode 100644 index 000000000..84f0dc23b --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputBatchSql.java @@ -0,0 +1,81 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Batch SQL input for a detection rule. */ +@Generated +public class RuleInputBatchSql { + /** + * Default catalog used to resolve unqualified identifiers in `query`. If unset, the rule's + * `catalog_name` is used. + */ + @JsonProperty("default_catalog_name") + private String defaultCatalogName; + + /** + * Default schema used to resolve unqualified identifiers in `query`. If unset, the rule's + * `schema_name` is used. + */ + @JsonProperty("default_schema_name") + private String defaultSchemaName; + + /** SQL query evaluated as the rule input. */ + @JsonProperty("query") + private String query; + + public RuleInputBatchSql setDefaultCatalogName(String defaultCatalogName) { + this.defaultCatalogName = defaultCatalogName; + return this; + } + + public String getDefaultCatalogName() { + return defaultCatalogName; + } + + public RuleInputBatchSql setDefaultSchemaName(String defaultSchemaName) { + this.defaultSchemaName = defaultSchemaName; + return this; + } + + public String getDefaultSchemaName() { + return defaultSchemaName; + } + + public RuleInputBatchSql setQuery(String query) { + this.query = query; + return this; + } + + public String getQuery() { + return query; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleInputBatchSql that = (RuleInputBatchSql) o; + return Objects.equals(defaultCatalogName, that.defaultCatalogName) + && Objects.equals(defaultSchemaName, that.defaultSchemaName) + && Objects.equals(query, that.query); + } + + @Override + public int hashCode() { + return Objects.hash(defaultCatalogName, defaultSchemaName, query); + } + + @Override + public String toString() { + return new ToStringer(RuleInputBatchSql.class) + .add("defaultCatalogName", defaultCatalogName) + .add("defaultSchemaName", defaultSchemaName) + .add("query", query) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputCustomNotebook.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputCustomNotebook.java new file mode 100644 index 000000000..edaafdb2c --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleInputCustomNotebook.java @@ -0,0 +1,62 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.Objects; + +/** Reference to a custom-user-function notebook for stream or batch input. */ +@Generated +public class RuleInputCustomNotebook { + /** + * Fully-qualified notebook path, or a path relative to the configured base notebook directory. + */ + @JsonProperty("notebook") + private String notebook; + + /** Optional arguments supplied when invoking the custom function. */ + @JsonProperty("options") + private Map options; + + public RuleInputCustomNotebook setNotebook(String notebook) { + this.notebook = notebook; + return this; + } + + public String getNotebook() { + return notebook; + } + + public RuleInputCustomNotebook setOptions(Map options) { + this.options = options; + return this; + } + + public Map getOptions() { + return options; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleInputCustomNotebook that = (RuleInputCustomNotebook) o; + return Objects.equals(notebook, that.notebook) && Objects.equals(options, that.options); + } + + @Override + public int hashCode() { + return Objects.hash(notebook, options); + } + + @Override + public String toString() { + return new ToStringer(RuleInputCustomNotebook.class) + .add("notebook", notebook) + .add("options", options) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleMitreMapping.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleMitreMapping.java new file mode 100644 index 000000000..cad09d203 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleMitreMapping.java @@ -0,0 +1,120 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** MITRE ATT&CK mapping for a detection rule. */ +@Generated +public class RuleMitreMapping { + /** Human-readable MITRE sub-technique name. */ + @JsonProperty("sub_technique") + private String subTechnique; + + /** MITRE sub-technique ID, such as `T1078.001`. */ + @JsonProperty("sub_technique_id") + private String subTechniqueId; + + /** Adversary objective during this attack, such as `Command and Control`. */ + @JsonProperty("tactic") + private String tactic; + + /** Structured framework that organizes adversary behaviors, such as `mitre-attack`. */ + @JsonProperty("taxonomy") + private String taxonomy; + + /** Human-readable MITRE technique name. */ + @JsonProperty("technique") + private String technique; + + /** MITRE technique ID, such as `T1078`. */ + @JsonProperty("technique_id") + private String techniqueId; + + public RuleMitreMapping setSubTechnique(String subTechnique) { + this.subTechnique = subTechnique; + return this; + } + + public String getSubTechnique() { + return subTechnique; + } + + public RuleMitreMapping setSubTechniqueId(String subTechniqueId) { + this.subTechniqueId = subTechniqueId; + return this; + } + + public String getSubTechniqueId() { + return subTechniqueId; + } + + public RuleMitreMapping setTactic(String tactic) { + this.tactic = tactic; + return this; + } + + public String getTactic() { + return tactic; + } + + public RuleMitreMapping setTaxonomy(String taxonomy) { + this.taxonomy = taxonomy; + return this; + } + + public String getTaxonomy() { + return taxonomy; + } + + public RuleMitreMapping setTechnique(String technique) { + this.technique = technique; + return this; + } + + public String getTechnique() { + return technique; + } + + public RuleMitreMapping setTechniqueId(String techniqueId) { + this.techniqueId = techniqueId; + return this; + } + + public String getTechniqueId() { + return techniqueId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleMitreMapping that = (RuleMitreMapping) o; + return Objects.equals(subTechnique, that.subTechnique) + && Objects.equals(subTechniqueId, that.subTechniqueId) + && Objects.equals(tactic, that.tactic) + && Objects.equals(taxonomy, that.taxonomy) + && Objects.equals(technique, that.technique) + && Objects.equals(techniqueId, that.techniqueId); + } + + @Override + public int hashCode() { + return Objects.hash(subTechnique, subTechniqueId, tactic, taxonomy, technique, techniqueId); + } + + @Override + public String toString() { + return new ToStringer(RuleMitreMapping.class) + .add("subTechnique", subTechnique) + .add("subTechniqueId", subTechniqueId) + .add("tactic", tactic) + .add("taxonomy", taxonomy) + .add("technique", technique) + .add("techniqueId", techniqueId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleOutput.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleOutput.java new file mode 100644 index 000000000..c8d763732 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleOutput.java @@ -0,0 +1,99 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; +import java.util.Objects; + +/** What to record in each signal that this rule generates. */ +@Generated +public class RuleOutput { + /** + * Key/value context to record from the input row. Values may contain SQL expressions in braces. + */ + @JsonProperty("context") + private Map context; + + /** + * If true, also record every column of the triggering input row. Custom context wins on key + * collision. + */ + @JsonProperty("default_context") + private Boolean defaultContext; + + /** Column in the rule output that holds the event timestamp. */ + @JsonProperty("event_time_column") + private String eventTimeColumn; + + /** + * Signal summary. May contain SQL expressions in braces that the server substitutes from the + * input row. + */ + @JsonProperty("summary") + private String summary; + + public RuleOutput setContext(Map context) { + this.context = context; + return this; + } + + public Map getContext() { + return context; + } + + public RuleOutput setDefaultContext(Boolean defaultContext) { + this.defaultContext = defaultContext; + return this; + } + + public Boolean getDefaultContext() { + return defaultContext; + } + + public RuleOutput setEventTimeColumn(String eventTimeColumn) { + this.eventTimeColumn = eventTimeColumn; + return this; + } + + public String getEventTimeColumn() { + return eventTimeColumn; + } + + public RuleOutput setSummary(String summary) { + this.summary = summary; + return this; + } + + public String getSummary() { + return summary; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleOutput that = (RuleOutput) o; + return Objects.equals(context, that.context) + && Objects.equals(defaultContext, that.defaultContext) + && Objects.equals(eventTimeColumn, that.eventTimeColumn) + && Objects.equals(summary, that.summary); + } + + @Override + public int hashCode() { + return Objects.hash(context, defaultContext, eventTimeColumn, summary); + } + + @Override + public String toString() { + return new ToStringer(RuleOutput.class) + .add("context", context) + .add("defaultContext", defaultContext) + .add("eventTimeColumn", eventTimeColumn) + .add("summary", summary) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleSchedule.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleSchedule.java new file mode 100644 index 000000000..218908674 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleSchedule.java @@ -0,0 +1,102 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Defines when a detection rule executes. + * + *

A batch rule sets exactly one of `at_least_every` or `cron_expression`. A streaming rule runs + * continuously and sets no timing; it accepts only `enabled`, and an omitted schedule means + * enabled. The server rejects any other combination. `enabled` is orthogonal to the timing. + */ +@Generated +public class RuleSchedule { + /** + * Defines the minimum cadence as a duration string. It may contain components for days, hours, + * minutes, and seconds (e.g. `5d`, `5d3h`, `3d2h5m12s`, `12m16s`). + */ + @JsonProperty("at_least_every") + private String atLeastEvery; + + /** + * Runs the rule continuously. Detection rules do not accept it: batch rules reject it, and + * streaming rules run continuously without it. + */ + @JsonProperty("continuous") + private Boolean continuous; + + /** Defines the schedule using a Quartz cron expression. */ + @JsonProperty("cron_expression") + private String cronExpression; + + /** Sets whether the job is scheduled to run. Defaults to true. */ + @JsonProperty("enabled") + private Boolean enabled; + + public RuleSchedule setAtLeastEvery(String atLeastEvery) { + this.atLeastEvery = atLeastEvery; + return this; + } + + public String getAtLeastEvery() { + return atLeastEvery; + } + + public RuleSchedule setContinuous(Boolean continuous) { + this.continuous = continuous; + return this; + } + + public Boolean getContinuous() { + return continuous; + } + + public RuleSchedule setCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + return this; + } + + public String getCronExpression() { + return cronExpression; + } + + public RuleSchedule setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + public Boolean getEnabled() { + return enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleSchedule that = (RuleSchedule) o; + return Objects.equals(atLeastEvery, that.atLeastEvery) + && Objects.equals(continuous, that.continuous) + && Objects.equals(cronExpression, that.cronExpression) + && Objects.equals(enabled, that.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(atLeastEvery, continuous, cronExpression, enabled); + } + + @Override + public String toString() { + return new ToStringer(RuleSchedule.class) + .add("atLeastEvery", atLeastEvery) + .add("continuous", continuous) + .add("cronExpression", cronExpression) + .add("enabled", enabled) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleTimeRange.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleTimeRange.java new file mode 100644 index 000000000..991395873 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleTimeRange.java @@ -0,0 +1,49 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Time-range configuration for a batch detection rule. */ +@Generated +public class RuleTimeRange { + /** + * Extends the start of the execution time range by a compact duration with integer days, hours, + * minutes, and seconds in that order, such as `1h30m` or `15m`. Zero duration disables extension. + * Unset or empty uses a fixed `15m` at execution time. Only the start moves; the end is + * unchanged. Has no effect on batch SQL that does not use `IN_TIMERANGE`. Values must fit signed + * 64-bit microseconds. + */ + @JsonProperty("extend_lookback") + private String extendLookback; + + public RuleTimeRange setExtendLookback(String extendLookback) { + this.extendLookback = extendLookback; + return this; + } + + public String getExtendLookback() { + return extendLookback; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RuleTimeRange that = (RuleTimeRange) o; + return Objects.equals(extendLookback, that.extendLookback); + } + + @Override + public int hashCode() { + return Objects.hash(extendLookback); + } + + @Override + public String toString() { + return new ToStringer(RuleTimeRange.class).add("extendLookback", extendLookback).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleView.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleView.java new file mode 100644 index 000000000..eaeb40ffb --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/RuleView.java @@ -0,0 +1,12 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; + +/** Selects how much of each rule a list response returns. */ +@Generated +public enum RuleView { + RULE_VIEW_BASIC, + RULE_VIEW_FULL, +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Schedule.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Schedule.java new file mode 100644 index 000000000..3af217570 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/Schedule.java @@ -0,0 +1,117 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Defines when a recurring job executes. + * + *

Exactly one of the timing modes (`at_least_every`, `cron_expression`, `continuous`) must be + * set; combining them or setting none is rejected by the server. `compute_group` and `enabled` are + * orthogonal to the timing. + */ +@Generated +public class Schedule { + /** + * Duration string defining the minimum cadence. May contain components for days, hours, minutes, + * seconds (e.g. `5d`, `5d3h`, `3d2h5m12s`, `12m16s`). + */ + @JsonProperty("at_least_every") + private String atLeastEvery; + + /** + * `dedicated`, `inherited`, `automatic`, or a custom group name. Reads return the value as + * supplied. A rule whose schedule omits it runs on `dedicated`. + */ + @JsonProperty("compute_group") + private String computeGroup; + + /** Run continuously (sentinel — must be `true` when set in this branch). */ + @JsonProperty("continuous") + private Boolean continuous; + + /** Quartz cron expression. */ + @JsonProperty("cron_expression") + private String cronExpression; + + /** Whether the job is scheduled to run. Defaults to true. */ + @JsonProperty("enabled") + private Boolean enabled; + + public Schedule setAtLeastEvery(String atLeastEvery) { + this.atLeastEvery = atLeastEvery; + return this; + } + + public String getAtLeastEvery() { + return atLeastEvery; + } + + public Schedule setComputeGroup(String computeGroup) { + this.computeGroup = computeGroup; + return this; + } + + public String getComputeGroup() { + return computeGroup; + } + + public Schedule setContinuous(Boolean continuous) { + this.continuous = continuous; + return this; + } + + public Boolean getContinuous() { + return continuous; + } + + public Schedule setCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + return this; + } + + public String getCronExpression() { + return cronExpression; + } + + public Schedule setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + public Boolean getEnabled() { + return enabled; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Schedule that = (Schedule) o; + return Objects.equals(atLeastEvery, that.atLeastEvery) + && Objects.equals(computeGroup, that.computeGroup) + && Objects.equals(continuous, that.continuous) + && Objects.equals(cronExpression, that.cronExpression) + && Objects.equals(enabled, that.enabled); + } + + @Override + public int hashCode() { + return Objects.hash(atLeastEvery, computeGroup, continuous, cronExpression, enabled); + } + + @Override + public String toString() { + return new ToStringer(Schedule.class) + .add("atLeastEvery", atLeastEvery) + .add("computeGroup", computeGroup) + .add("continuous", continuous) + .add("cronExpression", cronExpression) + .add("enabled", enabled) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ServiceNowExportConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ServiceNowExportConfig.java new file mode 100644 index 000000000..50607df02 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/ServiceNowExportConfig.java @@ -0,0 +1,89 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * ServiceNow destination. Alerts are delivered to the instance's Table API, authorized by an OAuth + * 2.0 client-credentials token minted from the registered application's client ID and secret. + */ +@Generated +public class ServiceNowExportConfig { + /** + * OAuth client ID of the registered ServiceNow application. An identifier rather than secret + * material — ServiceNow shows it on the application record — so it is stored and read back + * verbatim. + */ + @JsonProperty("client_id") + private String clientId; + + /** + * Three-level Unity Catalog name (`catalog.schema.secret`) of the secret holding the OAuth client + * secret. Only the name is stored; the secret is read when an alert is exported, so rotating it + * takes effect without editing this config. + */ + @JsonProperty("client_secret_uc_secret") + private String clientSecretUcSecret; + + /** + * ServiceNow instance ID — the host label only, not the full URL. For an instance reachable at + * `https://acme.service-now.com`, this is `acme`. + */ + @JsonProperty("instance_id") + private String instanceId; + + public ServiceNowExportConfig setClientId(String clientId) { + this.clientId = clientId; + return this; + } + + public String getClientId() { + return clientId; + } + + public ServiceNowExportConfig setClientSecretUcSecret(String clientSecretUcSecret) { + this.clientSecretUcSecret = clientSecretUcSecret; + return this; + } + + public String getClientSecretUcSecret() { + return clientSecretUcSecret; + } + + public ServiceNowExportConfig setInstanceId(String instanceId) { + this.instanceId = instanceId; + return this; + } + + public String getInstanceId() { + return instanceId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ServiceNowExportConfig that = (ServiceNowExportConfig) o; + return Objects.equals(clientId, that.clientId) + && Objects.equals(clientSecretUcSecret, that.clientSecretUcSecret) + && Objects.equals(instanceId, that.instanceId); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecretUcSecret, instanceId); + } + + @Override + public String toString() { + return new ToStringer(ServiceNowExportConfig.class) + .add("clientId", clientId) + .add("clientSecretUcSecret", clientSecretUcSecret) + .add("instanceId", instanceId) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/SlackExportConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/SlackExportConfig.java new file mode 100644 index 000000000..7fbac4a13 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/SlackExportConfig.java @@ -0,0 +1,70 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class SlackExportConfig { + /** + * Three-level Unity Catalog name (`catalog.schema.secret`) of the secret holding the Slack bot + * token. Only the name is stored; the token is read when an alert is exported, so rotating the + * secret takes effect without editing this config. + */ + @JsonProperty("bot_token_uc_secret") + private String botTokenUcSecret; + + /** + * Channel the alert is posted to: a channel ID (e.g. `C0123456789`) or a channel name without the + * leading `#` (e.g. `soc-alerts`). The value is stored as sent, so a leading `#`, surrounding + * whitespace, or a value naming more than one channel is rejected. For private channels, prefer + * the channel ID — Slack does not guarantee name resolution for those. + * + *

The Slack app must be a member of the channel and hold the `chat:write` scope. + */ + @JsonProperty("channel") + private String channel; + + public SlackExportConfig setBotTokenUcSecret(String botTokenUcSecret) { + this.botTokenUcSecret = botTokenUcSecret; + return this; + } + + public String getBotTokenUcSecret() { + return botTokenUcSecret; + } + + public SlackExportConfig setChannel(String channel) { + this.channel = channel; + return this; + } + + public String getChannel() { + return channel; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SlackExportConfig that = (SlackExportConfig) o; + return Objects.equals(botTokenUcSecret, that.botTokenUcSecret) + && Objects.equals(channel, that.channel); + } + + @Override + public int hashCode() { + return Objects.hash(botTokenUcSecret, channel); + } + + @Override + public String toString() { + return new ToStringer(SlackExportConfig.class) + .add("botTokenUcSecret", botTokenUcSecret) + .add("channel", channel) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/TableName.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/TableName.java new file mode 100644 index 000000000..a933f29d2 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/TableName.java @@ -0,0 +1,75 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** A fully-qualified Unity Catalog table reference by catalog / schema / table name. */ +@Generated +public class TableName { + /** Name of the parent Unity Catalog catalog. */ + @JsonProperty("catalog_name") + private String catalogName; + + /** Name of the parent Unity Catalog schema. */ + @JsonProperty("schema_name") + private String schemaName; + + /** Unity Catalog table name. */ + @JsonProperty("table_name") + private String tableName; + + public TableName setCatalogName(String catalogName) { + this.catalogName = catalogName; + return this; + } + + public String getCatalogName() { + return catalogName; + } + + public TableName setSchemaName(String schemaName) { + this.schemaName = schemaName; + return this; + } + + public String getSchemaName() { + return schemaName; + } + + public TableName setTableName(String tableName) { + this.tableName = tableName; + return this; + } + + public String getTableName() { + return tableName; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + TableName that = (TableName) o; + return Objects.equals(catalogName, that.catalogName) + && Objects.equals(schemaName, that.schemaName) + && Objects.equals(tableName, that.tableName); + } + + @Override + public int hashCode() { + return Objects.hash(catalogName, schemaName, tableName); + } + + @Override + public String toString() { + return new ToStringer(TableName.class) + .add("catalogName", catalogName) + .add("schemaName", schemaName) + .add("tableName", tableName) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/TinesExportConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/TinesExportConfig.java new file mode 100644 index 000000000..fb1ada1d1 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/TinesExportConfig.java @@ -0,0 +1,99 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** + * Tines destination. Alerts are delivered to a Tines webhook action, authorized by a secret sent in + * the `Authorization` header. + */ +@Generated +public class TinesExportConfig { + /** + * Whether a later change to an already-exported alert is delivered too, as a second + * `lakewatch.alert.updated` event to the same webhook action (a close is such an update, carrying + * a terminal `alert_state`). Creation export is unaffected either way. + * + *

Opt-in, and unset means off: Tines is an event transport rather than a system whose record + * is edited in place, so an update is an extra event the receiving story has to correlate to the + * alert it already handled. A destination configured before this event existed must not start + * receiving more without its owner asking. + */ + @JsonProperty("export_updates") + private Boolean exportUpdates; + + /** + * Three-level Unity Catalog name (`catalog.schema.secret`) of the secret holding the Tines + * webhook secret. Only the name is stored; the secret is read when an alert is exported, so + * rotating it takes effect without editing this config. Required: without it the destination + * would be an unauthenticated endpoint. + */ + @JsonProperty("webhook_secret_uc_secret") + private String webhookSecretUcSecret; + + /** + * Tines webhook action URL, typically of the form `https://.tines.com/webhook/`. + * Any HTTPS host is accepted, so that a Tines tenant on a custom domain works. + * + *

The secret is sent as a header, so it must not be embedded in the URL: a trailing secret + * path segment (`/webhook//`) and a `secret` query parameter are both rejected. + * API-path-prefix URLs (`/api/public/...`) are not supported. + */ + @JsonProperty("webhook_uri") + private String webhookUri; + + public TinesExportConfig setExportUpdates(Boolean exportUpdates) { + this.exportUpdates = exportUpdates; + return this; + } + + public Boolean getExportUpdates() { + return exportUpdates; + } + + public TinesExportConfig setWebhookSecretUcSecret(String webhookSecretUcSecret) { + this.webhookSecretUcSecret = webhookSecretUcSecret; + return this; + } + + public String getWebhookSecretUcSecret() { + return webhookSecretUcSecret; + } + + public TinesExportConfig setWebhookUri(String webhookUri) { + this.webhookUri = webhookUri; + return this; + } + + public String getWebhookUri() { + return webhookUri; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + TinesExportConfig that = (TinesExportConfig) o; + return Objects.equals(exportUpdates, that.exportUpdates) + && Objects.equals(webhookSecretUcSecret, that.webhookSecretUcSecret) + && Objects.equals(webhookUri, that.webhookUri); + } + + @Override + public int hashCode() { + return Objects.hash(exportUpdates, webhookSecretUcSecret, webhookUri); + } + + @Override + public String toString() { + return new ToStringer(TinesExportConfig.class) + .add("exportUpdates", exportUpdates) + .add("webhookSecretUcSecret", webhookSecretUcSecret) + .add("webhookUri", webhookUri) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UnityCatalogConnection.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UnityCatalogConnection.java new file mode 100644 index 000000000..c03b22bb6 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UnityCatalogConnection.java @@ -0,0 +1,122 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Timestamp; +import java.util.Map; +import java.util.Objects; + +/** + * Ingests data through a managed connector that uses a Unity Catalog connection. Mutually exclusive + * with `autoloader` and `existing_table`. + */ +@Generated +public class UnityCatalogConnection { + /** Free-form key-value configuration for the managed ingestion pipeline. */ + @JsonProperty("configuration") + private Map configuration; + + /** Name of the Unity Catalog connection to ingest through. */ + @JsonProperty("connection_name") + private String connectionName; + + /** + * Connector type of the connection, such as `SLACK_AUDIT_LOGS`. Resolved by the server from + * `connection_name` through Unity Catalog; not accepted as input. + */ + @JsonProperty("connector") + private String connector; + + /** + * The start time ingestion uses: the supplied `start_time`, or the creation time when it was + * omitted. Always populated. + */ + @JsonProperty("effective_start_time") + private Timestamp effectiveStartTime; + + /** + * Earliest source event time to ingest. Leave unset to start at creation time, with no history + * backfilled. Rejected if in the future, beyond the connector's history window, or for a + * connector without start-time support. Takes effect only at first start and cannot be changed. + * Reads return the value as supplied; the start time ingestion uses is reported in + * `effective_start_time`. + */ + @JsonProperty("start_time") + private Timestamp startTime; + + public UnityCatalogConnection setConfiguration(Map configuration) { + this.configuration = configuration; + return this; + } + + public Map getConfiguration() { + return configuration; + } + + public UnityCatalogConnection setConnectionName(String connectionName) { + this.connectionName = connectionName; + return this; + } + + public String getConnectionName() { + return connectionName; + } + + public UnityCatalogConnection setConnector(String connector) { + this.connector = connector; + return this; + } + + public String getConnector() { + return connector; + } + + public UnityCatalogConnection setEffectiveStartTime(Timestamp effectiveStartTime) { + this.effectiveStartTime = effectiveStartTime; + return this; + } + + public Timestamp getEffectiveStartTime() { + return effectiveStartTime; + } + + public UnityCatalogConnection setStartTime(Timestamp startTime) { + this.startTime = startTime; + return this; + } + + public Timestamp getStartTime() { + return startTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UnityCatalogConnection that = (UnityCatalogConnection) o; + return Objects.equals(configuration, that.configuration) + && Objects.equals(connectionName, that.connectionName) + && Objects.equals(connector, that.connector) + && Objects.equals(effectiveStartTime, that.effectiveStartTime) + && Objects.equals(startTime, that.startTime); + } + + @Override + public int hashCode() { + return Objects.hash(configuration, connectionName, connector, effectiveStartTime, startTime); + } + + @Override + public String toString() { + return new ToStringer(UnityCatalogConnection.class) + .add("configuration", configuration) + .add("connectionName", connectionName) + .add("connector", connector) + .add("effectiveStartTime", effectiveStartTime) + .add("startTime", startTime) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateAlertConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateAlertConfigRequest.java new file mode 100644 index 000000000..0522c0d29 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateAlertConfigRequest.java @@ -0,0 +1,106 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateAlertConfigRequest { + /** */ + @JsonProperty("alert_config") + private AlertConfig alertConfig; + + /** + * Optimistic-concurrency precondition: if set and it does not match the resource's current + * `etag`, the update is rejected as a conflict (HTTP 409). + */ + @JsonIgnore + @QueryParam("etag") + private String etag; + + /** */ + @JsonIgnore private String name; + + /** + * The field mask must be a single string, with multiple fields separated by commas (no spaces). + * The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields + * (e.g., `author.given_name`). Specification of elements in sequence or map fields is not + * allowed, as only the entire collection field can be specified. Field names must exactly match + * the resource field names. + * + *

A field mask of `*` indicates full replacement. It’s recommended to always explicitly list + * the fields being updated and avoid using `*` wildcards, as it can lead to unintended results if + * the API changes in the future. + */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateAlertConfigRequest setAlertConfig(AlertConfig alertConfig) { + this.alertConfig = alertConfig; + return this; + } + + public AlertConfig getAlertConfig() { + return alertConfig; + } + + public UpdateAlertConfigRequest setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public UpdateAlertConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public UpdateAlertConfigRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateAlertConfigRequest that = (UpdateAlertConfigRequest) o; + return Objects.equals(alertConfig, that.alertConfig) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(alertConfig, etag, name, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateAlertConfigRequest.class) + .add("alertConfig", alertConfig) + .add("etag", etag) + .add("name", name) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateCommonConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateCommonConfigRequest.java new file mode 100644 index 000000000..35c10b369 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateCommonConfigRequest.java @@ -0,0 +1,106 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateCommonConfigRequest { + /** */ + @JsonProperty("common_config") + private CommonConfig commonConfig; + + /** + * Optimistic-concurrency precondition: if set and it does not match the resource's current + * `etag`, the update is rejected as a conflict (HTTP 409). + */ + @JsonIgnore + @QueryParam("etag") + private String etag; + + /** */ + @JsonIgnore private String name; + + /** + * The field mask must be a single string, with multiple fields separated by commas (no spaces). + * The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields + * (e.g., `author.given_name`). Specification of elements in sequence or map fields is not + * allowed, as only the entire collection field can be specified. Field names must exactly match + * the resource field names. + * + *

A field mask of `*` indicates full replacement. It’s recommended to always explicitly list + * the fields being updated and avoid using `*` wildcards, as it can lead to unintended results if + * the API changes in the future. + */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateCommonConfigRequest setCommonConfig(CommonConfig commonConfig) { + this.commonConfig = commonConfig; + return this; + } + + public CommonConfig getCommonConfig() { + return commonConfig; + } + + public UpdateCommonConfigRequest setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public UpdateCommonConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public UpdateCommonConfigRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateCommonConfigRequest that = (UpdateCommonConfigRequest) o; + return Objects.equals(commonConfig, that.commonConfig) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(commonConfig, etag, name, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateCommonConfigRequest.class) + .add("commonConfig", commonConfig) + .add("etag", etag) + .add("name", name) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateDatasourceConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateDatasourceConfigRequest.java new file mode 100644 index 000000000..266fafa0e --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateDatasourceConfigRequest.java @@ -0,0 +1,106 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateDatasourceConfigRequest { + /** */ + @JsonProperty("datasource_config") + private DatasourceConfig datasourceConfig; + + /** + * Optimistic-concurrency precondition: if set and it does not match the resource's current + * `etag`, the update is rejected as a conflict (HTTP 409). + */ + @JsonIgnore + @QueryParam("etag") + private String etag; + + /** */ + @JsonIgnore private String name; + + /** + * The field mask must be a single string, with multiple fields separated by commas (no spaces). + * The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields + * (e.g., `author.given_name`). Specification of elements in sequence or map fields is not + * allowed, as only the entire collection field can be specified. Field names must exactly match + * the resource field names. + * + *

A field mask of `*` indicates full replacement. It’s recommended to always explicitly list + * the fields being updated and avoid using `*` wildcards, as it can lead to unintended results if + * the API changes in the future. + */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateDatasourceConfigRequest setDatasourceConfig(DatasourceConfig datasourceConfig) { + this.datasourceConfig = datasourceConfig; + return this; + } + + public DatasourceConfig getDatasourceConfig() { + return datasourceConfig; + } + + public UpdateDatasourceConfigRequest setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public UpdateDatasourceConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public UpdateDatasourceConfigRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateDatasourceConfigRequest that = (UpdateDatasourceConfigRequest) o; + return Objects.equals(datasourceConfig, that.datasourceConfig) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(datasourceConfig, etag, name, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateDatasourceConfigRequest.class) + .add("datasourceConfig", datasourceConfig) + .add("etag", etag) + .add("name", name) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateDatasourceRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateDatasourceRequest.java new file mode 100644 index 000000000..a2c37de3c --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateDatasourceRequest.java @@ -0,0 +1,111 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateDatasourceRequest { + /** */ + @JsonProperty("datasource") + private Datasource datasource; + + /** + * Optimistic-concurrency precondition: if set to a non-empty value that does not match the + * resource's current `etag`, the update is rejected as a conflict (HTTP 409). Omit this field or + * send an empty string to update unconditionally. + */ + @JsonIgnore + @QueryParam("etag") + private String etag; + + /** + * Resource name of the datasource, in the format `datasources/{datasource_id}`. Unlike the + * datasource's Unity Catalog location (`catalog_name`, `schema_name`, and `datasource_name`), the + * name does not change when the datasource or its catalog or schema is renamed in Unity Catalog. + */ + @JsonIgnore private String name; + + /** + * The field mask must be a single string, with multiple fields separated by commas (no spaces). + * The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields + * (e.g., `author.given_name`). Specification of elements in sequence or map fields is not + * allowed, as only the entire collection field can be specified. Field names must exactly match + * the resource field names. + * + *

A field mask of `*` indicates full replacement. It’s recommended to always explicitly list + * the fields being updated and avoid using `*` wildcards, as it can lead to unintended results if + * the API changes in the future. + */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateDatasourceRequest setDatasource(Datasource datasource) { + this.datasource = datasource; + return this; + } + + public Datasource getDatasource() { + return datasource; + } + + public UpdateDatasourceRequest setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public UpdateDatasourceRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public UpdateDatasourceRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateDatasourceRequest that = (UpdateDatasourceRequest) o; + return Objects.equals(datasource, that.datasource) + && Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(datasource, etag, name, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateDatasourceRequest.class) + .add("datasource", datasource) + .add("etag", etag) + .add("name", name) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateRuleConfigRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateRuleConfigRequest.java new file mode 100644 index 000000000..a1b82323d --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateRuleConfigRequest.java @@ -0,0 +1,106 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateRuleConfigRequest { + /** + * Optimistic-concurrency precondition: if set and it does not match the resource's current + * `etag`, the update is rejected as a conflict (HTTP 409). + */ + @JsonIgnore + @QueryParam("etag") + private String etag; + + /** */ + @JsonIgnore private String name; + + /** */ + @JsonProperty("rule_config") + private RuleConfig ruleConfig; + + /** + * The field mask must be a single string, with multiple fields separated by commas (no spaces). + * The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields + * (e.g., `author.given_name`). Specification of elements in sequence or map fields is not + * allowed, as only the entire collection field can be specified. Field names must exactly match + * the resource field names. + * + *

A field mask of `*` indicates full replacement. It’s recommended to always explicitly list + * the fields being updated and avoid using `*` wildcards, as it can lead to unintended results if + * the API changes in the future. + */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateRuleConfigRequest setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public UpdateRuleConfigRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public UpdateRuleConfigRequest setRuleConfig(RuleConfig ruleConfig) { + this.ruleConfig = ruleConfig; + return this; + } + + public RuleConfig getRuleConfig() { + return ruleConfig; + } + + public UpdateRuleConfigRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateRuleConfigRequest that = (UpdateRuleConfigRequest) o; + return Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(ruleConfig, that.ruleConfig) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(etag, name, ruleConfig, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateRuleConfigRequest.class) + .add("etag", etag) + .add("name", name) + .add("ruleConfig", ruleConfig) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateRuleRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateRuleRequest.java new file mode 100644 index 000000000..fe5c4cd50 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/UpdateRuleRequest.java @@ -0,0 +1,100 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +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 com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.FieldMask; +import java.util.Objects; + +@Generated +public class UpdateRuleRequest { + /** + * Optimistic-concurrency token from the latest read. A non-empty token that does not match the + * current `etag` rejects the update as a conflict (HTTP 409). Omit this field or provide an empty + * string to update unconditionally. + */ + @JsonIgnore + @QueryParam("etag") + private String etag; + + /** + * Resource name, in the form `rules/{rule_id}`. Assigned by the server on create; required on + * update. + */ + @JsonIgnore private String name; + + /** The rule with its new field values. `rule.name` identifies the rule to update. */ + @JsonProperty("rule") + private Rule rule; + + /** The set of fields to update. Only fields named in the mask are modified. */ + @JsonIgnore + @QueryParam("update_mask") + private FieldMask updateMask; + + public UpdateRuleRequest setEtag(String etag) { + this.etag = etag; + return this; + } + + public String getEtag() { + return etag; + } + + public UpdateRuleRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + public UpdateRuleRequest setRule(Rule rule) { + this.rule = rule; + return this; + } + + public Rule getRule() { + return rule; + } + + public UpdateRuleRequest setUpdateMask(FieldMask updateMask) { + this.updateMask = updateMask; + return this; + } + + public FieldMask getUpdateMask() { + return updateMask; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + UpdateRuleRequest that = (UpdateRuleRequest) o; + return Objects.equals(etag, that.etag) + && Objects.equals(name, that.name) + && Objects.equals(rule, that.rule) + && Objects.equals(updateMask, that.updateMask); + } + + @Override + public int hashCode() { + return Objects.hash(etag, name, rule, updateMask); + } + + @Override + public String toString() { + return new ToStringer(UpdateRuleRequest.class) + .add("etag", etag) + .add("name", name) + .add("rule", rule) + .add("updateMask", updateMask) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/WebhookExportConfig.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/WebhookExportConfig.java new file mode 100644 index 000000000..e85375f2f --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/lakewatch/WebhookExportConfig.java @@ -0,0 +1,70 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.lakewatch; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class WebhookExportConfig { + /** + * Whether a later change to an already-exported alert is delivered too, as a second + * `lakewatch.alert.updated` event to the same webhook URL (a close is such an update, carrying a + * terminal `alert_state`). Creation export is unaffected either way. + * + *

Opt-in, and unset means off: a webhook is an event transport rather than a system whose + * record is edited in place, so an update is an extra event the receiving consumer has to + * correlate to the alert it already handled. A destination configured before this event existed + * must not start receiving more without its owner asking. + */ + @JsonProperty("export_updates") + private Boolean exportUpdates; + + /** + * Webhook destination the server POSTs payloads to, in plaintext. Userinfo (`user:password@`) is + * sent as HTTP Basic auth. + */ + @JsonProperty("url") + private String url; + + public WebhookExportConfig setExportUpdates(Boolean exportUpdates) { + this.exportUpdates = exportUpdates; + return this; + } + + public Boolean getExportUpdates() { + return exportUpdates; + } + + public WebhookExportConfig setUrl(String url) { + this.url = url; + return this; + } + + public String getUrl() { + return url; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + WebhookExportConfig that = (WebhookExportConfig) o; + return Objects.equals(exportUpdates, that.exportUpdates) && Objects.equals(url, that.url); + } + + @Override + public int hashCode() { + return Objects.hash(exportUpdates, url); + } + + @Override + public String toString() { + return new ToStringer(WebhookExportConfig.class) + .add("exportUpdates", exportUpdates) + .add("url", url) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateFeatureSpecRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateFeatureSpecRequest.java new file mode 100644 index 000000000..ff1232970 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/CreateFeatureSpecRequest.java @@ -0,0 +1,44 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +@Generated +public class CreateFeatureSpecRequest { + /** The feature spec to create. */ + @JsonProperty("feature_spec") + private FeatureSpec featureSpec; + + public CreateFeatureSpecRequest setFeatureSpec(FeatureSpec featureSpec) { + this.featureSpec = featureSpec; + return this; + } + + public FeatureSpec getFeatureSpec() { + return featureSpec; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CreateFeatureSpecRequest that = (CreateFeatureSpecRequest) o; + return Objects.equals(featureSpec, that.featureSpec); + } + + @Override + public int hashCode() { + return Objects.hash(featureSpec); + } + + @Override + public String toString() { + return new ToStringer(CreateFeatureSpecRequest.class) + .add("featureSpec", featureSpec) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeclarativeFeature.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeclarativeFeature.java new file mode 100644 index 000000000..fa3b31694 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeclarativeFeature.java @@ -0,0 +1,43 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** A reference to a Feature. */ +@Generated +public class DeclarativeFeature { + /** Three-part Unity Catalog name (catalog.schema.feature) of the Feature. */ + @JsonProperty("feature") + private String feature; + + public DeclarativeFeature setFeature(String feature) { + this.feature = feature; + return this; + } + + public String getFeature() { + return feature; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DeclarativeFeature that = (DeclarativeFeature) o; + return Objects.equals(feature, that.feature); + } + + @Override + public int hashCode() { + return Objects.hash(feature); + } + + @Override + public String toString() { + return new ToStringer(DeclarativeFeature.class).add("feature", feature).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DefaultValue.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DefaultValue.java new file mode 100644 index 000000000..474c3431a --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DefaultValue.java @@ -0,0 +1,61 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** A default value for a looked-up feature. */ +@Generated +public class DefaultValue { + /** Default value for the feature. */ + @JsonProperty("default_value") + private String defaultValue; + + /** + * Name of the feature: its output name if it is renamed, otherwise its name in the feature table. + */ + @JsonProperty("feature") + private String feature; + + public DefaultValue setDefaultValue(String defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + public String getDefaultValue() { + return defaultValue; + } + + public DefaultValue setFeature(String feature) { + this.feature = feature; + return this; + } + + public String getFeature() { + return feature; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DefaultValue that = (DefaultValue) o; + return Objects.equals(defaultValue, that.defaultValue) && Objects.equals(feature, that.feature); + } + + @Override + public int hashCode() { + return Objects.hash(defaultValue, feature); + } + + @Override + public String toString() { + return new ToStringer(DefaultValue.class) + .add("defaultValue", defaultValue) + .add("feature", feature) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteFeatureSpecRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteFeatureSpecRequest.java new file mode 100644 index 000000000..b16a9d48a --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/DeleteFeatureSpecRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class DeleteFeatureSpecRequest { + /** Three-part name (catalog.schema.feature_spec) of the feature spec to delete. */ + @JsonIgnore private String name; + + public DeleteFeatureSpecRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + DeleteFeatureSpecRequest that = (DeleteFeatureSpecRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(DeleteFeatureSpecRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java index 67a4c880b..c96777c8c 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringAPI.java @@ -46,6 +46,11 @@ public Feature createFeature(CreateFeatureRequest request) { return impl.createFeature(request); } + /** Create a feature spec. */ + public FeatureSpec createFeatureSpec(CreateFeatureSpecRequest request) { + return impl.createFeatureSpec(request); + } + /** * Create a Kafka config. During PrPr, Kafka configs can be read and used when creating features * under the entire metastore. Only the creator of the Kafka config can delete it. @@ -80,6 +85,15 @@ public void deleteFeature(DeleteFeatureRequest request) { impl.deleteFeature(request); } + public void deleteFeatureSpec(String name) { + deleteFeatureSpec(new DeleteFeatureSpecRequest().setName(name)); + } + + /** Delete a feature spec. */ + public void deleteFeatureSpec(DeleteFeatureSpecRequest request) { + impl.deleteFeatureSpec(request); + } + public void deleteKafkaConfig(String name) { deleteKafkaConfig(new DeleteKafkaConfigRequest().setName(name)); } @@ -135,6 +149,15 @@ public Feature getFeature(GetFeatureRequest request) { return impl.getFeature(request); } + public FeatureSpec getFeatureSpec(String name) { + return getFeatureSpec(new GetFeatureSpecRequest().setName(name)); + } + + /** Get a feature spec. */ + public FeatureSpec getFeatureSpec(GetFeatureSpecRequest request) { + return impl.getFeatureSpec(request); + } + public KafkaConfig getKafkaConfig(String name) { return getKafkaConfig(new GetKafkaConfigRequest().setName(name)); } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java index 30974318a..c41ec2303 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringImpl.java @@ -93,6 +93,24 @@ public Feature createFeature(CreateFeatureRequest request) { } } + @Override + public FeatureSpec createFeatureSpec(CreateFeatureSpecRequest request) { + String path = "/api/2.0/feature-engineering/feature-specs"; + try { + Request req = new Request("POST", path, apiClient.serialize(request.getFeatureSpec())); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + req.withHeader("Content-Type", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, FeatureSpec.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public KafkaConfig createKafkaConfig(CreateKafkaConfigRequest request) { String path = "/api/2.0/feature-engineering/features/kafka-configs"; @@ -186,6 +204,23 @@ public void deleteFeature(DeleteFeatureRequest request) { } } + @Override + public void deleteFeatureSpec(DeleteFeatureSpecRequest request) { + String path = String.format("/api/2.0/feature-engineering/feature-specs/%s", request.getName()); + try { + Request req = new Request("DELETE", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + apiClient.execute(req, Void.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public void deleteKafkaConfig(DeleteKafkaConfigRequest request) { String path = @@ -281,6 +316,23 @@ public Feature getFeature(GetFeatureRequest request) { } } + @Override + public FeatureSpec getFeatureSpec(GetFeatureSpecRequest request) { + String path = String.format("/api/2.0/feature-engineering/feature-specs/%s", request.getName()); + try { + Request req = new Request("GET", path); + + ApiClient.setQuery(req, request); + req.withHeader("Accept", "application/json"); + if (apiClient.workspaceId() != null) { + req.withHeader("X-Databricks-Workspace-Id", apiClient.workspaceId()); + } + return apiClient.execute(req, FeatureSpec.class); + } catch (IOException e) { + throw new DatabricksException("IO error: " + e.getMessage(), e); + } + } + @Override public KafkaConfig getKafkaConfig(GetKafkaConfigRequest request) { String path = diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java index c11b53248..d7339410a 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureEngineeringService.java @@ -25,6 +25,9 @@ BatchCreateMaterializedFeaturesResponse batchCreateMaterializedFeatures( /** Create a Feature. */ Feature createFeature(CreateFeatureRequest createFeatureRequest); + /** Create a feature spec. */ + FeatureSpec createFeatureSpec(CreateFeatureSpecRequest createFeatureSpecRequest); + /** * Create a Kafka config. During PrPr, Kafka configs can be read and used when creating features * under the entire metastore. Only the creator of the Kafka config can delete it. @@ -45,6 +48,9 @@ MaterializedFeature createMaterializedFeature( /** Delete a Feature. */ void deleteFeature(DeleteFeatureRequest deleteFeatureRequest); + /** Delete a feature spec. */ + void deleteFeatureSpec(DeleteFeatureSpecRequest deleteFeatureSpecRequest); + /** * Delete a Kafka config. During PrPr, Kafka configs can be read and used when creating features * under the entire metastore. Only the creator of the Kafka config can delete it. @@ -67,6 +73,9 @@ Operation deleteMaterializationSet( /** Get a Feature. */ Feature getFeature(GetFeatureRequest getFeatureRequest); + /** Get a feature spec. */ + FeatureSpec getFeatureSpec(GetFeatureSpecRequest getFeatureSpecRequest); + /** * Get a Kafka config. During PrPr, Kafka configs can be read and used when creating features * under the entire metastore. Only the creator of the Kafka config can delete it. diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureFunction.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureFunction.java new file mode 100644 index 000000000..14893ab1f --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureFunction.java @@ -0,0 +1,76 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** A Python UDF that computes a feature. */ +@Generated +public class FeatureFunction { + /** Bindings of the UDF's parameters to features. */ + @JsonProperty("input_bindings") + private Collection inputBindings; + + /** Output name of the feature that the UDF computes. */ + @JsonProperty("output") + private String output; + + /** Three-part name of the Python UDF. */ + @JsonProperty("udf") + private String udf; + + public FeatureFunction setInputBindings(Collection inputBindings) { + this.inputBindings = inputBindings; + return this; + } + + public Collection getInputBindings() { + return inputBindings; + } + + public FeatureFunction setOutput(String output) { + this.output = output; + return this; + } + + public String getOutput() { + return output; + } + + public FeatureFunction setUdf(String udf) { + this.udf = udf; + return this; + } + + public String getUdf() { + return udf; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FeatureFunction that = (FeatureFunction) o; + return Objects.equals(inputBindings, that.inputBindings) + && Objects.equals(output, that.output) + && Objects.equals(udf, that.udf); + } + + @Override + public int hashCode() { + return Objects.hash(inputBindings, output, udf); + } + + @Override + public String toString() { + return new ToStringer(FeatureFunction.class) + .add("inputBindings", inputBindings) + .add("output", output) + .add("udf", udf) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureFunctionInputBinding.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureFunctionInputBinding.java new file mode 100644 index 000000000..0c357341b --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureFunctionInputBinding.java @@ -0,0 +1,60 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** Binds one parameter of the UDF to a feature. */ +@Generated +public class FeatureFunctionInputBinding { + /** Name of the feature bound to the parameter. */ + @JsonProperty("bound_feature") + private String boundFeature; + + /** Name of the UDF parameter. */ + @JsonProperty("parameter") + private String parameter; + + public FeatureFunctionInputBinding setBoundFeature(String boundFeature) { + this.boundFeature = boundFeature; + return this; + } + + public String getBoundFeature() { + return boundFeature; + } + + public FeatureFunctionInputBinding setParameter(String parameter) { + this.parameter = parameter; + return this; + } + + public String getParameter() { + return parameter; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FeatureFunctionInputBinding that = (FeatureFunctionInputBinding) o; + return Objects.equals(boundFeature, that.boundFeature) + && Objects.equals(parameter, that.parameter); + } + + @Override + public int hashCode() { + return Objects.hash(boundFeature, parameter); + } + + @Override + public String toString() { + return new ToStringer(FeatureFunctionInputBinding.class) + .add("boundFeature", boundFeature) + .add("parameter", parameter) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureLookup.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureLookup.java new file mode 100644 index 000000000..4918346da --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureLookup.java @@ -0,0 +1,144 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.protobuf.Duration; +import java.util.Collection; +import java.util.Objects; + +/** Features to look up from a feature table. */ +@Generated +public class FeatureLookup { + /** Default values for features. */ + @JsonProperty("default_values") + private Collection defaultValues; + + /** Names of the features to look up, or empty to look up every feature in the table. */ + @JsonProperty("feature_names") + private Collection featureNames; + + /** Lookback window to use when performing point-in-time lookup. */ + @JsonProperty("lookback_window") + private Duration lookbackWindow; + + /** Keys to use when joining with the feature table. */ + @JsonProperty("lookup_keys") + private Collection lookupKeys; + + /** Output names for features, in place of their names in the feature table. */ + @JsonProperty("rename_outputs") + private Collection renameOutputs; + + /** Three-part name of the feature table. */ + @JsonProperty("table") + private String table; + + /** Keys to use when performing point-in-time lookup. */ + @JsonProperty("timestamp_lookup_keys") + private Collection timestampLookupKeys; + + public FeatureLookup setDefaultValues(Collection defaultValues) { + this.defaultValues = defaultValues; + return this; + } + + public Collection getDefaultValues() { + return defaultValues; + } + + public FeatureLookup setFeatureNames(Collection featureNames) { + this.featureNames = featureNames; + return this; + } + + public Collection getFeatureNames() { + return featureNames; + } + + public FeatureLookup setLookbackWindow(Duration lookbackWindow) { + this.lookbackWindow = lookbackWindow; + return this; + } + + public Duration getLookbackWindow() { + return lookbackWindow; + } + + public FeatureLookup setLookupKeys(Collection lookupKeys) { + this.lookupKeys = lookupKeys; + return this; + } + + public Collection getLookupKeys() { + return lookupKeys; + } + + public FeatureLookup setRenameOutputs(Collection renameOutputs) { + this.renameOutputs = renameOutputs; + return this; + } + + public Collection getRenameOutputs() { + return renameOutputs; + } + + public FeatureLookup setTable(String table) { + this.table = table; + return this; + } + + public String getTable() { + return table; + } + + public FeatureLookup setTimestampLookupKeys(Collection timestampLookupKeys) { + this.timestampLookupKeys = timestampLookupKeys; + return this; + } + + public Collection getTimestampLookupKeys() { + return timestampLookupKeys; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FeatureLookup that = (FeatureLookup) o; + return Objects.equals(defaultValues, that.defaultValues) + && Objects.equals(featureNames, that.featureNames) + && Objects.equals(lookbackWindow, that.lookbackWindow) + && Objects.equals(lookupKeys, that.lookupKeys) + && Objects.equals(renameOutputs, that.renameOutputs) + && Objects.equals(table, that.table) + && Objects.equals(timestampLookupKeys, that.timestampLookupKeys); + } + + @Override + public int hashCode() { + return Objects.hash( + defaultValues, + featureNames, + lookbackWindow, + lookupKeys, + renameOutputs, + table, + timestampLookupKeys); + } + + @Override + public String toString() { + return new ToStringer(FeatureLookup.class) + .add("defaultValues", defaultValues) + .add("featureNames", featureNames) + .add("lookbackWindow", lookbackWindow) + .add("lookupKeys", lookupKeys) + .add("renameOutputs", renameOutputs) + .add("table", table) + .add("timestampLookupKeys", timestampLookupKeys) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureSpec.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureSpec.java new file mode 100644 index 000000000..83e40d7d3 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/FeatureSpec.java @@ -0,0 +1,98 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** A named set of features to serve, stored as a Unity Catalog function. */ +@Generated +public class FeatureSpec { + /** Output names of columns to leave out of the feature spec. */ + @JsonProperty("exclude_columns") + private Collection excludeColumns; + + /** + * Extra pip requirements to install in the serving container, in addition to the defaults and + * those resolved from the features. + */ + @JsonProperty("extra_pip_requirements") + private PipRequirements extraPipRequirements; + + /** + * The Features (either a declarative one, or a lookup from a feature table, or a feature + * function) to serve. A declarative feature (`DeclarativeFeature`) cannot be combined with + * lookups (`FeatureLookup`) and functions (`FeatureFunction`) in one feature spec. + */ + @JsonProperty("features") + private Collection features; + + /** Three-part name (catalog.schema.feature_spec) of the feature spec. */ + @JsonProperty("name") + private String name; + + public FeatureSpec setExcludeColumns(Collection excludeColumns) { + this.excludeColumns = excludeColumns; + return this; + } + + public Collection getExcludeColumns() { + return excludeColumns; + } + + public FeatureSpec setExtraPipRequirements(PipRequirements extraPipRequirements) { + this.extraPipRequirements = extraPipRequirements; + return this; + } + + public PipRequirements getExtraPipRequirements() { + return extraPipRequirements; + } + + public FeatureSpec setFeatures(Collection features) { + this.features = features; + return this; + } + + public Collection getFeatures() { + return features; + } + + public FeatureSpec setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + FeatureSpec that = (FeatureSpec) o; + return Objects.equals(excludeColumns, that.excludeColumns) + && Objects.equals(extraPipRequirements, that.extraPipRequirements) + && Objects.equals(features, that.features) + && Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(excludeColumns, extraPipRequirements, features, name); + } + + @Override + public String toString() { + return new ToStringer(FeatureSpec.class) + .add("excludeColumns", excludeColumns) + .add("extraPipRequirements", extraPipRequirements) + .add("features", features) + .add("name", name) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Features.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Features.java new file mode 100644 index 000000000..f85e428d2 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/Features.java @@ -0,0 +1,75 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** One entry of a feature spec: a Feature, a feature table lookup, or a feature function. */ +@Generated +public class Features { + /** A Feature, referenced by its three-part Unity Catalog name. */ + @JsonProperty("declarative_feature") + private DeclarativeFeature declarativeFeature; + + /** A feature function. */ + @JsonProperty("feature_function") + private FeatureFunction featureFunction; + + /** A feature table lookup. */ + @JsonProperty("feature_lookup") + private FeatureLookup featureLookup; + + public Features setDeclarativeFeature(DeclarativeFeature declarativeFeature) { + this.declarativeFeature = declarativeFeature; + return this; + } + + public DeclarativeFeature getDeclarativeFeature() { + return declarativeFeature; + } + + public Features setFeatureFunction(FeatureFunction featureFunction) { + this.featureFunction = featureFunction; + return this; + } + + public FeatureFunction getFeatureFunction() { + return featureFunction; + } + + public Features setFeatureLookup(FeatureLookup featureLookup) { + this.featureLookup = featureLookup; + return this; + } + + public FeatureLookup getFeatureLookup() { + return featureLookup; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Features that = (Features) o; + return Objects.equals(declarativeFeature, that.declarativeFeature) + && Objects.equals(featureFunction, that.featureFunction) + && Objects.equals(featureLookup, that.featureLookup); + } + + @Override + public int hashCode() { + return Objects.hash(declarativeFeature, featureFunction, featureLookup); + } + + @Override + public String toString() { + return new ToStringer(Features.class) + .add("declarativeFeature", declarativeFeature) + .add("featureFunction", featureFunction) + .add("featureLookup", featureLookup) + .toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/GetFeatureSpecRequest.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/GetFeatureSpecRequest.java new file mode 100644 index 000000000..04c93fefe --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/GetFeatureSpecRequest.java @@ -0,0 +1,41 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.Objects; + +@Generated +public class GetFeatureSpecRequest { + /** Three-part name (catalog.schema.feature_spec) of the feature spec to get. */ + @JsonIgnore private String name; + + public GetFeatureSpecRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + GetFeatureSpecRequest that = (GetFeatureSpecRequest) o; + return Objects.equals(name, that.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + return new ToStringer(GetFeatureSpecRequest.class).add("name", name).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java index cc0737ce3..d38737f02 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/MaterializationSetOperationMetadata.java @@ -9,17 +9,14 @@ import java.util.Collection; import java.util.Objects; -/** - * Progress of a materialization set operation. Shared by create, update and delete, because - * databricks.longrunning freezes a method's metadata type once it ships. - */ +/** Progress of a materialization set operation. */ @Generated public class MaterializationSetOperationMetadata { /** Time at which the operation was requested. */ @JsonProperty("create_time") private Timestamp createTime; - /** Set by a DeleteMaterializationSet operation. */ + /** Set by a `DeleteMaterializationSet` operation. */ @JsonProperty("deletion_progress") private MaterializationSetDeletionProgress deletionProgress; @@ -35,7 +32,7 @@ public class MaterializationSetOperationMetadata { @JsonProperty("state") private MaterializationSetOperationMetadataState state; - /** Set by an UpdateMaterializationSet operation. */ + /** Set by an `UpdateMaterializationSet` operation. */ @JsonProperty("update_progress") private MaterializationSetUpdateProgress updateProgress; diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PipRequirements.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PipRequirements.java new file mode 100644 index 000000000..f62f45b47 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PipRequirements.java @@ -0,0 +1,44 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Collection; +import java.util.Objects; + +/** Pip requirements to install in a serving container. */ +@Generated +public class PipRequirements { + /** Pip requirement strings (PEP 508) or UC Volume whl paths (/Volumes/...). */ + @JsonProperty("requirements") + private Collection requirements; + + public PipRequirements setRequirements(Collection requirements) { + this.requirements = requirements; + return this; + } + + public Collection getRequirements() { + return requirements; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + PipRequirements that = (PipRequirements) o; + return Objects.equals(requirements, that.requirements); + } + + @Override + public int hashCode() { + return Objects.hash(requirements); + } + + @Override + public String toString() { + return new ToStringer(PipRequirements.class).add("requirements", requirements).toString(); + } +} diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadataState.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadataState.java index b109cac39..c70e16c50 100644 --- a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadataState.java +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/PurgeFeatureEntitiesMetadataState.java @@ -10,6 +10,10 @@ public enum PurgeFeatureEntitiesMetadataState { CANCELLED, FAILED, PENDING, + PENDING_CLEANUP, + PENDING_PURGE, RUNNING, + RUNNING_CLEANUP, + RUNNING_PURGE, SUCCEEDED, } diff --git a/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/RenameOutput.java b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/RenameOutput.java new file mode 100644 index 000000000..982920347 --- /dev/null +++ b/databricks-sdk-java/src/main/java/com/databricks/sdk/service/ml/RenameOutput.java @@ -0,0 +1,59 @@ +// Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT. + +package com.databricks.sdk.service.ml; + +import com.databricks.sdk.support.Generated; +import com.databricks.sdk.support.ToStringer; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Objects; + +/** An output name for a looked-up feature. */ +@Generated +public class RenameOutput { + /** Name of the feature in the feature table. */ + @JsonProperty("feature") + private String feature; + + /** Output name for the feature. */ + @JsonProperty("output") + private String output; + + public RenameOutput setFeature(String feature) { + this.feature = feature; + return this; + } + + public String getFeature() { + return feature; + } + + public RenameOutput setOutput(String output) { + this.output = output; + return this; + } + + public String getOutput() { + return output; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + RenameOutput that = (RenameOutput) o; + return Objects.equals(feature, that.feature) && Objects.equals(output, that.output); + } + + @Override + public int hashCode() { + return Objects.hash(feature, output); + } + + @Override + public String toString() { + return new ToStringer(RenameOutput.class) + .add("feature", feature) + .add("output", output) + .toString(); + } +} diff --git a/examples/docs/pom.xml b/examples/docs/pom.xml index 7ad1ff48b..d7752722f 100644 --- a/examples/docs/pom.xml +++ b/examples/docs/pom.xml @@ -24,7 +24,7 @@ com.databricks databricks-sdk-java - 0.174.0 + 0.175.0 diff --git a/examples/spring-boot-oauth-u2m-demo/pom.xml b/examples/spring-boot-oauth-u2m-demo/pom.xml index a2fba8411..81058c03c 100644 --- a/examples/spring-boot-oauth-u2m-demo/pom.xml +++ b/examples/spring-boot-oauth-u2m-demo/pom.xml @@ -40,7 +40,7 @@ com.databricks databricks-sdk-java - 0.174.0 + 0.175.0 diff --git a/lockfile.json b/lockfile.json index b3b116561..bcc9311b7 100644 --- a/lockfile.json +++ b/lockfile.json @@ -1,7 +1,7 @@ { "artifactId": "databricks-sdk-parent", "groupId": "com.databricks", - "version": "0.174.0", + "version": "0.175.0", "lockFileVersion": 1, "dependencies": [], "mavenPlugins": [], diff --git a/pom.xml b/pom.xml index 61afcc609..71a18fce8 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.databricks databricks-sdk-parent - 0.174.0 + 0.175.0 pom Databricks SDK for Java The Databricks SDK for Java includes functionality to accelerate development with Java for diff --git a/shaded/pom.xml b/shaded/pom.xml index 9a60a8858..7abb855b0 100644 --- a/shaded/pom.xml +++ b/shaded/pom.xml @@ -4,7 +4,7 @@ 4.0.0 - 0.174.0 + 0.175.0 com.databricks