diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
deleted file mode 100644
index 8587ff4..0000000
--- a/.devcontainer/Dockerfile
+++ /dev/null
@@ -1,22 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM debian:bookworm-slim
-
-RUN apt-get update && apt-get install -y \
- libxkbcommon0 \
- ca-certificates \
- git \
- unzip \
- libc++1 \
- vim \
- curl \
- procps \
- && apt-get clean autoclean
-
-RUN curl -OL https://go.dev/dl/go1.24.0.linux-amd64.tar.gz && \
- tar -C /usr/local -xzvf go1.24.0.linux-amd64.tar.gz && \
- rm go1.24.0.linux-amd64.tar.gz
-ENV PATH="$PATH:/usr/local/go/bin"
-
-# Ensure UTF-8 encoding
-ENV LANG=C.UTF-8
-ENV LC_ALL=C.UTF-8
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index d55fc4d..889ae34 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,20 +1,7 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
- "name": "Debian",
- "build": {
- "dockerfile": "Dockerfile"
- }
-
- // Features to add to the dev container. More info: https://containers.dev/features.
- // "features": {},
-
- // Use 'forwardPorts' to make a list of ports inside the container available locally.
- // "forwardPorts": [],
-
- // Configure tool-specific properties.
- // "customizations": {},
-
- // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
- // "remoteUser": "root"
+ "name": "Development",
+ "image": "mcr.microsoft.com/devcontainers/go:1.23-bookworm",
+ "postCreateCommand": "go mod tidy"
}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 02d8f19..13ce848 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,18 +1,18 @@
name: CI
on:
push:
- branches:
- - main
- pull_request:
- branches:
- - main
- - next
+ branches-ignore:
+ - 'generated'
+ - 'codegen/**'
+ - 'integrated/**'
+ - 'stl-preview-head/**'
+ - 'stl-preview-base/**'
jobs:
lint:
+ timeout-minutes: 10
name: lint
- runs-on: ubuntu-latest
-
+ runs-on: ${{ github.repository == 'stainless-sdks/openlayer-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 7e56fe2..e2f2c07 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.1.0-alpha.16"
+ ".": "0.1.0-alpha.17"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 5fc516d..2b09528 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,3 +1,3 @@
-configured_endpoints: 15
-openapi_spec_hash: 9a0b363025305f6b086bcdfe43274830
-config_hash: 21fb9730d1cdc9e3fd38724c4774b894
+configured_endpoints: 18
+openapi_spec_hash: 20f058101a252f7500803d66aff58eb3
+config_hash: 30422a4611d93ca69e4f1aff60b9ddb5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 26b1582..3de7804 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,50 @@
# Changelog
+## 0.1.0-alpha.17 (2025-05-31)
+
+Full Changelog: [v0.1.0-alpha.16...v0.1.0-alpha.17](https://github.com/openlayer-ai/openlayer-go/compare/v0.1.0-alpha.16...v0.1.0-alpha.17)
+
+### Features
+
+* **api:** add test creation endpoint ([50fa1ac](https://github.com/openlayer-ai/openlayer-go/commit/50fa1ac7d9d7bff9402b7be595e176cfab4d18e9))
+* **api:** api update ([9ca34f2](https://github.com/openlayer-ai/openlayer-go/commit/9ca34f2376b8e7736bc178b64fb8de6f14dc09f5))
+* **api:** api update ([1464559](https://github.com/openlayer-ai/openlayer-go/commit/146455956798caf86c90a1e76a06663c862ab02a))
+* **api:** api update ([945314e](https://github.com/openlayer-ai/openlayer-go/commit/945314e51ecff9e88c9fafe693a612d3d350c313))
+* **api:** api update ([20c21a5](https://github.com/openlayer-ai/openlayer-go/commit/20c21a5bfc2a02ef41317797e52b966a29880738))
+* **api:** api update ([915af77](https://github.com/openlayer-ai/openlayer-go/commit/915af773e51144f74c1517bb43eb6807867d4015))
+* **api:** expose test retrieval endpoint ([cddc990](https://github.com/openlayer-ai/openlayer-go/commit/cddc990ebb0004ddee4ca0f8c538b543c700d254))
+* **api:** expose test retrieval endpoint ([7ac3c6c](https://github.com/openlayer-ai/openlayer-go/commit/7ac3c6ccac9752d807519538a54b0afe223154fe))
+* **api:** expose test update endpoint ([e8aba5e](https://github.com/openlayer-ai/openlayer-go/commit/e8aba5e6f17d645f5ccb543d259739d534a3da3a))
+* **client:** add support for endpoint-specific base URLs in python ([820ffe8](https://github.com/openlayer-ai/openlayer-go/commit/820ffe88bf9a04be100ea8fb34794865b87d5f52))
+* **client:** add support for reading base URL from environment variable ([9fd2355](https://github.com/openlayer-ai/openlayer-go/commit/9fd23557e5355ae4280fdea454c024eab8d9dc4d))
+* **client:** support custom http clients ([#80](https://github.com/openlayer-ai/openlayer-go/issues/80)) ([773c56c](https://github.com/openlayer-ai/openlayer-go/commit/773c56c93858bfec9e73ccb22950919bd968d606))
+
+
+### Bug Fixes
+
+* **client:** clean up reader resources ([d608b57](https://github.com/openlayer-ai/openlayer-go/commit/d608b57fd158f1bdfeeeea89e9ebb911c3669b35))
+* **client:** correctly update body in WithJSONSet ([e59a983](https://github.com/openlayer-ai/openlayer-go/commit/e59a9832b8dddd3612fdf9492b6c095ecd9eb589))
+* handle empty bodies in WithJSONSet ([dfd870a](https://github.com/openlayer-ai/openlayer-go/commit/dfd870a9923922602af776bf62ae5da696c4f9f1))
+
+
+### Chores
+
+* **ci:** add timeout thresholds for CI jobs ([a41c7b6](https://github.com/openlayer-ai/openlayer-go/commit/a41c7b6366a1b1b380fa714ac527cd4c8a019112))
+* **ci:** only use depot for staging repos ([abc6c92](https://github.com/openlayer-ai/openlayer-go/commit/abc6c92db4e9cbfd5e199571c521f9c3a7b02c73))
+* **docs:** document pre-request options ([6cc0281](https://github.com/openlayer-ai/openlayer-go/commit/6cc028136dc67f77881c5c1f4d466254694a0679))
+* **docs:** grammar improvements ([4dd364b](https://github.com/openlayer-ai/openlayer-go/commit/4dd364b2f9a3382a6b4880a3dc30521d14403a9b))
+* improve devcontainer setup ([1322a10](https://github.com/openlayer-ai/openlayer-go/commit/1322a105c963120fab6553a83ef811cddc333e5d))
+* **internal:** codegen related update ([8ad39a5](https://github.com/openlayer-ai/openlayer-go/commit/8ad39a515b9bc3c3a752682500f37193c6f44a70))
+* **internal:** expand CI branch coverage ([14067c7](https://github.com/openlayer-ai/openlayer-go/commit/14067c7e9dfa7c1bcdfb9ded29ce3eaea12d1bd2))
+* **internal:** reduce CI branch coverage ([08c00ca](https://github.com/openlayer-ai/openlayer-go/commit/08c00cadee41cd7f6b3bd2873a0a1f18ba997a99))
+* make go mod tidy continue on error ([d402983](https://github.com/openlayer-ai/openlayer-go/commit/d402983d853f087862dd3676f7f7bd6fdddd9a96))
+* **tests:** improve enum examples ([#82](https://github.com/openlayer-ai/openlayer-go/issues/82)) ([c4047ae](https://github.com/openlayer-ai/openlayer-go/commit/c4047aeebaf1c7ae8aa176572a1615746bee8bb5))
+
+
+### Documentation
+
+* update documentation links to be more uniform ([6245eac](https://github.com/openlayer-ai/openlayer-go/commit/6245eac124bdfa974d36963c293b4f6d1b791021))
+
## 0.1.0-alpha.16 (2025-04-03)
Full Changelog: [v0.1.0-alpha.15...v0.1.0-alpha.16](https://github.com/openlayer-ai/openlayer-go/compare/v0.1.0-alpha.15...v0.1.0-alpha.16)
diff --git a/README.md b/README.md
index 6da5283..416c2f7 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-The Openlayer Go library provides convenient access to [the Openlayer REST
-API](https://openlayer.com/docs/api-reference/rest/overview) from applications written in Go. The full API of this library can be found in [api.md](api.md).
+The Openlayer Go library provides convenient access to the [Openlayer REST API](https://openlayer.com/docs/api-reference/rest/overview)
+from applications written in Go.
It is generated with [Stainless](https://www.stainless.com/).
@@ -24,7 +24,7 @@ Or to pin the version:
```sh
-go get -u 'github.com/openlayer-ai/openlayer-go@v0.1.0-alpha.16'
+go get -u 'github.com/openlayer-ai/openlayer-go@v0.1.0-alpha.17'
```
diff --git a/SECURITY.md b/SECURITY.md
index 8614b05..dc108d0 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues
If you encounter security issues that are not directly related to SDKs but pertain to the services
-or products provided by Openlayer please follow the respective company's security reporting guidelines.
+or products provided by Openlayer, please follow the respective company's security reporting guidelines.
### Openlayer Terms and Policies
-Please contact support@openlayer.com for any questions or concerns regarding security of our services.
+Please contact support@openlayer.com for any questions or concerns regarding the security of our services.
---
diff --git a/api.md b/api.md
index bf0898d..86f7139 100644
--- a/api.md
+++ b/api.md
@@ -34,6 +34,20 @@ Methods:
- client.Projects.InferencePipelines.New(ctx context.Context, projectID string, body openlayer.ProjectInferencePipelineNewParams) (openlayer.ProjectInferencePipelineNewResponse, error)
- client.Projects.InferencePipelines.List(ctx context.Context, projectID string, query openlayer.ProjectInferencePipelineListParams) (openlayer.ProjectInferencePipelineListResponse, error)
+## Tests
+
+Response Types:
+
+- openlayer.ProjectTestNewResponse
+- openlayer.ProjectTestUpdateResponse
+- openlayer.ProjectTestListResponse
+
+Methods:
+
+- client.Projects.Tests.New(ctx context.Context, projectID string, body openlayer.ProjectTestNewParams) (openlayer.ProjectTestNewResponse, error)
+- client.Projects.Tests.Update(ctx context.Context, projectID string, body openlayer.ProjectTestUpdateParams) (openlayer.ProjectTestUpdateResponse, error)
+- client.Projects.Tests.List(ctx context.Context, projectID string, query openlayer.ProjectTestListParams) (openlayer.ProjectTestListResponse, error)
+
# Commits
Response Types:
diff --git a/client.go b/client.go
index 9e268e0..bb93cb9 100644
--- a/client.go
+++ b/client.go
@@ -22,10 +22,13 @@ type Client struct {
Storage *StorageService
}
-// DefaultClientOptions read from the environment (OPENLAYER_API_KEY). This should
-// be used to initialize new clients.
+// DefaultClientOptions read from the environment (OPENLAYER_API_KEY,
+// OPENLAYER_BASE_URL). This should be used to initialize new clients.
func DefaultClientOptions() []option.RequestOption {
defaults := []option.RequestOption{option.WithEnvironmentProduction()}
+ if o, ok := os.LookupEnv("OPENLAYER_BASE_URL"); ok {
+ defaults = append(defaults, option.WithBaseURL(o))
+ }
if o, ok := os.LookupEnv("OPENLAYER_API_KEY"); ok {
defaults = append(defaults, option.WithAPIKey(o))
}
@@ -33,9 +36,9 @@ func DefaultClientOptions() []option.RequestOption {
}
// NewClient generates a new client with the default option read from the
-// environment (OPENLAYER_API_KEY). The option passed in as arguments are applied
-// after these default arguments, and all option will be passed down to the
-// services and requests that this client makes.
+// environment (OPENLAYER_API_KEY, OPENLAYER_BASE_URL). The option passed in as
+// arguments are applied after these default arguments, and all option will be
+// passed down to the services and requests that this client makes.
func NewClient(opts ...option.RequestOption) (r *Client) {
opts = append(DefaultClientOptions(), opts...)
diff --git a/committestresult.go b/committestresult.go
index 3375958..936a268 100644
--- a/committestresult.go
+++ b/committestresult.go
@@ -164,12 +164,12 @@ type CommitTestResultListResponseItemsGoal struct {
// The project version (commit) id where the test was created.
OriginProjectVersionID string `json:"originProjectVersionId,required,nullable" format:"uuid"`
// The test subtype.
- Subtype string `json:"subtype,required"`
+ Subtype CommitTestResultListResponseItemsGoalSubtype `json:"subtype,required"`
// Whether the test is suggested or user-created.
Suggested bool `json:"suggested,required"`
Thresholds []CommitTestResultListResponseItemsGoalThreshold `json:"thresholds,required"`
// The test type.
- Type string `json:"type,required"`
+ Type CommitTestResultListResponseItemsGoalType `json:"type,required"`
// Whether the test is archived.
Archived bool `json:"archived"`
// The delay window in seconds. Only applies to tests that use production data.
@@ -227,14 +227,74 @@ func (r commitTestResultListResponseItemsGoalJSON) RawJSON() string {
return r.raw
}
+// The test subtype.
+type CommitTestResultListResponseItemsGoalSubtype string
+
+const (
+ CommitTestResultListResponseItemsGoalSubtypeAnomalousColumnCount CommitTestResultListResponseItemsGoalSubtype = "anomalousColumnCount"
+ CommitTestResultListResponseItemsGoalSubtypeCharacterLength CommitTestResultListResponseItemsGoalSubtype = "characterLength"
+ CommitTestResultListResponseItemsGoalSubtypeClassImbalanceRatio CommitTestResultListResponseItemsGoalSubtype = "classImbalanceRatio"
+ CommitTestResultListResponseItemsGoalSubtypeExpectColumnAToBeInColumnB CommitTestResultListResponseItemsGoalSubtype = "expectColumnAToBeInColumnB"
+ CommitTestResultListResponseItemsGoalSubtypeColumnAverage CommitTestResultListResponseItemsGoalSubtype = "columnAverage"
+ CommitTestResultListResponseItemsGoalSubtypeColumnDrift CommitTestResultListResponseItemsGoalSubtype = "columnDrift"
+ CommitTestResultListResponseItemsGoalSubtypeColumnStatistic CommitTestResultListResponseItemsGoalSubtype = "columnStatistic"
+ CommitTestResultListResponseItemsGoalSubtypeColumnValuesMatch CommitTestResultListResponseItemsGoalSubtype = "columnValuesMatch"
+ CommitTestResultListResponseItemsGoalSubtypeConflictingLabelRowCount CommitTestResultListResponseItemsGoalSubtype = "conflictingLabelRowCount"
+ CommitTestResultListResponseItemsGoalSubtypeContainsPii CommitTestResultListResponseItemsGoalSubtype = "containsPii"
+ CommitTestResultListResponseItemsGoalSubtypeContainsValidURL CommitTestResultListResponseItemsGoalSubtype = "containsValidUrl"
+ CommitTestResultListResponseItemsGoalSubtypeCorrelatedFeatureCount CommitTestResultListResponseItemsGoalSubtype = "correlatedFeatureCount"
+ CommitTestResultListResponseItemsGoalSubtypeCustomMetricThreshold CommitTestResultListResponseItemsGoalSubtype = "customMetricThreshold"
+ CommitTestResultListResponseItemsGoalSubtypeDuplicateRowCount CommitTestResultListResponseItemsGoalSubtype = "duplicateRowCount"
+ CommitTestResultListResponseItemsGoalSubtypeEmptyFeature CommitTestResultListResponseItemsGoalSubtype = "emptyFeature"
+ CommitTestResultListResponseItemsGoalSubtypeEmptyFeatureCount CommitTestResultListResponseItemsGoalSubtype = "emptyFeatureCount"
+ CommitTestResultListResponseItemsGoalSubtypeDriftedFeatureCount CommitTestResultListResponseItemsGoalSubtype = "driftedFeatureCount"
+ CommitTestResultListResponseItemsGoalSubtypeFeatureMissingValues CommitTestResultListResponseItemsGoalSubtype = "featureMissingValues"
+ CommitTestResultListResponseItemsGoalSubtypeFeatureValueValidation CommitTestResultListResponseItemsGoalSubtype = "featureValueValidation"
+ CommitTestResultListResponseItemsGoalSubtypeGreatExpectations CommitTestResultListResponseItemsGoalSubtype = "greatExpectations"
+ CommitTestResultListResponseItemsGoalSubtypeGroupByColumnStatsCheck CommitTestResultListResponseItemsGoalSubtype = "groupByColumnStatsCheck"
+ CommitTestResultListResponseItemsGoalSubtypeIllFormedRowCount CommitTestResultListResponseItemsGoalSubtype = "illFormedRowCount"
+ CommitTestResultListResponseItemsGoalSubtypeIsCode CommitTestResultListResponseItemsGoalSubtype = "isCode"
+ CommitTestResultListResponseItemsGoalSubtypeIsJson CommitTestResultListResponseItemsGoalSubtype = "isJson"
+ CommitTestResultListResponseItemsGoalSubtypeLlmRubricThresholdV2 CommitTestResultListResponseItemsGoalSubtype = "llmRubricThresholdV2"
+ CommitTestResultListResponseItemsGoalSubtypeLabelDrift CommitTestResultListResponseItemsGoalSubtype = "labelDrift"
+ CommitTestResultListResponseItemsGoalSubtypeMetricThreshold CommitTestResultListResponseItemsGoalSubtype = "metricThreshold"
+ CommitTestResultListResponseItemsGoalSubtypeNewCategoryCount CommitTestResultListResponseItemsGoalSubtype = "newCategoryCount"
+ CommitTestResultListResponseItemsGoalSubtypeNewLabelCount CommitTestResultListResponseItemsGoalSubtype = "newLabelCount"
+ CommitTestResultListResponseItemsGoalSubtypeNullRowCount CommitTestResultListResponseItemsGoalSubtype = "nullRowCount"
+ CommitTestResultListResponseItemsGoalSubtypeRowCount CommitTestResultListResponseItemsGoalSubtype = "rowCount"
+ CommitTestResultListResponseItemsGoalSubtypePpScoreValueValidation CommitTestResultListResponseItemsGoalSubtype = "ppScoreValueValidation"
+ CommitTestResultListResponseItemsGoalSubtypeQuasiConstantFeature CommitTestResultListResponseItemsGoalSubtype = "quasiConstantFeature"
+ CommitTestResultListResponseItemsGoalSubtypeQuasiConstantFeatureCount CommitTestResultListResponseItemsGoalSubtype = "quasiConstantFeatureCount"
+ CommitTestResultListResponseItemsGoalSubtypeSqlQuery CommitTestResultListResponseItemsGoalSubtype = "sqlQuery"
+ CommitTestResultListResponseItemsGoalSubtypeDtypeValidation CommitTestResultListResponseItemsGoalSubtype = "dtypeValidation"
+ CommitTestResultListResponseItemsGoalSubtypeSentenceLength CommitTestResultListResponseItemsGoalSubtype = "sentenceLength"
+ CommitTestResultListResponseItemsGoalSubtypeSizeRatio CommitTestResultListResponseItemsGoalSubtype = "sizeRatio"
+ CommitTestResultListResponseItemsGoalSubtypeSpecialCharactersRatio CommitTestResultListResponseItemsGoalSubtype = "specialCharactersRatio"
+ CommitTestResultListResponseItemsGoalSubtypeStringValidation CommitTestResultListResponseItemsGoalSubtype = "stringValidation"
+ CommitTestResultListResponseItemsGoalSubtypeTrainValLeakageRowCount CommitTestResultListResponseItemsGoalSubtype = "trainValLeakageRowCount"
+)
+
+func (r CommitTestResultListResponseItemsGoalSubtype) IsKnown() bool {
+ switch r {
+ case CommitTestResultListResponseItemsGoalSubtypeAnomalousColumnCount, CommitTestResultListResponseItemsGoalSubtypeCharacterLength, CommitTestResultListResponseItemsGoalSubtypeClassImbalanceRatio, CommitTestResultListResponseItemsGoalSubtypeExpectColumnAToBeInColumnB, CommitTestResultListResponseItemsGoalSubtypeColumnAverage, CommitTestResultListResponseItemsGoalSubtypeColumnDrift, CommitTestResultListResponseItemsGoalSubtypeColumnStatistic, CommitTestResultListResponseItemsGoalSubtypeColumnValuesMatch, CommitTestResultListResponseItemsGoalSubtypeConflictingLabelRowCount, CommitTestResultListResponseItemsGoalSubtypeContainsPii, CommitTestResultListResponseItemsGoalSubtypeContainsValidURL, CommitTestResultListResponseItemsGoalSubtypeCorrelatedFeatureCount, CommitTestResultListResponseItemsGoalSubtypeCustomMetricThreshold, CommitTestResultListResponseItemsGoalSubtypeDuplicateRowCount, CommitTestResultListResponseItemsGoalSubtypeEmptyFeature, CommitTestResultListResponseItemsGoalSubtypeEmptyFeatureCount, CommitTestResultListResponseItemsGoalSubtypeDriftedFeatureCount, CommitTestResultListResponseItemsGoalSubtypeFeatureMissingValues, CommitTestResultListResponseItemsGoalSubtypeFeatureValueValidation, CommitTestResultListResponseItemsGoalSubtypeGreatExpectations, CommitTestResultListResponseItemsGoalSubtypeGroupByColumnStatsCheck, CommitTestResultListResponseItemsGoalSubtypeIllFormedRowCount, CommitTestResultListResponseItemsGoalSubtypeIsCode, CommitTestResultListResponseItemsGoalSubtypeIsJson, CommitTestResultListResponseItemsGoalSubtypeLlmRubricThresholdV2, CommitTestResultListResponseItemsGoalSubtypeLabelDrift, CommitTestResultListResponseItemsGoalSubtypeMetricThreshold, CommitTestResultListResponseItemsGoalSubtypeNewCategoryCount, CommitTestResultListResponseItemsGoalSubtypeNewLabelCount, CommitTestResultListResponseItemsGoalSubtypeNullRowCount, CommitTestResultListResponseItemsGoalSubtypeRowCount, CommitTestResultListResponseItemsGoalSubtypePpScoreValueValidation, CommitTestResultListResponseItemsGoalSubtypeQuasiConstantFeature, CommitTestResultListResponseItemsGoalSubtypeQuasiConstantFeatureCount, CommitTestResultListResponseItemsGoalSubtypeSqlQuery, CommitTestResultListResponseItemsGoalSubtypeDtypeValidation, CommitTestResultListResponseItemsGoalSubtypeSentenceLength, CommitTestResultListResponseItemsGoalSubtypeSizeRatio, CommitTestResultListResponseItemsGoalSubtypeSpecialCharactersRatio, CommitTestResultListResponseItemsGoalSubtypeStringValidation, CommitTestResultListResponseItemsGoalSubtypeTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
type CommitTestResultListResponseItemsGoalThreshold struct {
// The insight name to be evaluated.
- InsightName string `json:"insightName"`
- InsightParameters []interface{} `json:"insightParameters"`
+ InsightName CommitTestResultListResponseItemsGoalThresholdsInsightName `json:"insightName"`
+ // The insight parameters. Required only for some test subtypes. For example, for
+ // tests that require a column name, the insight parameters will be [{'name':
+ // 'column_name', 'value': 'Age'}]
+ InsightParameters []CommitTestResultListResponseItemsGoalThresholdsInsightParameter `json:"insightParameters,nullable"`
// The measurement to be evaluated.
Measurement string `json:"measurement"`
// The operator to be used for the evaluation.
- Operator string `json:"operator"`
+ Operator CommitTestResultListResponseItemsGoalThresholdsOperator `json:"operator"`
+ // Whether to use automatic anomaly detection or manual thresholds
+ ThresholdMode CommitTestResultListResponseItemsGoalThresholdsThresholdMode `json:"thresholdMode"`
// The value to be compared.
Value CommitTestResultListResponseItemsGoalThresholdsValueUnion `json:"value"`
JSON commitTestResultListResponseItemsGoalThresholdJSON `json:"-"`
@@ -247,6 +307,7 @@ type commitTestResultListResponseItemsGoalThresholdJSON struct {
InsightParameters apijson.Field
Measurement apijson.Field
Operator apijson.Field
+ ThresholdMode apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
@@ -260,6 +321,115 @@ func (r commitTestResultListResponseItemsGoalThresholdJSON) RawJSON() string {
return r.raw
}
+// The insight name to be evaluated.
+type CommitTestResultListResponseItemsGoalThresholdsInsightName string
+
+const (
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameCharacterLength CommitTestResultListResponseItemsGoalThresholdsInsightName = "characterLength"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameClassImbalance CommitTestResultListResponseItemsGoalThresholdsInsightName = "classImbalance"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameExpectColumnAToBeInColumnB CommitTestResultListResponseItemsGoalThresholdsInsightName = "expectColumnAToBeInColumnB"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameColumnAverage CommitTestResultListResponseItemsGoalThresholdsInsightName = "columnAverage"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameColumnDrift CommitTestResultListResponseItemsGoalThresholdsInsightName = "columnDrift"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameColumnValuesMatch CommitTestResultListResponseItemsGoalThresholdsInsightName = "columnValuesMatch"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameConfidenceDistribution CommitTestResultListResponseItemsGoalThresholdsInsightName = "confidenceDistribution"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameConflictingLabelRowCount CommitTestResultListResponseItemsGoalThresholdsInsightName = "conflictingLabelRowCount"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameContainsPii CommitTestResultListResponseItemsGoalThresholdsInsightName = "containsPii"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameContainsValidURL CommitTestResultListResponseItemsGoalThresholdsInsightName = "containsValidUrl"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameCorrelatedFeatures CommitTestResultListResponseItemsGoalThresholdsInsightName = "correlatedFeatures"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameCustomMetric CommitTestResultListResponseItemsGoalThresholdsInsightName = "customMetric"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameDuplicateRowCount CommitTestResultListResponseItemsGoalThresholdsInsightName = "duplicateRowCount"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameEmptyFeatures CommitTestResultListResponseItemsGoalThresholdsInsightName = "emptyFeatures"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameFeatureDrift CommitTestResultListResponseItemsGoalThresholdsInsightName = "featureDrift"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameFeatureProfile CommitTestResultListResponseItemsGoalThresholdsInsightName = "featureProfile"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameGreatExpectations CommitTestResultListResponseItemsGoalThresholdsInsightName = "greatExpectations"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameGroupByColumnStatsCheck CommitTestResultListResponseItemsGoalThresholdsInsightName = "groupByColumnStatsCheck"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameIllFormedRowCount CommitTestResultListResponseItemsGoalThresholdsInsightName = "illFormedRowCount"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameIsCode CommitTestResultListResponseItemsGoalThresholdsInsightName = "isCode"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameIsJson CommitTestResultListResponseItemsGoalThresholdsInsightName = "isJson"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameLlmRubricV2 CommitTestResultListResponseItemsGoalThresholdsInsightName = "llmRubricV2"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameLabelDrift CommitTestResultListResponseItemsGoalThresholdsInsightName = "labelDrift"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameMetrics CommitTestResultListResponseItemsGoalThresholdsInsightName = "metrics"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameNewCategories CommitTestResultListResponseItemsGoalThresholdsInsightName = "newCategories"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameNewLabels CommitTestResultListResponseItemsGoalThresholdsInsightName = "newLabels"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameNullRowCount CommitTestResultListResponseItemsGoalThresholdsInsightName = "nullRowCount"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNamePpScore CommitTestResultListResponseItemsGoalThresholdsInsightName = "ppScore"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameQuasiConstantFeatures CommitTestResultListResponseItemsGoalThresholdsInsightName = "quasiConstantFeatures"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameSentenceLength CommitTestResultListResponseItemsGoalThresholdsInsightName = "sentenceLength"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameSizeRatio CommitTestResultListResponseItemsGoalThresholdsInsightName = "sizeRatio"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameSpecialCharacters CommitTestResultListResponseItemsGoalThresholdsInsightName = "specialCharacters"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameStringValidation CommitTestResultListResponseItemsGoalThresholdsInsightName = "stringValidation"
+ CommitTestResultListResponseItemsGoalThresholdsInsightNameTrainValLeakageRowCount CommitTestResultListResponseItemsGoalThresholdsInsightName = "trainValLeakageRowCount"
+)
+
+func (r CommitTestResultListResponseItemsGoalThresholdsInsightName) IsKnown() bool {
+ switch r {
+ case CommitTestResultListResponseItemsGoalThresholdsInsightNameCharacterLength, CommitTestResultListResponseItemsGoalThresholdsInsightNameClassImbalance, CommitTestResultListResponseItemsGoalThresholdsInsightNameExpectColumnAToBeInColumnB, CommitTestResultListResponseItemsGoalThresholdsInsightNameColumnAverage, CommitTestResultListResponseItemsGoalThresholdsInsightNameColumnDrift, CommitTestResultListResponseItemsGoalThresholdsInsightNameColumnValuesMatch, CommitTestResultListResponseItemsGoalThresholdsInsightNameConfidenceDistribution, CommitTestResultListResponseItemsGoalThresholdsInsightNameConflictingLabelRowCount, CommitTestResultListResponseItemsGoalThresholdsInsightNameContainsPii, CommitTestResultListResponseItemsGoalThresholdsInsightNameContainsValidURL, CommitTestResultListResponseItemsGoalThresholdsInsightNameCorrelatedFeatures, CommitTestResultListResponseItemsGoalThresholdsInsightNameCustomMetric, CommitTestResultListResponseItemsGoalThresholdsInsightNameDuplicateRowCount, CommitTestResultListResponseItemsGoalThresholdsInsightNameEmptyFeatures, CommitTestResultListResponseItemsGoalThresholdsInsightNameFeatureDrift, CommitTestResultListResponseItemsGoalThresholdsInsightNameFeatureProfile, CommitTestResultListResponseItemsGoalThresholdsInsightNameGreatExpectations, CommitTestResultListResponseItemsGoalThresholdsInsightNameGroupByColumnStatsCheck, CommitTestResultListResponseItemsGoalThresholdsInsightNameIllFormedRowCount, CommitTestResultListResponseItemsGoalThresholdsInsightNameIsCode, CommitTestResultListResponseItemsGoalThresholdsInsightNameIsJson, CommitTestResultListResponseItemsGoalThresholdsInsightNameLlmRubricV2, CommitTestResultListResponseItemsGoalThresholdsInsightNameLabelDrift, CommitTestResultListResponseItemsGoalThresholdsInsightNameMetrics, CommitTestResultListResponseItemsGoalThresholdsInsightNameNewCategories, CommitTestResultListResponseItemsGoalThresholdsInsightNameNewLabels, CommitTestResultListResponseItemsGoalThresholdsInsightNameNullRowCount, CommitTestResultListResponseItemsGoalThresholdsInsightNamePpScore, CommitTestResultListResponseItemsGoalThresholdsInsightNameQuasiConstantFeatures, CommitTestResultListResponseItemsGoalThresholdsInsightNameSentenceLength, CommitTestResultListResponseItemsGoalThresholdsInsightNameSizeRatio, CommitTestResultListResponseItemsGoalThresholdsInsightNameSpecialCharacters, CommitTestResultListResponseItemsGoalThresholdsInsightNameStringValidation, CommitTestResultListResponseItemsGoalThresholdsInsightNameTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type CommitTestResultListResponseItemsGoalThresholdsInsightParameter struct {
+ // The name of the insight filter.
+ Name string `json:"name,required"`
+ Value interface{} `json:"value,required"`
+ JSON commitTestResultListResponseItemsGoalThresholdsInsightParameterJSON `json:"-"`
+}
+
+// commitTestResultListResponseItemsGoalThresholdsInsightParameterJSON contains the
+// JSON metadata for the struct
+// [CommitTestResultListResponseItemsGoalThresholdsInsightParameter]
+type commitTestResultListResponseItemsGoalThresholdsInsightParameterJSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *CommitTestResultListResponseItemsGoalThresholdsInsightParameter) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r commitTestResultListResponseItemsGoalThresholdsInsightParameterJSON) RawJSON() string {
+ return r.raw
+}
+
+// The operator to be used for the evaluation.
+type CommitTestResultListResponseItemsGoalThresholdsOperator string
+
+const (
+ CommitTestResultListResponseItemsGoalThresholdsOperatorIs CommitTestResultListResponseItemsGoalThresholdsOperator = "is"
+ CommitTestResultListResponseItemsGoalThresholdsOperatorGreater CommitTestResultListResponseItemsGoalThresholdsOperator = ">"
+ CommitTestResultListResponseItemsGoalThresholdsOperatorGreaterOrEquals CommitTestResultListResponseItemsGoalThresholdsOperator = ">="
+ CommitTestResultListResponseItemsGoalThresholdsOperatorLess CommitTestResultListResponseItemsGoalThresholdsOperator = "<"
+ CommitTestResultListResponseItemsGoalThresholdsOperatorLessOrEquals CommitTestResultListResponseItemsGoalThresholdsOperator = "<="
+ CommitTestResultListResponseItemsGoalThresholdsOperatorNotEquals CommitTestResultListResponseItemsGoalThresholdsOperator = "!="
+)
+
+func (r CommitTestResultListResponseItemsGoalThresholdsOperator) IsKnown() bool {
+ switch r {
+ case CommitTestResultListResponseItemsGoalThresholdsOperatorIs, CommitTestResultListResponseItemsGoalThresholdsOperatorGreater, CommitTestResultListResponseItemsGoalThresholdsOperatorGreaterOrEquals, CommitTestResultListResponseItemsGoalThresholdsOperatorLess, CommitTestResultListResponseItemsGoalThresholdsOperatorLessOrEquals, CommitTestResultListResponseItemsGoalThresholdsOperatorNotEquals:
+ return true
+ }
+ return false
+}
+
+// Whether to use automatic anomaly detection or manual thresholds
+type CommitTestResultListResponseItemsGoalThresholdsThresholdMode string
+
+const (
+ CommitTestResultListResponseItemsGoalThresholdsThresholdModeAutomatic CommitTestResultListResponseItemsGoalThresholdsThresholdMode = "automatic"
+ CommitTestResultListResponseItemsGoalThresholdsThresholdModeManual CommitTestResultListResponseItemsGoalThresholdsThresholdMode = "manual"
+)
+
+func (r CommitTestResultListResponseItemsGoalThresholdsThresholdMode) IsKnown() bool {
+ switch r {
+ case CommitTestResultListResponseItemsGoalThresholdsThresholdModeAutomatic, CommitTestResultListResponseItemsGoalThresholdsThresholdModeManual:
+ return true
+ }
+ return false
+}
+
// The value to be compared.
//
// Union satisfied by [shared.UnionFloat], [shared.UnionBool], [shared.UnionString]
@@ -300,8 +470,25 @@ type CommitTestResultListResponseItemsGoalThresholdsValueArray []string
func (r CommitTestResultListResponseItemsGoalThresholdsValueArray) ImplementsCommitTestResultListResponseItemsGoalThresholdsValueUnion() {
}
+// The test type.
+type CommitTestResultListResponseItemsGoalType string
+
+const (
+ CommitTestResultListResponseItemsGoalTypeIntegrity CommitTestResultListResponseItemsGoalType = "integrity"
+ CommitTestResultListResponseItemsGoalTypeConsistency CommitTestResultListResponseItemsGoalType = "consistency"
+ CommitTestResultListResponseItemsGoalTypePerformance CommitTestResultListResponseItemsGoalType = "performance"
+)
+
+func (r CommitTestResultListResponseItemsGoalType) IsKnown() bool {
+ switch r {
+ case CommitTestResultListResponseItemsGoalTypeIntegrity, CommitTestResultListResponseItemsGoalTypeConsistency, CommitTestResultListResponseItemsGoalTypePerformance:
+ return true
+ }
+ return false
+}
+
type CommitTestResultListParams struct {
- // Include archived goals.
+ // Filter for archived tests.
IncludeArchived param.Field[bool] `query:"includeArchived"`
// The page to return in a paginated query.
Page param.Field[int64] `query:"page"`
diff --git a/committestresult_test.go b/committestresult_test.go
index 3d82ea5..f1e86c0 100644
--- a/committestresult_test.go
+++ b/committestresult_test.go
@@ -32,7 +32,7 @@ func TestCommitTestResultListWithOptionalParams(t *testing.T) {
IncludeArchived: openlayer.F(true),
Page: openlayer.F(int64(1)),
PerPage: openlayer.F(int64(1)),
- Status: openlayer.F(openlayer.CommitTestResultListParamsStatusRunning),
+ Status: openlayer.F(openlayer.CommitTestResultListParamsStatusPassing),
Type: openlayer.F(openlayer.CommitTestResultListParamsTypeIntegrity),
},
)
diff --git a/inferencepipelinetestresult.go b/inferencepipelinetestresult.go
index e6e1a5d..d21a8df 100644
--- a/inferencepipelinetestresult.go
+++ b/inferencepipelinetestresult.go
@@ -164,12 +164,12 @@ type InferencePipelineTestResultListResponseItemsGoal struct {
// The project version (commit) id where the test was created.
OriginProjectVersionID string `json:"originProjectVersionId,required,nullable" format:"uuid"`
// The test subtype.
- Subtype string `json:"subtype,required"`
+ Subtype InferencePipelineTestResultListResponseItemsGoalSubtype `json:"subtype,required"`
// Whether the test is suggested or user-created.
Suggested bool `json:"suggested,required"`
Thresholds []InferencePipelineTestResultListResponseItemsGoalThreshold `json:"thresholds,required"`
// The test type.
- Type string `json:"type,required"`
+ Type InferencePipelineTestResultListResponseItemsGoalType `json:"type,required"`
// Whether the test is archived.
Archived bool `json:"archived"`
// The delay window in seconds. Only applies to tests that use production data.
@@ -227,14 +227,74 @@ func (r inferencePipelineTestResultListResponseItemsGoalJSON) RawJSON() string {
return r.raw
}
+// The test subtype.
+type InferencePipelineTestResultListResponseItemsGoalSubtype string
+
+const (
+ InferencePipelineTestResultListResponseItemsGoalSubtypeAnomalousColumnCount InferencePipelineTestResultListResponseItemsGoalSubtype = "anomalousColumnCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeCharacterLength InferencePipelineTestResultListResponseItemsGoalSubtype = "characterLength"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeClassImbalanceRatio InferencePipelineTestResultListResponseItemsGoalSubtype = "classImbalanceRatio"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeExpectColumnAToBeInColumnB InferencePipelineTestResultListResponseItemsGoalSubtype = "expectColumnAToBeInColumnB"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeColumnAverage InferencePipelineTestResultListResponseItemsGoalSubtype = "columnAverage"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeColumnDrift InferencePipelineTestResultListResponseItemsGoalSubtype = "columnDrift"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeColumnStatistic InferencePipelineTestResultListResponseItemsGoalSubtype = "columnStatistic"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeColumnValuesMatch InferencePipelineTestResultListResponseItemsGoalSubtype = "columnValuesMatch"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeConflictingLabelRowCount InferencePipelineTestResultListResponseItemsGoalSubtype = "conflictingLabelRowCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeContainsPii InferencePipelineTestResultListResponseItemsGoalSubtype = "containsPii"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeContainsValidURL InferencePipelineTestResultListResponseItemsGoalSubtype = "containsValidUrl"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeCorrelatedFeatureCount InferencePipelineTestResultListResponseItemsGoalSubtype = "correlatedFeatureCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeCustomMetricThreshold InferencePipelineTestResultListResponseItemsGoalSubtype = "customMetricThreshold"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeDuplicateRowCount InferencePipelineTestResultListResponseItemsGoalSubtype = "duplicateRowCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeEmptyFeature InferencePipelineTestResultListResponseItemsGoalSubtype = "emptyFeature"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeEmptyFeatureCount InferencePipelineTestResultListResponseItemsGoalSubtype = "emptyFeatureCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeDriftedFeatureCount InferencePipelineTestResultListResponseItemsGoalSubtype = "driftedFeatureCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeFeatureMissingValues InferencePipelineTestResultListResponseItemsGoalSubtype = "featureMissingValues"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeFeatureValueValidation InferencePipelineTestResultListResponseItemsGoalSubtype = "featureValueValidation"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeGreatExpectations InferencePipelineTestResultListResponseItemsGoalSubtype = "greatExpectations"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeGroupByColumnStatsCheck InferencePipelineTestResultListResponseItemsGoalSubtype = "groupByColumnStatsCheck"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeIllFormedRowCount InferencePipelineTestResultListResponseItemsGoalSubtype = "illFormedRowCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeIsCode InferencePipelineTestResultListResponseItemsGoalSubtype = "isCode"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeIsJson InferencePipelineTestResultListResponseItemsGoalSubtype = "isJson"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeLlmRubricThresholdV2 InferencePipelineTestResultListResponseItemsGoalSubtype = "llmRubricThresholdV2"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeLabelDrift InferencePipelineTestResultListResponseItemsGoalSubtype = "labelDrift"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeMetricThreshold InferencePipelineTestResultListResponseItemsGoalSubtype = "metricThreshold"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeNewCategoryCount InferencePipelineTestResultListResponseItemsGoalSubtype = "newCategoryCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeNewLabelCount InferencePipelineTestResultListResponseItemsGoalSubtype = "newLabelCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeNullRowCount InferencePipelineTestResultListResponseItemsGoalSubtype = "nullRowCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeRowCount InferencePipelineTestResultListResponseItemsGoalSubtype = "rowCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypePpScoreValueValidation InferencePipelineTestResultListResponseItemsGoalSubtype = "ppScoreValueValidation"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeQuasiConstantFeature InferencePipelineTestResultListResponseItemsGoalSubtype = "quasiConstantFeature"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeQuasiConstantFeatureCount InferencePipelineTestResultListResponseItemsGoalSubtype = "quasiConstantFeatureCount"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeSqlQuery InferencePipelineTestResultListResponseItemsGoalSubtype = "sqlQuery"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeDtypeValidation InferencePipelineTestResultListResponseItemsGoalSubtype = "dtypeValidation"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeSentenceLength InferencePipelineTestResultListResponseItemsGoalSubtype = "sentenceLength"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeSizeRatio InferencePipelineTestResultListResponseItemsGoalSubtype = "sizeRatio"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeSpecialCharactersRatio InferencePipelineTestResultListResponseItemsGoalSubtype = "specialCharactersRatio"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeStringValidation InferencePipelineTestResultListResponseItemsGoalSubtype = "stringValidation"
+ InferencePipelineTestResultListResponseItemsGoalSubtypeTrainValLeakageRowCount InferencePipelineTestResultListResponseItemsGoalSubtype = "trainValLeakageRowCount"
+)
+
+func (r InferencePipelineTestResultListResponseItemsGoalSubtype) IsKnown() bool {
+ switch r {
+ case InferencePipelineTestResultListResponseItemsGoalSubtypeAnomalousColumnCount, InferencePipelineTestResultListResponseItemsGoalSubtypeCharacterLength, InferencePipelineTestResultListResponseItemsGoalSubtypeClassImbalanceRatio, InferencePipelineTestResultListResponseItemsGoalSubtypeExpectColumnAToBeInColumnB, InferencePipelineTestResultListResponseItemsGoalSubtypeColumnAverage, InferencePipelineTestResultListResponseItemsGoalSubtypeColumnDrift, InferencePipelineTestResultListResponseItemsGoalSubtypeColumnStatistic, InferencePipelineTestResultListResponseItemsGoalSubtypeColumnValuesMatch, InferencePipelineTestResultListResponseItemsGoalSubtypeConflictingLabelRowCount, InferencePipelineTestResultListResponseItemsGoalSubtypeContainsPii, InferencePipelineTestResultListResponseItemsGoalSubtypeContainsValidURL, InferencePipelineTestResultListResponseItemsGoalSubtypeCorrelatedFeatureCount, InferencePipelineTestResultListResponseItemsGoalSubtypeCustomMetricThreshold, InferencePipelineTestResultListResponseItemsGoalSubtypeDuplicateRowCount, InferencePipelineTestResultListResponseItemsGoalSubtypeEmptyFeature, InferencePipelineTestResultListResponseItemsGoalSubtypeEmptyFeatureCount, InferencePipelineTestResultListResponseItemsGoalSubtypeDriftedFeatureCount, InferencePipelineTestResultListResponseItemsGoalSubtypeFeatureMissingValues, InferencePipelineTestResultListResponseItemsGoalSubtypeFeatureValueValidation, InferencePipelineTestResultListResponseItemsGoalSubtypeGreatExpectations, InferencePipelineTestResultListResponseItemsGoalSubtypeGroupByColumnStatsCheck, InferencePipelineTestResultListResponseItemsGoalSubtypeIllFormedRowCount, InferencePipelineTestResultListResponseItemsGoalSubtypeIsCode, InferencePipelineTestResultListResponseItemsGoalSubtypeIsJson, InferencePipelineTestResultListResponseItemsGoalSubtypeLlmRubricThresholdV2, InferencePipelineTestResultListResponseItemsGoalSubtypeLabelDrift, InferencePipelineTestResultListResponseItemsGoalSubtypeMetricThreshold, InferencePipelineTestResultListResponseItemsGoalSubtypeNewCategoryCount, InferencePipelineTestResultListResponseItemsGoalSubtypeNewLabelCount, InferencePipelineTestResultListResponseItemsGoalSubtypeNullRowCount, InferencePipelineTestResultListResponseItemsGoalSubtypeRowCount, InferencePipelineTestResultListResponseItemsGoalSubtypePpScoreValueValidation, InferencePipelineTestResultListResponseItemsGoalSubtypeQuasiConstantFeature, InferencePipelineTestResultListResponseItemsGoalSubtypeQuasiConstantFeatureCount, InferencePipelineTestResultListResponseItemsGoalSubtypeSqlQuery, InferencePipelineTestResultListResponseItemsGoalSubtypeDtypeValidation, InferencePipelineTestResultListResponseItemsGoalSubtypeSentenceLength, InferencePipelineTestResultListResponseItemsGoalSubtypeSizeRatio, InferencePipelineTestResultListResponseItemsGoalSubtypeSpecialCharactersRatio, InferencePipelineTestResultListResponseItemsGoalSubtypeStringValidation, InferencePipelineTestResultListResponseItemsGoalSubtypeTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
type InferencePipelineTestResultListResponseItemsGoalThreshold struct {
// The insight name to be evaluated.
- InsightName string `json:"insightName"`
- InsightParameters []interface{} `json:"insightParameters"`
+ InsightName InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName `json:"insightName"`
+ // The insight parameters. Required only for some test subtypes. For example, for
+ // tests that require a column name, the insight parameters will be [{'name':
+ // 'column_name', 'value': 'Age'}]
+ InsightParameters []InferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameter `json:"insightParameters,nullable"`
// The measurement to be evaluated.
Measurement string `json:"measurement"`
// The operator to be used for the evaluation.
- Operator string `json:"operator"`
+ Operator InferencePipelineTestResultListResponseItemsGoalThresholdsOperator `json:"operator"`
+ // Whether to use automatic anomaly detection or manual thresholds
+ ThresholdMode InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdMode `json:"thresholdMode"`
// The value to be compared.
Value InferencePipelineTestResultListResponseItemsGoalThresholdsValueUnion `json:"value"`
JSON inferencePipelineTestResultListResponseItemsGoalThresholdJSON `json:"-"`
@@ -248,6 +308,7 @@ type inferencePipelineTestResultListResponseItemsGoalThresholdJSON struct {
InsightParameters apijson.Field
Measurement apijson.Field
Operator apijson.Field
+ ThresholdMode apijson.Field
Value apijson.Field
raw string
ExtraFields map[string]apijson.Field
@@ -261,6 +322,115 @@ func (r inferencePipelineTestResultListResponseItemsGoalThresholdJSON) RawJSON()
return r.raw
}
+// The insight name to be evaluated.
+type InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName string
+
+const (
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameCharacterLength InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "characterLength"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameClassImbalance InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "classImbalance"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameExpectColumnAToBeInColumnB InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "expectColumnAToBeInColumnB"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameColumnAverage InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "columnAverage"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameColumnDrift InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "columnDrift"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameColumnValuesMatch InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "columnValuesMatch"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameConfidenceDistribution InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "confidenceDistribution"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameConflictingLabelRowCount InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "conflictingLabelRowCount"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameContainsPii InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "containsPii"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameContainsValidURL InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "containsValidUrl"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameCorrelatedFeatures InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "correlatedFeatures"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameCustomMetric InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "customMetric"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameDuplicateRowCount InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "duplicateRowCount"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameEmptyFeatures InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "emptyFeatures"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameFeatureDrift InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "featureDrift"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameFeatureProfile InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "featureProfile"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameGreatExpectations InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "greatExpectations"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameGroupByColumnStatsCheck InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "groupByColumnStatsCheck"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameIllFormedRowCount InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "illFormedRowCount"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameIsCode InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "isCode"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameIsJson InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "isJson"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameLlmRubricV2 InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "llmRubricV2"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameLabelDrift InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "labelDrift"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameMetrics InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "metrics"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameNewCategories InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "newCategories"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameNewLabels InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "newLabels"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameNullRowCount InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "nullRowCount"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNamePpScore InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "ppScore"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameQuasiConstantFeatures InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "quasiConstantFeatures"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameSentenceLength InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "sentenceLength"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameSizeRatio InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "sizeRatio"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameSpecialCharacters InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "specialCharacters"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameStringValidation InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "stringValidation"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameTrainValLeakageRowCount InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName = "trainValLeakageRowCount"
+)
+
+func (r InferencePipelineTestResultListResponseItemsGoalThresholdsInsightName) IsKnown() bool {
+ switch r {
+ case InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameCharacterLength, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameClassImbalance, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameExpectColumnAToBeInColumnB, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameColumnAverage, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameColumnDrift, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameColumnValuesMatch, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameConfidenceDistribution, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameConflictingLabelRowCount, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameContainsPii, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameContainsValidURL, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameCorrelatedFeatures, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameCustomMetric, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameDuplicateRowCount, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameEmptyFeatures, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameFeatureDrift, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameFeatureProfile, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameGreatExpectations, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameGroupByColumnStatsCheck, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameIllFormedRowCount, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameIsCode, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameIsJson, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameLlmRubricV2, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameLabelDrift, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameMetrics, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameNewCategories, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameNewLabels, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameNullRowCount, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNamePpScore, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameQuasiConstantFeatures, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameSentenceLength, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameSizeRatio, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameSpecialCharacters, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameStringValidation, InferencePipelineTestResultListResponseItemsGoalThresholdsInsightNameTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type InferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameter struct {
+ // The name of the insight filter.
+ Name string `json:"name,required"`
+ Value interface{} `json:"value,required"`
+ JSON inferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameterJSON `json:"-"`
+}
+
+// inferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameterJSON
+// contains the JSON metadata for the struct
+// [InferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameter]
+type inferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameterJSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *InferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameter) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r inferencePipelineTestResultListResponseItemsGoalThresholdsInsightParameterJSON) RawJSON() string {
+ return r.raw
+}
+
+// The operator to be used for the evaluation.
+type InferencePipelineTestResultListResponseItemsGoalThresholdsOperator string
+
+const (
+ InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorIs InferencePipelineTestResultListResponseItemsGoalThresholdsOperator = "is"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorGreater InferencePipelineTestResultListResponseItemsGoalThresholdsOperator = ">"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorGreaterOrEquals InferencePipelineTestResultListResponseItemsGoalThresholdsOperator = ">="
+ InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorLess InferencePipelineTestResultListResponseItemsGoalThresholdsOperator = "<"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorLessOrEquals InferencePipelineTestResultListResponseItemsGoalThresholdsOperator = "<="
+ InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorNotEquals InferencePipelineTestResultListResponseItemsGoalThresholdsOperator = "!="
+)
+
+func (r InferencePipelineTestResultListResponseItemsGoalThresholdsOperator) IsKnown() bool {
+ switch r {
+ case InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorIs, InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorGreater, InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorGreaterOrEquals, InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorLess, InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorLessOrEquals, InferencePipelineTestResultListResponseItemsGoalThresholdsOperatorNotEquals:
+ return true
+ }
+ return false
+}
+
+// Whether to use automatic anomaly detection or manual thresholds
+type InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdMode string
+
+const (
+ InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdModeAutomatic InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdMode = "automatic"
+ InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdModeManual InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdMode = "manual"
+)
+
+func (r InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdMode) IsKnown() bool {
+ switch r {
+ case InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdModeAutomatic, InferencePipelineTestResultListResponseItemsGoalThresholdsThresholdModeManual:
+ return true
+ }
+ return false
+}
+
// The value to be compared.
//
// Union satisfied by [shared.UnionFloat], [shared.UnionBool], [shared.UnionString]
@@ -301,6 +471,23 @@ type InferencePipelineTestResultListResponseItemsGoalThresholdsValueArray []stri
func (r InferencePipelineTestResultListResponseItemsGoalThresholdsValueArray) ImplementsInferencePipelineTestResultListResponseItemsGoalThresholdsValueUnion() {
}
+// The test type.
+type InferencePipelineTestResultListResponseItemsGoalType string
+
+const (
+ InferencePipelineTestResultListResponseItemsGoalTypeIntegrity InferencePipelineTestResultListResponseItemsGoalType = "integrity"
+ InferencePipelineTestResultListResponseItemsGoalTypeConsistency InferencePipelineTestResultListResponseItemsGoalType = "consistency"
+ InferencePipelineTestResultListResponseItemsGoalTypePerformance InferencePipelineTestResultListResponseItemsGoalType = "performance"
+)
+
+func (r InferencePipelineTestResultListResponseItemsGoalType) IsKnown() bool {
+ switch r {
+ case InferencePipelineTestResultListResponseItemsGoalTypeIntegrity, InferencePipelineTestResultListResponseItemsGoalTypeConsistency, InferencePipelineTestResultListResponseItemsGoalTypePerformance:
+ return true
+ }
+ return false
+}
+
type InferencePipelineTestResultListParams struct {
// The page to return in a paginated query.
Page param.Field[int64] `query:"page"`
diff --git a/inferencepipelinetestresult_test.go b/inferencepipelinetestresult_test.go
index 216fb1d..359da70 100644
--- a/inferencepipelinetestresult_test.go
+++ b/inferencepipelinetestresult_test.go
@@ -31,7 +31,7 @@ func TestInferencePipelineTestResultListWithOptionalParams(t *testing.T) {
openlayer.InferencePipelineTestResultListParams{
Page: openlayer.F(int64(1)),
PerPage: openlayer.F(int64(1)),
- Status: openlayer.F(openlayer.InferencePipelineTestResultListParamsStatusRunning),
+ Status: openlayer.F(openlayer.InferencePipelineTestResultListParamsStatusPassing),
Type: openlayer.F(openlayer.InferencePipelineTestResultListParamsTypeIntegrity),
},
)
diff --git a/internal/requestconfig/requestconfig.go b/internal/requestconfig/requestconfig.go
index 902e94f..5e9e8a2 100644
--- a/internal/requestconfig/requestconfig.go
+++ b/internal/requestconfig/requestconfig.go
@@ -192,6 +192,12 @@ func UseDefaultParam[T any](dst *param.Field[T], src *T) {
}
}
+// This interface is primarily used to describe an [*http.Client], but also
+// supports custom HTTP implementations.
+type HTTPDoer interface {
+ Do(req *http.Request) (*http.Response, error)
+}
+
// RequestConfig represents all the state related to one request.
//
// Editing the variables inside RequestConfig directly is unstable api. Prefer
@@ -202,6 +208,10 @@ type RequestConfig struct {
Context context.Context
Request *http.Request
BaseURL *url.URL
+ // DefaultBaseURL will be used if BaseURL is not explicitly overridden using
+ // WithBaseURL.
+ DefaultBaseURL *url.URL
+ CustomHTTPDoer HTTPDoer
HTTPClient *http.Client
Middlewares []middleware
APIKey string
@@ -367,7 +377,11 @@ func retryDelay(res *http.Response, retryCount int) time.Duration {
func (cfg *RequestConfig) Execute() (err error) {
if cfg.BaseURL == nil {
- return fmt.Errorf("requestconfig: base url is not set")
+ if cfg.DefaultBaseURL != nil {
+ cfg.BaseURL = cfg.DefaultBaseURL
+ } else {
+ return fmt.Errorf("requestconfig: base url is not set")
+ }
}
cfg.Request.URL, err = cfg.BaseURL.Parse(strings.TrimLeft(cfg.Request.URL.String(), "/"))
@@ -399,6 +413,9 @@ func (cfg *RequestConfig) Execute() (err error) {
}
handler := cfg.HTTPClient.Do
+ if cfg.CustomHTTPDoer != nil {
+ handler = cfg.CustomHTTPDoer.Do
+ }
for i := len(cfg.Middlewares) - 1; i >= 0; i -= 1 {
handler = applyMiddleware(cfg.Middlewares[i], handler)
}
@@ -498,6 +515,7 @@ func (cfg *RequestConfig) Execute() (err error) {
}
contents, err := io.ReadAll(res.Body)
+ res.Body.Close()
if err != nil {
return fmt.Errorf("error reading response body: %w", err)
}
@@ -579,17 +597,35 @@ func (cfg *RequestConfig) Apply(opts ...RequestOption) error {
return nil
}
+// PreRequestOptions is used to collect all the options which need to be known before
+// a call to [RequestConfig.ExecuteNewRequest], such as path parameters
+// or global defaults.
+// PreRequestOptions will return a [RequestConfig] with the options applied.
+//
+// Only request option functions of type [PreRequestOptionFunc] are applied.
func PreRequestOptions(opts ...RequestOption) (RequestConfig, error) {
cfg := RequestConfig{}
for _, opt := range opts {
- if _, ok := opt.(PreRequestOptionFunc); !ok {
- continue
+ if opt, ok := opt.(PreRequestOptionFunc); ok {
+ err := opt.Apply(&cfg)
+ if err != nil {
+ return cfg, err
+ }
}
+ }
+ return cfg, nil
+}
- err := opt.Apply(&cfg)
+// WithDefaultBaseURL returns a RequestOption that sets the client's default Base URL.
+// This is always overridden by setting a base URL with WithBaseURL.
+// WithBaseURL should be used instead of WithDefaultBaseURL except in internal code.
+func WithDefaultBaseURL(baseURL string) RequestOption {
+ u, err := url.Parse(baseURL)
+ return RequestOptionFunc(func(r *RequestConfig) error {
if err != nil {
- return cfg, err
+ return err
}
- }
- return cfg, nil
+ r.DefaultBaseURL = u
+ return nil
+ })
}
diff --git a/internal/version.go b/internal/version.go
index f578972..b85b90f 100644
--- a/internal/version.go
+++ b/internal/version.go
@@ -2,4 +2,4 @@
package internal
-const PackageVersion = "0.1.0-alpha.16" // x-release-please-version
+const PackageVersion = "0.1.0-alpha.17" // x-release-please-version
diff --git a/option/requestoption.go b/option/requestoption.go
index 5c59183..c3c04d1 100644
--- a/option/requestoption.go
+++ b/option/requestoption.go
@@ -40,11 +40,34 @@ func WithBaseURL(base string) RequestOption {
})
}
-// WithHTTPClient returns a RequestOption that changes the underlying [http.Client] used to make this
+// HTTPClient is primarily used to describe an [*http.Client], but also
+// supports custom implementations.
+//
+// For bespoke implementations, prefer using an [*http.Client] with a
+// custom transport. See [http.RoundTripper] for further information.
+type HTTPClient interface {
+ Do(*http.Request) (*http.Response, error)
+}
+
+// WithHTTPClient returns a RequestOption that changes the underlying http client used to make this
// request, which by default is [http.DefaultClient].
-func WithHTTPClient(client *http.Client) RequestOption {
+//
+// For custom uses cases, it is recommended to provide an [*http.Client] with a custom
+// [http.RoundTripper] as its transport, rather than directly implementing [HTTPClient].
+func WithHTTPClient(client HTTPClient) RequestOption {
return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error {
- r.HTTPClient = client
+ if client == nil {
+ return fmt.Errorf("requestoption: custom http client cannot be nil")
+ }
+
+ if c, ok := client.(*http.Client); ok {
+ // Prefer the native client if possible.
+ r.HTTPClient = c
+ r.CustomHTTPDoer = nil
+ } else {
+ r.CustomHTTPDoer = client
+ }
+
return nil
})
}
@@ -146,17 +169,25 @@ func WithQueryDel(key string) RequestOption {
// [sjson format]: https://github.com/tidwall/sjson
func WithJSONSet(key string, value interface{}) RequestOption {
return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) (err error) {
- if buffer, ok := r.Body.(*bytes.Buffer); ok {
- b := buffer.Bytes()
+ var b []byte
+
+ if r.Body == nil {
+ b, err = sjson.SetBytes(nil, key, value)
+ if err != nil {
+ return err
+ }
+ } else if buffer, ok := r.Body.(*bytes.Buffer); ok {
+ b = buffer.Bytes()
b, err = sjson.SetBytes(b, key, value)
if err != nil {
return err
}
- r.Body = bytes.NewBuffer(b)
- return nil
+ } else {
+ return fmt.Errorf("cannot use WithJSONSet on a body that is not serialized as *bytes.Buffer")
}
- return fmt.Errorf("cannot use WithJSONSet on a body that is not serialized as *bytes.Buffer")
+ r.Body = bytes.NewBuffer(b)
+ return nil
})
}
@@ -231,7 +262,7 @@ func WithRequestTimeout(dur time.Duration) RequestOption {
// environment to be the "production" environment. An environment specifies which base URL
// to use by default.
func WithEnvironmentProduction() RequestOption {
- return WithBaseURL("https://api.openlayer.com/v1/")
+ return requestconfig.WithDefaultBaseURL("https://api.openlayer.com/v1/")
}
// WithAPIKey returns a RequestOption that sets the client setting "api_key".
diff --git a/project.go b/project.go
index 43149c5..3e761e3 100644
--- a/project.go
+++ b/project.go
@@ -25,6 +25,7 @@ type ProjectService struct {
Options []option.RequestOption
Commits *ProjectCommitService
InferencePipelines *ProjectInferencePipelineService
+ Tests *ProjectTestService
}
// NewProjectService generates a new service that applies the given options to each
@@ -35,6 +36,7 @@ func NewProjectService(opts ...option.RequestOption) (r *ProjectService) {
r.Options = opts
r.Commits = NewProjectCommitService(opts...)
r.InferencePipelines = NewProjectInferencePipelineService(opts...)
+ r.Tests = NewProjectTestService(opts...)
return
}
diff --git a/projecttest.go b/projecttest.go
new file mode 100644
index 0000000..661b32b
--- /dev/null
+++ b/projecttest.go
@@ -0,0 +1,1253 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+package openlayer
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "net/http"
+ "net/url"
+ "reflect"
+ "time"
+
+ "github.com/openlayer-ai/openlayer-go/internal/apijson"
+ "github.com/openlayer-ai/openlayer-go/internal/apiquery"
+ "github.com/openlayer-ai/openlayer-go/internal/param"
+ "github.com/openlayer-ai/openlayer-go/internal/requestconfig"
+ "github.com/openlayer-ai/openlayer-go/option"
+ "github.com/openlayer-ai/openlayer-go/shared"
+ "github.com/tidwall/gjson"
+)
+
+// ProjectTestService contains methods and other services that help with
+// interacting with the openlayer API.
+//
+// Note, unlike clients, this service does not read variables from the environment
+// automatically. You should not instantiate this service directly, and instead use
+// the [NewProjectTestService] method instead.
+type ProjectTestService struct {
+ Options []option.RequestOption
+}
+
+// NewProjectTestService generates a new service that applies the given options to
+// each request. These options are applied after the parent client's options (if
+// there is one), and before any request-specific options.
+func NewProjectTestService(opts ...option.RequestOption) (r *ProjectTestService) {
+ r = &ProjectTestService{}
+ r.Options = opts
+ return
+}
+
+// Create a test.
+func (r *ProjectTestService) New(ctx context.Context, projectID string, body ProjectTestNewParams, opts ...option.RequestOption) (res *ProjectTestNewResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ if projectID == "" {
+ err = errors.New("missing required projectId parameter")
+ return
+ }
+ path := fmt.Sprintf("projects/%s/tests", projectID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
+ return
+}
+
+// Update tests.
+func (r *ProjectTestService) Update(ctx context.Context, projectID string, body ProjectTestUpdateParams, opts ...option.RequestOption) (res *ProjectTestUpdateResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ if projectID == "" {
+ err = errors.New("missing required projectId parameter")
+ return
+ }
+ path := fmt.Sprintf("projects/%s/tests", projectID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, body, &res, opts...)
+ return
+}
+
+// List tests under a project.
+func (r *ProjectTestService) List(ctx context.Context, projectID string, query ProjectTestListParams, opts ...option.RequestOption) (res *ProjectTestListResponse, err error) {
+ opts = append(r.Options[:], opts...)
+ if projectID == "" {
+ err = errors.New("missing required projectId parameter")
+ return
+ }
+ path := fmt.Sprintf("projects/%s/tests", projectID)
+ err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
+ return
+}
+
+type ProjectTestNewResponse struct {
+ // The test id.
+ ID string `json:"id,required" format:"uuid"`
+ // The number of comments on the test.
+ CommentCount int64 `json:"commentCount,required"`
+ // The test creator id.
+ CreatorID string `json:"creatorId,required,nullable" format:"uuid"`
+ // The date the test was archived.
+ DateArchived time.Time `json:"dateArchived,required,nullable" format:"date-time"`
+ // The creation date.
+ DateCreated time.Time `json:"dateCreated,required" format:"date-time"`
+ // The last updated date.
+ DateUpdated time.Time `json:"dateUpdated,required" format:"date-time"`
+ // The test description.
+ Description interface{} `json:"description,required,nullable"`
+ // The test name.
+ Name string `json:"name,required"`
+ // The test number.
+ Number int64 `json:"number,required"`
+ // The project version (commit) id where the test was created.
+ OriginProjectVersionID string `json:"originProjectVersionId,required,nullable" format:"uuid"`
+ // The test subtype.
+ Subtype ProjectTestNewResponseSubtype `json:"subtype,required"`
+ // Whether the test is suggested or user-created.
+ Suggested bool `json:"suggested,required"`
+ Thresholds []ProjectTestNewResponseThreshold `json:"thresholds,required"`
+ // The test type.
+ Type ProjectTestNewResponseType `json:"type,required"`
+ // Whether the test is archived.
+ Archived bool `json:"archived"`
+ // The delay window in seconds. Only applies to tests that use production data.
+ DelayWindow float64 `json:"delayWindow,nullable"`
+ // The evaluation window in seconds. Only applies to tests that use production
+ // data.
+ EvaluationWindow float64 `json:"evaluationWindow,nullable"`
+ // Whether the test uses an ML model.
+ UsesMlModel bool `json:"usesMlModel"`
+ // Whether the test uses production data (monitoring mode only).
+ UsesProductionData bool `json:"usesProductionData"`
+ // Whether the test uses a reference dataset (monitoring mode only).
+ UsesReferenceDataset bool `json:"usesReferenceDataset"`
+ // Whether the test uses a training dataset.
+ UsesTrainingDataset bool `json:"usesTrainingDataset"`
+ // Whether the test uses a validation dataset.
+ UsesValidationDataset bool `json:"usesValidationDataset"`
+ JSON projectTestNewResponseJSON `json:"-"`
+}
+
+// projectTestNewResponseJSON contains the JSON metadata for the struct
+// [ProjectTestNewResponse]
+type projectTestNewResponseJSON struct {
+ ID apijson.Field
+ CommentCount apijson.Field
+ CreatorID apijson.Field
+ DateArchived apijson.Field
+ DateCreated apijson.Field
+ DateUpdated apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ Number apijson.Field
+ OriginProjectVersionID apijson.Field
+ Subtype apijson.Field
+ Suggested apijson.Field
+ Thresholds apijson.Field
+ Type apijson.Field
+ Archived apijson.Field
+ DelayWindow apijson.Field
+ EvaluationWindow apijson.Field
+ UsesMlModel apijson.Field
+ UsesProductionData apijson.Field
+ UsesReferenceDataset apijson.Field
+ UsesTrainingDataset apijson.Field
+ UsesValidationDataset apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestNewResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestNewResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+// The test subtype.
+type ProjectTestNewResponseSubtype string
+
+const (
+ ProjectTestNewResponseSubtypeAnomalousColumnCount ProjectTestNewResponseSubtype = "anomalousColumnCount"
+ ProjectTestNewResponseSubtypeCharacterLength ProjectTestNewResponseSubtype = "characterLength"
+ ProjectTestNewResponseSubtypeClassImbalanceRatio ProjectTestNewResponseSubtype = "classImbalanceRatio"
+ ProjectTestNewResponseSubtypeExpectColumnAToBeInColumnB ProjectTestNewResponseSubtype = "expectColumnAToBeInColumnB"
+ ProjectTestNewResponseSubtypeColumnAverage ProjectTestNewResponseSubtype = "columnAverage"
+ ProjectTestNewResponseSubtypeColumnDrift ProjectTestNewResponseSubtype = "columnDrift"
+ ProjectTestNewResponseSubtypeColumnStatistic ProjectTestNewResponseSubtype = "columnStatistic"
+ ProjectTestNewResponseSubtypeColumnValuesMatch ProjectTestNewResponseSubtype = "columnValuesMatch"
+ ProjectTestNewResponseSubtypeConflictingLabelRowCount ProjectTestNewResponseSubtype = "conflictingLabelRowCount"
+ ProjectTestNewResponseSubtypeContainsPii ProjectTestNewResponseSubtype = "containsPii"
+ ProjectTestNewResponseSubtypeContainsValidURL ProjectTestNewResponseSubtype = "containsValidUrl"
+ ProjectTestNewResponseSubtypeCorrelatedFeatureCount ProjectTestNewResponseSubtype = "correlatedFeatureCount"
+ ProjectTestNewResponseSubtypeCustomMetricThreshold ProjectTestNewResponseSubtype = "customMetricThreshold"
+ ProjectTestNewResponseSubtypeDuplicateRowCount ProjectTestNewResponseSubtype = "duplicateRowCount"
+ ProjectTestNewResponseSubtypeEmptyFeature ProjectTestNewResponseSubtype = "emptyFeature"
+ ProjectTestNewResponseSubtypeEmptyFeatureCount ProjectTestNewResponseSubtype = "emptyFeatureCount"
+ ProjectTestNewResponseSubtypeDriftedFeatureCount ProjectTestNewResponseSubtype = "driftedFeatureCount"
+ ProjectTestNewResponseSubtypeFeatureMissingValues ProjectTestNewResponseSubtype = "featureMissingValues"
+ ProjectTestNewResponseSubtypeFeatureValueValidation ProjectTestNewResponseSubtype = "featureValueValidation"
+ ProjectTestNewResponseSubtypeGreatExpectations ProjectTestNewResponseSubtype = "greatExpectations"
+ ProjectTestNewResponseSubtypeGroupByColumnStatsCheck ProjectTestNewResponseSubtype = "groupByColumnStatsCheck"
+ ProjectTestNewResponseSubtypeIllFormedRowCount ProjectTestNewResponseSubtype = "illFormedRowCount"
+ ProjectTestNewResponseSubtypeIsCode ProjectTestNewResponseSubtype = "isCode"
+ ProjectTestNewResponseSubtypeIsJson ProjectTestNewResponseSubtype = "isJson"
+ ProjectTestNewResponseSubtypeLlmRubricThresholdV2 ProjectTestNewResponseSubtype = "llmRubricThresholdV2"
+ ProjectTestNewResponseSubtypeLabelDrift ProjectTestNewResponseSubtype = "labelDrift"
+ ProjectTestNewResponseSubtypeMetricThreshold ProjectTestNewResponseSubtype = "metricThreshold"
+ ProjectTestNewResponseSubtypeNewCategoryCount ProjectTestNewResponseSubtype = "newCategoryCount"
+ ProjectTestNewResponseSubtypeNewLabelCount ProjectTestNewResponseSubtype = "newLabelCount"
+ ProjectTestNewResponseSubtypeNullRowCount ProjectTestNewResponseSubtype = "nullRowCount"
+ ProjectTestNewResponseSubtypeRowCount ProjectTestNewResponseSubtype = "rowCount"
+ ProjectTestNewResponseSubtypePpScoreValueValidation ProjectTestNewResponseSubtype = "ppScoreValueValidation"
+ ProjectTestNewResponseSubtypeQuasiConstantFeature ProjectTestNewResponseSubtype = "quasiConstantFeature"
+ ProjectTestNewResponseSubtypeQuasiConstantFeatureCount ProjectTestNewResponseSubtype = "quasiConstantFeatureCount"
+ ProjectTestNewResponseSubtypeSqlQuery ProjectTestNewResponseSubtype = "sqlQuery"
+ ProjectTestNewResponseSubtypeDtypeValidation ProjectTestNewResponseSubtype = "dtypeValidation"
+ ProjectTestNewResponseSubtypeSentenceLength ProjectTestNewResponseSubtype = "sentenceLength"
+ ProjectTestNewResponseSubtypeSizeRatio ProjectTestNewResponseSubtype = "sizeRatio"
+ ProjectTestNewResponseSubtypeSpecialCharactersRatio ProjectTestNewResponseSubtype = "specialCharactersRatio"
+ ProjectTestNewResponseSubtypeStringValidation ProjectTestNewResponseSubtype = "stringValidation"
+ ProjectTestNewResponseSubtypeTrainValLeakageRowCount ProjectTestNewResponseSubtype = "trainValLeakageRowCount"
+)
+
+func (r ProjectTestNewResponseSubtype) IsKnown() bool {
+ switch r {
+ case ProjectTestNewResponseSubtypeAnomalousColumnCount, ProjectTestNewResponseSubtypeCharacterLength, ProjectTestNewResponseSubtypeClassImbalanceRatio, ProjectTestNewResponseSubtypeExpectColumnAToBeInColumnB, ProjectTestNewResponseSubtypeColumnAverage, ProjectTestNewResponseSubtypeColumnDrift, ProjectTestNewResponseSubtypeColumnStatistic, ProjectTestNewResponseSubtypeColumnValuesMatch, ProjectTestNewResponseSubtypeConflictingLabelRowCount, ProjectTestNewResponseSubtypeContainsPii, ProjectTestNewResponseSubtypeContainsValidURL, ProjectTestNewResponseSubtypeCorrelatedFeatureCount, ProjectTestNewResponseSubtypeCustomMetricThreshold, ProjectTestNewResponseSubtypeDuplicateRowCount, ProjectTestNewResponseSubtypeEmptyFeature, ProjectTestNewResponseSubtypeEmptyFeatureCount, ProjectTestNewResponseSubtypeDriftedFeatureCount, ProjectTestNewResponseSubtypeFeatureMissingValues, ProjectTestNewResponseSubtypeFeatureValueValidation, ProjectTestNewResponseSubtypeGreatExpectations, ProjectTestNewResponseSubtypeGroupByColumnStatsCheck, ProjectTestNewResponseSubtypeIllFormedRowCount, ProjectTestNewResponseSubtypeIsCode, ProjectTestNewResponseSubtypeIsJson, ProjectTestNewResponseSubtypeLlmRubricThresholdV2, ProjectTestNewResponseSubtypeLabelDrift, ProjectTestNewResponseSubtypeMetricThreshold, ProjectTestNewResponseSubtypeNewCategoryCount, ProjectTestNewResponseSubtypeNewLabelCount, ProjectTestNewResponseSubtypeNullRowCount, ProjectTestNewResponseSubtypeRowCount, ProjectTestNewResponseSubtypePpScoreValueValidation, ProjectTestNewResponseSubtypeQuasiConstantFeature, ProjectTestNewResponseSubtypeQuasiConstantFeatureCount, ProjectTestNewResponseSubtypeSqlQuery, ProjectTestNewResponseSubtypeDtypeValidation, ProjectTestNewResponseSubtypeSentenceLength, ProjectTestNewResponseSubtypeSizeRatio, ProjectTestNewResponseSubtypeSpecialCharactersRatio, ProjectTestNewResponseSubtypeStringValidation, ProjectTestNewResponseSubtypeTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type ProjectTestNewResponseThreshold struct {
+ // The insight name to be evaluated.
+ InsightName ProjectTestNewResponseThresholdsInsightName `json:"insightName"`
+ // The insight parameters. Required only for some test subtypes. For example, for
+ // tests that require a column name, the insight parameters will be [{'name':
+ // 'column_name', 'value': 'Age'}]
+ InsightParameters []ProjectTestNewResponseThresholdsInsightParameter `json:"insightParameters,nullable"`
+ // The measurement to be evaluated.
+ Measurement string `json:"measurement"`
+ // The operator to be used for the evaluation.
+ Operator ProjectTestNewResponseThresholdsOperator `json:"operator"`
+ // Whether to use automatic anomaly detection or manual thresholds
+ ThresholdMode ProjectTestNewResponseThresholdsThresholdMode `json:"thresholdMode"`
+ // The value to be compared.
+ Value ProjectTestNewResponseThresholdsValueUnion `json:"value"`
+ JSON projectTestNewResponseThresholdJSON `json:"-"`
+}
+
+// projectTestNewResponseThresholdJSON contains the JSON metadata for the struct
+// [ProjectTestNewResponseThreshold]
+type projectTestNewResponseThresholdJSON struct {
+ InsightName apijson.Field
+ InsightParameters apijson.Field
+ Measurement apijson.Field
+ Operator apijson.Field
+ ThresholdMode apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestNewResponseThreshold) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestNewResponseThresholdJSON) RawJSON() string {
+ return r.raw
+}
+
+// The insight name to be evaluated.
+type ProjectTestNewResponseThresholdsInsightName string
+
+const (
+ ProjectTestNewResponseThresholdsInsightNameCharacterLength ProjectTestNewResponseThresholdsInsightName = "characterLength"
+ ProjectTestNewResponseThresholdsInsightNameClassImbalance ProjectTestNewResponseThresholdsInsightName = "classImbalance"
+ ProjectTestNewResponseThresholdsInsightNameExpectColumnAToBeInColumnB ProjectTestNewResponseThresholdsInsightName = "expectColumnAToBeInColumnB"
+ ProjectTestNewResponseThresholdsInsightNameColumnAverage ProjectTestNewResponseThresholdsInsightName = "columnAverage"
+ ProjectTestNewResponseThresholdsInsightNameColumnDrift ProjectTestNewResponseThresholdsInsightName = "columnDrift"
+ ProjectTestNewResponseThresholdsInsightNameColumnValuesMatch ProjectTestNewResponseThresholdsInsightName = "columnValuesMatch"
+ ProjectTestNewResponseThresholdsInsightNameConfidenceDistribution ProjectTestNewResponseThresholdsInsightName = "confidenceDistribution"
+ ProjectTestNewResponseThresholdsInsightNameConflictingLabelRowCount ProjectTestNewResponseThresholdsInsightName = "conflictingLabelRowCount"
+ ProjectTestNewResponseThresholdsInsightNameContainsPii ProjectTestNewResponseThresholdsInsightName = "containsPii"
+ ProjectTestNewResponseThresholdsInsightNameContainsValidURL ProjectTestNewResponseThresholdsInsightName = "containsValidUrl"
+ ProjectTestNewResponseThresholdsInsightNameCorrelatedFeatures ProjectTestNewResponseThresholdsInsightName = "correlatedFeatures"
+ ProjectTestNewResponseThresholdsInsightNameCustomMetric ProjectTestNewResponseThresholdsInsightName = "customMetric"
+ ProjectTestNewResponseThresholdsInsightNameDuplicateRowCount ProjectTestNewResponseThresholdsInsightName = "duplicateRowCount"
+ ProjectTestNewResponseThresholdsInsightNameEmptyFeatures ProjectTestNewResponseThresholdsInsightName = "emptyFeatures"
+ ProjectTestNewResponseThresholdsInsightNameFeatureDrift ProjectTestNewResponseThresholdsInsightName = "featureDrift"
+ ProjectTestNewResponseThresholdsInsightNameFeatureProfile ProjectTestNewResponseThresholdsInsightName = "featureProfile"
+ ProjectTestNewResponseThresholdsInsightNameGreatExpectations ProjectTestNewResponseThresholdsInsightName = "greatExpectations"
+ ProjectTestNewResponseThresholdsInsightNameGroupByColumnStatsCheck ProjectTestNewResponseThresholdsInsightName = "groupByColumnStatsCheck"
+ ProjectTestNewResponseThresholdsInsightNameIllFormedRowCount ProjectTestNewResponseThresholdsInsightName = "illFormedRowCount"
+ ProjectTestNewResponseThresholdsInsightNameIsCode ProjectTestNewResponseThresholdsInsightName = "isCode"
+ ProjectTestNewResponseThresholdsInsightNameIsJson ProjectTestNewResponseThresholdsInsightName = "isJson"
+ ProjectTestNewResponseThresholdsInsightNameLlmRubricV2 ProjectTestNewResponseThresholdsInsightName = "llmRubricV2"
+ ProjectTestNewResponseThresholdsInsightNameLabelDrift ProjectTestNewResponseThresholdsInsightName = "labelDrift"
+ ProjectTestNewResponseThresholdsInsightNameMetrics ProjectTestNewResponseThresholdsInsightName = "metrics"
+ ProjectTestNewResponseThresholdsInsightNameNewCategories ProjectTestNewResponseThresholdsInsightName = "newCategories"
+ ProjectTestNewResponseThresholdsInsightNameNewLabels ProjectTestNewResponseThresholdsInsightName = "newLabels"
+ ProjectTestNewResponseThresholdsInsightNameNullRowCount ProjectTestNewResponseThresholdsInsightName = "nullRowCount"
+ ProjectTestNewResponseThresholdsInsightNamePpScore ProjectTestNewResponseThresholdsInsightName = "ppScore"
+ ProjectTestNewResponseThresholdsInsightNameQuasiConstantFeatures ProjectTestNewResponseThresholdsInsightName = "quasiConstantFeatures"
+ ProjectTestNewResponseThresholdsInsightNameSentenceLength ProjectTestNewResponseThresholdsInsightName = "sentenceLength"
+ ProjectTestNewResponseThresholdsInsightNameSizeRatio ProjectTestNewResponseThresholdsInsightName = "sizeRatio"
+ ProjectTestNewResponseThresholdsInsightNameSpecialCharacters ProjectTestNewResponseThresholdsInsightName = "specialCharacters"
+ ProjectTestNewResponseThresholdsInsightNameStringValidation ProjectTestNewResponseThresholdsInsightName = "stringValidation"
+ ProjectTestNewResponseThresholdsInsightNameTrainValLeakageRowCount ProjectTestNewResponseThresholdsInsightName = "trainValLeakageRowCount"
+)
+
+func (r ProjectTestNewResponseThresholdsInsightName) IsKnown() bool {
+ switch r {
+ case ProjectTestNewResponseThresholdsInsightNameCharacterLength, ProjectTestNewResponseThresholdsInsightNameClassImbalance, ProjectTestNewResponseThresholdsInsightNameExpectColumnAToBeInColumnB, ProjectTestNewResponseThresholdsInsightNameColumnAverage, ProjectTestNewResponseThresholdsInsightNameColumnDrift, ProjectTestNewResponseThresholdsInsightNameColumnValuesMatch, ProjectTestNewResponseThresholdsInsightNameConfidenceDistribution, ProjectTestNewResponseThresholdsInsightNameConflictingLabelRowCount, ProjectTestNewResponseThresholdsInsightNameContainsPii, ProjectTestNewResponseThresholdsInsightNameContainsValidURL, ProjectTestNewResponseThresholdsInsightNameCorrelatedFeatures, ProjectTestNewResponseThresholdsInsightNameCustomMetric, ProjectTestNewResponseThresholdsInsightNameDuplicateRowCount, ProjectTestNewResponseThresholdsInsightNameEmptyFeatures, ProjectTestNewResponseThresholdsInsightNameFeatureDrift, ProjectTestNewResponseThresholdsInsightNameFeatureProfile, ProjectTestNewResponseThresholdsInsightNameGreatExpectations, ProjectTestNewResponseThresholdsInsightNameGroupByColumnStatsCheck, ProjectTestNewResponseThresholdsInsightNameIllFormedRowCount, ProjectTestNewResponseThresholdsInsightNameIsCode, ProjectTestNewResponseThresholdsInsightNameIsJson, ProjectTestNewResponseThresholdsInsightNameLlmRubricV2, ProjectTestNewResponseThresholdsInsightNameLabelDrift, ProjectTestNewResponseThresholdsInsightNameMetrics, ProjectTestNewResponseThresholdsInsightNameNewCategories, ProjectTestNewResponseThresholdsInsightNameNewLabels, ProjectTestNewResponseThresholdsInsightNameNullRowCount, ProjectTestNewResponseThresholdsInsightNamePpScore, ProjectTestNewResponseThresholdsInsightNameQuasiConstantFeatures, ProjectTestNewResponseThresholdsInsightNameSentenceLength, ProjectTestNewResponseThresholdsInsightNameSizeRatio, ProjectTestNewResponseThresholdsInsightNameSpecialCharacters, ProjectTestNewResponseThresholdsInsightNameStringValidation, ProjectTestNewResponseThresholdsInsightNameTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type ProjectTestNewResponseThresholdsInsightParameter struct {
+ // The name of the insight filter.
+ Name string `json:"name,required"`
+ Value interface{} `json:"value,required"`
+ JSON projectTestNewResponseThresholdsInsightParameterJSON `json:"-"`
+}
+
+// projectTestNewResponseThresholdsInsightParameterJSON contains the JSON metadata
+// for the struct [ProjectTestNewResponseThresholdsInsightParameter]
+type projectTestNewResponseThresholdsInsightParameterJSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestNewResponseThresholdsInsightParameter) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestNewResponseThresholdsInsightParameterJSON) RawJSON() string {
+ return r.raw
+}
+
+// The operator to be used for the evaluation.
+type ProjectTestNewResponseThresholdsOperator string
+
+const (
+ ProjectTestNewResponseThresholdsOperatorIs ProjectTestNewResponseThresholdsOperator = "is"
+ ProjectTestNewResponseThresholdsOperatorGreater ProjectTestNewResponseThresholdsOperator = ">"
+ ProjectTestNewResponseThresholdsOperatorGreaterOrEquals ProjectTestNewResponseThresholdsOperator = ">="
+ ProjectTestNewResponseThresholdsOperatorLess ProjectTestNewResponseThresholdsOperator = "<"
+ ProjectTestNewResponseThresholdsOperatorLessOrEquals ProjectTestNewResponseThresholdsOperator = "<="
+ ProjectTestNewResponseThresholdsOperatorNotEquals ProjectTestNewResponseThresholdsOperator = "!="
+)
+
+func (r ProjectTestNewResponseThresholdsOperator) IsKnown() bool {
+ switch r {
+ case ProjectTestNewResponseThresholdsOperatorIs, ProjectTestNewResponseThresholdsOperatorGreater, ProjectTestNewResponseThresholdsOperatorGreaterOrEquals, ProjectTestNewResponseThresholdsOperatorLess, ProjectTestNewResponseThresholdsOperatorLessOrEquals, ProjectTestNewResponseThresholdsOperatorNotEquals:
+ return true
+ }
+ return false
+}
+
+// Whether to use automatic anomaly detection or manual thresholds
+type ProjectTestNewResponseThresholdsThresholdMode string
+
+const (
+ ProjectTestNewResponseThresholdsThresholdModeAutomatic ProjectTestNewResponseThresholdsThresholdMode = "automatic"
+ ProjectTestNewResponseThresholdsThresholdModeManual ProjectTestNewResponseThresholdsThresholdMode = "manual"
+)
+
+func (r ProjectTestNewResponseThresholdsThresholdMode) IsKnown() bool {
+ switch r {
+ case ProjectTestNewResponseThresholdsThresholdModeAutomatic, ProjectTestNewResponseThresholdsThresholdModeManual:
+ return true
+ }
+ return false
+}
+
+// The value to be compared.
+//
+// Union satisfied by [shared.UnionFloat], [shared.UnionBool], [shared.UnionString]
+// or [ProjectTestNewResponseThresholdsValueArray].
+type ProjectTestNewResponseThresholdsValueUnion interface {
+ ImplementsProjectTestNewResponseThresholdsValueUnion()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectTestNewResponseThresholdsValueUnion)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.True,
+ Type: reflect.TypeOf(shared.UnionBool(false)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.False,
+ Type: reflect.TypeOf(shared.UnionBool(false)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectTestNewResponseThresholdsValueArray{}),
+ },
+ )
+}
+
+type ProjectTestNewResponseThresholdsValueArray []string
+
+func (r ProjectTestNewResponseThresholdsValueArray) ImplementsProjectTestNewResponseThresholdsValueUnion() {
+}
+
+// The test type.
+type ProjectTestNewResponseType string
+
+const (
+ ProjectTestNewResponseTypeIntegrity ProjectTestNewResponseType = "integrity"
+ ProjectTestNewResponseTypeConsistency ProjectTestNewResponseType = "consistency"
+ ProjectTestNewResponseTypePerformance ProjectTestNewResponseType = "performance"
+)
+
+func (r ProjectTestNewResponseType) IsKnown() bool {
+ switch r {
+ case ProjectTestNewResponseTypeIntegrity, ProjectTestNewResponseTypeConsistency, ProjectTestNewResponseTypePerformance:
+ return true
+ }
+ return false
+}
+
+type ProjectTestUpdateResponse struct {
+ TaskResultID string `json:"taskResultId"`
+ TaskResultURL string `json:"taskResultUrl"`
+ JSON projectTestUpdateResponseJSON `json:"-"`
+}
+
+// projectTestUpdateResponseJSON contains the JSON metadata for the struct
+// [ProjectTestUpdateResponse]
+type projectTestUpdateResponseJSON struct {
+ TaskResultID apijson.Field
+ TaskResultURL apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestUpdateResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestUpdateResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectTestListResponse struct {
+ Items []ProjectTestListResponseItem `json:"items,required"`
+ JSON projectTestListResponseJSON `json:"-"`
+}
+
+// projectTestListResponseJSON contains the JSON metadata for the struct
+// [ProjectTestListResponse]
+type projectTestListResponseJSON struct {
+ Items apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestListResponse) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestListResponseJSON) RawJSON() string {
+ return r.raw
+}
+
+type ProjectTestListResponseItem struct {
+ // The test id.
+ ID string `json:"id,required" format:"uuid"`
+ // The number of comments on the test.
+ CommentCount int64 `json:"commentCount,required"`
+ // The test creator id.
+ CreatorID string `json:"creatorId,required,nullable" format:"uuid"`
+ // The date the test was archived.
+ DateArchived time.Time `json:"dateArchived,required,nullable" format:"date-time"`
+ // The creation date.
+ DateCreated time.Time `json:"dateCreated,required" format:"date-time"`
+ // The last updated date.
+ DateUpdated time.Time `json:"dateUpdated,required" format:"date-time"`
+ // The test description.
+ Description interface{} `json:"description,required,nullable"`
+ // The test name.
+ Name string `json:"name,required"`
+ // The test number.
+ Number int64 `json:"number,required"`
+ // The project version (commit) id where the test was created.
+ OriginProjectVersionID string `json:"originProjectVersionId,required,nullable" format:"uuid"`
+ // The test subtype.
+ Subtype ProjectTestListResponseItemsSubtype `json:"subtype,required"`
+ // Whether the test is suggested or user-created.
+ Suggested bool `json:"suggested,required"`
+ Thresholds []ProjectTestListResponseItemsThreshold `json:"thresholds,required"`
+ // The test type.
+ Type ProjectTestListResponseItemsType `json:"type,required"`
+ // Whether the test is archived.
+ Archived bool `json:"archived"`
+ // The delay window in seconds. Only applies to tests that use production data.
+ DelayWindow float64 `json:"delayWindow,nullable"`
+ // The evaluation window in seconds. Only applies to tests that use production
+ // data.
+ EvaluationWindow float64 `json:"evaluationWindow,nullable"`
+ // Whether the test uses an ML model.
+ UsesMlModel bool `json:"usesMlModel"`
+ // Whether the test uses production data (monitoring mode only).
+ UsesProductionData bool `json:"usesProductionData"`
+ // Whether the test uses a reference dataset (monitoring mode only).
+ UsesReferenceDataset bool `json:"usesReferenceDataset"`
+ // Whether the test uses a training dataset.
+ UsesTrainingDataset bool `json:"usesTrainingDataset"`
+ // Whether the test uses a validation dataset.
+ UsesValidationDataset bool `json:"usesValidationDataset"`
+ JSON projectTestListResponseItemJSON `json:"-"`
+}
+
+// projectTestListResponseItemJSON contains the JSON metadata for the struct
+// [ProjectTestListResponseItem]
+type projectTestListResponseItemJSON struct {
+ ID apijson.Field
+ CommentCount apijson.Field
+ CreatorID apijson.Field
+ DateArchived apijson.Field
+ DateCreated apijson.Field
+ DateUpdated apijson.Field
+ Description apijson.Field
+ Name apijson.Field
+ Number apijson.Field
+ OriginProjectVersionID apijson.Field
+ Subtype apijson.Field
+ Suggested apijson.Field
+ Thresholds apijson.Field
+ Type apijson.Field
+ Archived apijson.Field
+ DelayWindow apijson.Field
+ EvaluationWindow apijson.Field
+ UsesMlModel apijson.Field
+ UsesProductionData apijson.Field
+ UsesReferenceDataset apijson.Field
+ UsesTrainingDataset apijson.Field
+ UsesValidationDataset apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestListResponseItem) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestListResponseItemJSON) RawJSON() string {
+ return r.raw
+}
+
+// The test subtype.
+type ProjectTestListResponseItemsSubtype string
+
+const (
+ ProjectTestListResponseItemsSubtypeAnomalousColumnCount ProjectTestListResponseItemsSubtype = "anomalousColumnCount"
+ ProjectTestListResponseItemsSubtypeCharacterLength ProjectTestListResponseItemsSubtype = "characterLength"
+ ProjectTestListResponseItemsSubtypeClassImbalanceRatio ProjectTestListResponseItemsSubtype = "classImbalanceRatio"
+ ProjectTestListResponseItemsSubtypeExpectColumnAToBeInColumnB ProjectTestListResponseItemsSubtype = "expectColumnAToBeInColumnB"
+ ProjectTestListResponseItemsSubtypeColumnAverage ProjectTestListResponseItemsSubtype = "columnAverage"
+ ProjectTestListResponseItemsSubtypeColumnDrift ProjectTestListResponseItemsSubtype = "columnDrift"
+ ProjectTestListResponseItemsSubtypeColumnStatistic ProjectTestListResponseItemsSubtype = "columnStatistic"
+ ProjectTestListResponseItemsSubtypeColumnValuesMatch ProjectTestListResponseItemsSubtype = "columnValuesMatch"
+ ProjectTestListResponseItemsSubtypeConflictingLabelRowCount ProjectTestListResponseItemsSubtype = "conflictingLabelRowCount"
+ ProjectTestListResponseItemsSubtypeContainsPii ProjectTestListResponseItemsSubtype = "containsPii"
+ ProjectTestListResponseItemsSubtypeContainsValidURL ProjectTestListResponseItemsSubtype = "containsValidUrl"
+ ProjectTestListResponseItemsSubtypeCorrelatedFeatureCount ProjectTestListResponseItemsSubtype = "correlatedFeatureCount"
+ ProjectTestListResponseItemsSubtypeCustomMetricThreshold ProjectTestListResponseItemsSubtype = "customMetricThreshold"
+ ProjectTestListResponseItemsSubtypeDuplicateRowCount ProjectTestListResponseItemsSubtype = "duplicateRowCount"
+ ProjectTestListResponseItemsSubtypeEmptyFeature ProjectTestListResponseItemsSubtype = "emptyFeature"
+ ProjectTestListResponseItemsSubtypeEmptyFeatureCount ProjectTestListResponseItemsSubtype = "emptyFeatureCount"
+ ProjectTestListResponseItemsSubtypeDriftedFeatureCount ProjectTestListResponseItemsSubtype = "driftedFeatureCount"
+ ProjectTestListResponseItemsSubtypeFeatureMissingValues ProjectTestListResponseItemsSubtype = "featureMissingValues"
+ ProjectTestListResponseItemsSubtypeFeatureValueValidation ProjectTestListResponseItemsSubtype = "featureValueValidation"
+ ProjectTestListResponseItemsSubtypeGreatExpectations ProjectTestListResponseItemsSubtype = "greatExpectations"
+ ProjectTestListResponseItemsSubtypeGroupByColumnStatsCheck ProjectTestListResponseItemsSubtype = "groupByColumnStatsCheck"
+ ProjectTestListResponseItemsSubtypeIllFormedRowCount ProjectTestListResponseItemsSubtype = "illFormedRowCount"
+ ProjectTestListResponseItemsSubtypeIsCode ProjectTestListResponseItemsSubtype = "isCode"
+ ProjectTestListResponseItemsSubtypeIsJson ProjectTestListResponseItemsSubtype = "isJson"
+ ProjectTestListResponseItemsSubtypeLlmRubricThresholdV2 ProjectTestListResponseItemsSubtype = "llmRubricThresholdV2"
+ ProjectTestListResponseItemsSubtypeLabelDrift ProjectTestListResponseItemsSubtype = "labelDrift"
+ ProjectTestListResponseItemsSubtypeMetricThreshold ProjectTestListResponseItemsSubtype = "metricThreshold"
+ ProjectTestListResponseItemsSubtypeNewCategoryCount ProjectTestListResponseItemsSubtype = "newCategoryCount"
+ ProjectTestListResponseItemsSubtypeNewLabelCount ProjectTestListResponseItemsSubtype = "newLabelCount"
+ ProjectTestListResponseItemsSubtypeNullRowCount ProjectTestListResponseItemsSubtype = "nullRowCount"
+ ProjectTestListResponseItemsSubtypeRowCount ProjectTestListResponseItemsSubtype = "rowCount"
+ ProjectTestListResponseItemsSubtypePpScoreValueValidation ProjectTestListResponseItemsSubtype = "ppScoreValueValidation"
+ ProjectTestListResponseItemsSubtypeQuasiConstantFeature ProjectTestListResponseItemsSubtype = "quasiConstantFeature"
+ ProjectTestListResponseItemsSubtypeQuasiConstantFeatureCount ProjectTestListResponseItemsSubtype = "quasiConstantFeatureCount"
+ ProjectTestListResponseItemsSubtypeSqlQuery ProjectTestListResponseItemsSubtype = "sqlQuery"
+ ProjectTestListResponseItemsSubtypeDtypeValidation ProjectTestListResponseItemsSubtype = "dtypeValidation"
+ ProjectTestListResponseItemsSubtypeSentenceLength ProjectTestListResponseItemsSubtype = "sentenceLength"
+ ProjectTestListResponseItemsSubtypeSizeRatio ProjectTestListResponseItemsSubtype = "sizeRatio"
+ ProjectTestListResponseItemsSubtypeSpecialCharactersRatio ProjectTestListResponseItemsSubtype = "specialCharactersRatio"
+ ProjectTestListResponseItemsSubtypeStringValidation ProjectTestListResponseItemsSubtype = "stringValidation"
+ ProjectTestListResponseItemsSubtypeTrainValLeakageRowCount ProjectTestListResponseItemsSubtype = "trainValLeakageRowCount"
+)
+
+func (r ProjectTestListResponseItemsSubtype) IsKnown() bool {
+ switch r {
+ case ProjectTestListResponseItemsSubtypeAnomalousColumnCount, ProjectTestListResponseItemsSubtypeCharacterLength, ProjectTestListResponseItemsSubtypeClassImbalanceRatio, ProjectTestListResponseItemsSubtypeExpectColumnAToBeInColumnB, ProjectTestListResponseItemsSubtypeColumnAverage, ProjectTestListResponseItemsSubtypeColumnDrift, ProjectTestListResponseItemsSubtypeColumnStatistic, ProjectTestListResponseItemsSubtypeColumnValuesMatch, ProjectTestListResponseItemsSubtypeConflictingLabelRowCount, ProjectTestListResponseItemsSubtypeContainsPii, ProjectTestListResponseItemsSubtypeContainsValidURL, ProjectTestListResponseItemsSubtypeCorrelatedFeatureCount, ProjectTestListResponseItemsSubtypeCustomMetricThreshold, ProjectTestListResponseItemsSubtypeDuplicateRowCount, ProjectTestListResponseItemsSubtypeEmptyFeature, ProjectTestListResponseItemsSubtypeEmptyFeatureCount, ProjectTestListResponseItemsSubtypeDriftedFeatureCount, ProjectTestListResponseItemsSubtypeFeatureMissingValues, ProjectTestListResponseItemsSubtypeFeatureValueValidation, ProjectTestListResponseItemsSubtypeGreatExpectations, ProjectTestListResponseItemsSubtypeGroupByColumnStatsCheck, ProjectTestListResponseItemsSubtypeIllFormedRowCount, ProjectTestListResponseItemsSubtypeIsCode, ProjectTestListResponseItemsSubtypeIsJson, ProjectTestListResponseItemsSubtypeLlmRubricThresholdV2, ProjectTestListResponseItemsSubtypeLabelDrift, ProjectTestListResponseItemsSubtypeMetricThreshold, ProjectTestListResponseItemsSubtypeNewCategoryCount, ProjectTestListResponseItemsSubtypeNewLabelCount, ProjectTestListResponseItemsSubtypeNullRowCount, ProjectTestListResponseItemsSubtypeRowCount, ProjectTestListResponseItemsSubtypePpScoreValueValidation, ProjectTestListResponseItemsSubtypeQuasiConstantFeature, ProjectTestListResponseItemsSubtypeQuasiConstantFeatureCount, ProjectTestListResponseItemsSubtypeSqlQuery, ProjectTestListResponseItemsSubtypeDtypeValidation, ProjectTestListResponseItemsSubtypeSentenceLength, ProjectTestListResponseItemsSubtypeSizeRatio, ProjectTestListResponseItemsSubtypeSpecialCharactersRatio, ProjectTestListResponseItemsSubtypeStringValidation, ProjectTestListResponseItemsSubtypeTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type ProjectTestListResponseItemsThreshold struct {
+ // The insight name to be evaluated.
+ InsightName ProjectTestListResponseItemsThresholdsInsightName `json:"insightName"`
+ // The insight parameters. Required only for some test subtypes. For example, for
+ // tests that require a column name, the insight parameters will be [{'name':
+ // 'column_name', 'value': 'Age'}]
+ InsightParameters []ProjectTestListResponseItemsThresholdsInsightParameter `json:"insightParameters,nullable"`
+ // The measurement to be evaluated.
+ Measurement string `json:"measurement"`
+ // The operator to be used for the evaluation.
+ Operator ProjectTestListResponseItemsThresholdsOperator `json:"operator"`
+ // Whether to use automatic anomaly detection or manual thresholds
+ ThresholdMode ProjectTestListResponseItemsThresholdsThresholdMode `json:"thresholdMode"`
+ // The value to be compared.
+ Value ProjectTestListResponseItemsThresholdsValueUnion `json:"value"`
+ JSON projectTestListResponseItemsThresholdJSON `json:"-"`
+}
+
+// projectTestListResponseItemsThresholdJSON contains the JSON metadata for the
+// struct [ProjectTestListResponseItemsThreshold]
+type projectTestListResponseItemsThresholdJSON struct {
+ InsightName apijson.Field
+ InsightParameters apijson.Field
+ Measurement apijson.Field
+ Operator apijson.Field
+ ThresholdMode apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestListResponseItemsThreshold) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestListResponseItemsThresholdJSON) RawJSON() string {
+ return r.raw
+}
+
+// The insight name to be evaluated.
+type ProjectTestListResponseItemsThresholdsInsightName string
+
+const (
+ ProjectTestListResponseItemsThresholdsInsightNameCharacterLength ProjectTestListResponseItemsThresholdsInsightName = "characterLength"
+ ProjectTestListResponseItemsThresholdsInsightNameClassImbalance ProjectTestListResponseItemsThresholdsInsightName = "classImbalance"
+ ProjectTestListResponseItemsThresholdsInsightNameExpectColumnAToBeInColumnB ProjectTestListResponseItemsThresholdsInsightName = "expectColumnAToBeInColumnB"
+ ProjectTestListResponseItemsThresholdsInsightNameColumnAverage ProjectTestListResponseItemsThresholdsInsightName = "columnAverage"
+ ProjectTestListResponseItemsThresholdsInsightNameColumnDrift ProjectTestListResponseItemsThresholdsInsightName = "columnDrift"
+ ProjectTestListResponseItemsThresholdsInsightNameColumnValuesMatch ProjectTestListResponseItemsThresholdsInsightName = "columnValuesMatch"
+ ProjectTestListResponseItemsThresholdsInsightNameConfidenceDistribution ProjectTestListResponseItemsThresholdsInsightName = "confidenceDistribution"
+ ProjectTestListResponseItemsThresholdsInsightNameConflictingLabelRowCount ProjectTestListResponseItemsThresholdsInsightName = "conflictingLabelRowCount"
+ ProjectTestListResponseItemsThresholdsInsightNameContainsPii ProjectTestListResponseItemsThresholdsInsightName = "containsPii"
+ ProjectTestListResponseItemsThresholdsInsightNameContainsValidURL ProjectTestListResponseItemsThresholdsInsightName = "containsValidUrl"
+ ProjectTestListResponseItemsThresholdsInsightNameCorrelatedFeatures ProjectTestListResponseItemsThresholdsInsightName = "correlatedFeatures"
+ ProjectTestListResponseItemsThresholdsInsightNameCustomMetric ProjectTestListResponseItemsThresholdsInsightName = "customMetric"
+ ProjectTestListResponseItemsThresholdsInsightNameDuplicateRowCount ProjectTestListResponseItemsThresholdsInsightName = "duplicateRowCount"
+ ProjectTestListResponseItemsThresholdsInsightNameEmptyFeatures ProjectTestListResponseItemsThresholdsInsightName = "emptyFeatures"
+ ProjectTestListResponseItemsThresholdsInsightNameFeatureDrift ProjectTestListResponseItemsThresholdsInsightName = "featureDrift"
+ ProjectTestListResponseItemsThresholdsInsightNameFeatureProfile ProjectTestListResponseItemsThresholdsInsightName = "featureProfile"
+ ProjectTestListResponseItemsThresholdsInsightNameGreatExpectations ProjectTestListResponseItemsThresholdsInsightName = "greatExpectations"
+ ProjectTestListResponseItemsThresholdsInsightNameGroupByColumnStatsCheck ProjectTestListResponseItemsThresholdsInsightName = "groupByColumnStatsCheck"
+ ProjectTestListResponseItemsThresholdsInsightNameIllFormedRowCount ProjectTestListResponseItemsThresholdsInsightName = "illFormedRowCount"
+ ProjectTestListResponseItemsThresholdsInsightNameIsCode ProjectTestListResponseItemsThresholdsInsightName = "isCode"
+ ProjectTestListResponseItemsThresholdsInsightNameIsJson ProjectTestListResponseItemsThresholdsInsightName = "isJson"
+ ProjectTestListResponseItemsThresholdsInsightNameLlmRubricV2 ProjectTestListResponseItemsThresholdsInsightName = "llmRubricV2"
+ ProjectTestListResponseItemsThresholdsInsightNameLabelDrift ProjectTestListResponseItemsThresholdsInsightName = "labelDrift"
+ ProjectTestListResponseItemsThresholdsInsightNameMetrics ProjectTestListResponseItemsThresholdsInsightName = "metrics"
+ ProjectTestListResponseItemsThresholdsInsightNameNewCategories ProjectTestListResponseItemsThresholdsInsightName = "newCategories"
+ ProjectTestListResponseItemsThresholdsInsightNameNewLabels ProjectTestListResponseItemsThresholdsInsightName = "newLabels"
+ ProjectTestListResponseItemsThresholdsInsightNameNullRowCount ProjectTestListResponseItemsThresholdsInsightName = "nullRowCount"
+ ProjectTestListResponseItemsThresholdsInsightNamePpScore ProjectTestListResponseItemsThresholdsInsightName = "ppScore"
+ ProjectTestListResponseItemsThresholdsInsightNameQuasiConstantFeatures ProjectTestListResponseItemsThresholdsInsightName = "quasiConstantFeatures"
+ ProjectTestListResponseItemsThresholdsInsightNameSentenceLength ProjectTestListResponseItemsThresholdsInsightName = "sentenceLength"
+ ProjectTestListResponseItemsThresholdsInsightNameSizeRatio ProjectTestListResponseItemsThresholdsInsightName = "sizeRatio"
+ ProjectTestListResponseItemsThresholdsInsightNameSpecialCharacters ProjectTestListResponseItemsThresholdsInsightName = "specialCharacters"
+ ProjectTestListResponseItemsThresholdsInsightNameStringValidation ProjectTestListResponseItemsThresholdsInsightName = "stringValidation"
+ ProjectTestListResponseItemsThresholdsInsightNameTrainValLeakageRowCount ProjectTestListResponseItemsThresholdsInsightName = "trainValLeakageRowCount"
+)
+
+func (r ProjectTestListResponseItemsThresholdsInsightName) IsKnown() bool {
+ switch r {
+ case ProjectTestListResponseItemsThresholdsInsightNameCharacterLength, ProjectTestListResponseItemsThresholdsInsightNameClassImbalance, ProjectTestListResponseItemsThresholdsInsightNameExpectColumnAToBeInColumnB, ProjectTestListResponseItemsThresholdsInsightNameColumnAverage, ProjectTestListResponseItemsThresholdsInsightNameColumnDrift, ProjectTestListResponseItemsThresholdsInsightNameColumnValuesMatch, ProjectTestListResponseItemsThresholdsInsightNameConfidenceDistribution, ProjectTestListResponseItemsThresholdsInsightNameConflictingLabelRowCount, ProjectTestListResponseItemsThresholdsInsightNameContainsPii, ProjectTestListResponseItemsThresholdsInsightNameContainsValidURL, ProjectTestListResponseItemsThresholdsInsightNameCorrelatedFeatures, ProjectTestListResponseItemsThresholdsInsightNameCustomMetric, ProjectTestListResponseItemsThresholdsInsightNameDuplicateRowCount, ProjectTestListResponseItemsThresholdsInsightNameEmptyFeatures, ProjectTestListResponseItemsThresholdsInsightNameFeatureDrift, ProjectTestListResponseItemsThresholdsInsightNameFeatureProfile, ProjectTestListResponseItemsThresholdsInsightNameGreatExpectations, ProjectTestListResponseItemsThresholdsInsightNameGroupByColumnStatsCheck, ProjectTestListResponseItemsThresholdsInsightNameIllFormedRowCount, ProjectTestListResponseItemsThresholdsInsightNameIsCode, ProjectTestListResponseItemsThresholdsInsightNameIsJson, ProjectTestListResponseItemsThresholdsInsightNameLlmRubricV2, ProjectTestListResponseItemsThresholdsInsightNameLabelDrift, ProjectTestListResponseItemsThresholdsInsightNameMetrics, ProjectTestListResponseItemsThresholdsInsightNameNewCategories, ProjectTestListResponseItemsThresholdsInsightNameNewLabels, ProjectTestListResponseItemsThresholdsInsightNameNullRowCount, ProjectTestListResponseItemsThresholdsInsightNamePpScore, ProjectTestListResponseItemsThresholdsInsightNameQuasiConstantFeatures, ProjectTestListResponseItemsThresholdsInsightNameSentenceLength, ProjectTestListResponseItemsThresholdsInsightNameSizeRatio, ProjectTestListResponseItemsThresholdsInsightNameSpecialCharacters, ProjectTestListResponseItemsThresholdsInsightNameStringValidation, ProjectTestListResponseItemsThresholdsInsightNameTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type ProjectTestListResponseItemsThresholdsInsightParameter struct {
+ // The name of the insight filter.
+ Name string `json:"name,required"`
+ Value interface{} `json:"value,required"`
+ JSON projectTestListResponseItemsThresholdsInsightParameterJSON `json:"-"`
+}
+
+// projectTestListResponseItemsThresholdsInsightParameterJSON contains the JSON
+// metadata for the struct [ProjectTestListResponseItemsThresholdsInsightParameter]
+type projectTestListResponseItemsThresholdsInsightParameterJSON struct {
+ Name apijson.Field
+ Value apijson.Field
+ raw string
+ ExtraFields map[string]apijson.Field
+}
+
+func (r *ProjectTestListResponseItemsThresholdsInsightParameter) UnmarshalJSON(data []byte) (err error) {
+ return apijson.UnmarshalRoot(data, r)
+}
+
+func (r projectTestListResponseItemsThresholdsInsightParameterJSON) RawJSON() string {
+ return r.raw
+}
+
+// The operator to be used for the evaluation.
+type ProjectTestListResponseItemsThresholdsOperator string
+
+const (
+ ProjectTestListResponseItemsThresholdsOperatorIs ProjectTestListResponseItemsThresholdsOperator = "is"
+ ProjectTestListResponseItemsThresholdsOperatorGreater ProjectTestListResponseItemsThresholdsOperator = ">"
+ ProjectTestListResponseItemsThresholdsOperatorGreaterOrEquals ProjectTestListResponseItemsThresholdsOperator = ">="
+ ProjectTestListResponseItemsThresholdsOperatorLess ProjectTestListResponseItemsThresholdsOperator = "<"
+ ProjectTestListResponseItemsThresholdsOperatorLessOrEquals ProjectTestListResponseItemsThresholdsOperator = "<="
+ ProjectTestListResponseItemsThresholdsOperatorNotEquals ProjectTestListResponseItemsThresholdsOperator = "!="
+)
+
+func (r ProjectTestListResponseItemsThresholdsOperator) IsKnown() bool {
+ switch r {
+ case ProjectTestListResponseItemsThresholdsOperatorIs, ProjectTestListResponseItemsThresholdsOperatorGreater, ProjectTestListResponseItemsThresholdsOperatorGreaterOrEquals, ProjectTestListResponseItemsThresholdsOperatorLess, ProjectTestListResponseItemsThresholdsOperatorLessOrEquals, ProjectTestListResponseItemsThresholdsOperatorNotEquals:
+ return true
+ }
+ return false
+}
+
+// Whether to use automatic anomaly detection or manual thresholds
+type ProjectTestListResponseItemsThresholdsThresholdMode string
+
+const (
+ ProjectTestListResponseItemsThresholdsThresholdModeAutomatic ProjectTestListResponseItemsThresholdsThresholdMode = "automatic"
+ ProjectTestListResponseItemsThresholdsThresholdModeManual ProjectTestListResponseItemsThresholdsThresholdMode = "manual"
+)
+
+func (r ProjectTestListResponseItemsThresholdsThresholdMode) IsKnown() bool {
+ switch r {
+ case ProjectTestListResponseItemsThresholdsThresholdModeAutomatic, ProjectTestListResponseItemsThresholdsThresholdModeManual:
+ return true
+ }
+ return false
+}
+
+// The value to be compared.
+//
+// Union satisfied by [shared.UnionFloat], [shared.UnionBool], [shared.UnionString]
+// or [ProjectTestListResponseItemsThresholdsValueArray].
+type ProjectTestListResponseItemsThresholdsValueUnion interface {
+ ImplementsProjectTestListResponseItemsThresholdsValueUnion()
+}
+
+func init() {
+ apijson.RegisterUnion(
+ reflect.TypeOf((*ProjectTestListResponseItemsThresholdsValueUnion)(nil)).Elem(),
+ "",
+ apijson.UnionVariant{
+ TypeFilter: gjson.Number,
+ Type: reflect.TypeOf(shared.UnionFloat(0)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.True,
+ Type: reflect.TypeOf(shared.UnionBool(false)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.False,
+ Type: reflect.TypeOf(shared.UnionBool(false)),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.String,
+ Type: reflect.TypeOf(shared.UnionString("")),
+ },
+ apijson.UnionVariant{
+ TypeFilter: gjson.JSON,
+ Type: reflect.TypeOf(ProjectTestListResponseItemsThresholdsValueArray{}),
+ },
+ )
+}
+
+type ProjectTestListResponseItemsThresholdsValueArray []string
+
+func (r ProjectTestListResponseItemsThresholdsValueArray) ImplementsProjectTestListResponseItemsThresholdsValueUnion() {
+}
+
+// The test type.
+type ProjectTestListResponseItemsType string
+
+const (
+ ProjectTestListResponseItemsTypeIntegrity ProjectTestListResponseItemsType = "integrity"
+ ProjectTestListResponseItemsTypeConsistency ProjectTestListResponseItemsType = "consistency"
+ ProjectTestListResponseItemsTypePerformance ProjectTestListResponseItemsType = "performance"
+)
+
+func (r ProjectTestListResponseItemsType) IsKnown() bool {
+ switch r {
+ case ProjectTestListResponseItemsTypeIntegrity, ProjectTestListResponseItemsTypeConsistency, ProjectTestListResponseItemsTypePerformance:
+ return true
+ }
+ return false
+}
+
+type ProjectTestNewParams struct {
+ // The test description.
+ Description param.Field[interface{}] `json:"description,required"`
+ // The test name.
+ Name param.Field[string] `json:"name,required"`
+ // The test subtype.
+ Subtype param.Field[ProjectTestNewParamsSubtype] `json:"subtype,required"`
+ Thresholds param.Field[[]ProjectTestNewParamsThreshold] `json:"thresholds,required"`
+ // The test type.
+ Type param.Field[ProjectTestNewParamsType] `json:"type,required"`
+ // Whether the test is archived.
+ Archived param.Field[bool] `json:"archived"`
+ // The delay window in seconds. Only applies to tests that use production data.
+ DelayWindow param.Field[float64] `json:"delayWindow"`
+ // The evaluation window in seconds. Only applies to tests that use production
+ // data.
+ EvaluationWindow param.Field[float64] `json:"evaluationWindow"`
+ // Whether the test uses an ML model.
+ UsesMlModel param.Field[bool] `json:"usesMlModel"`
+ // Whether the test uses production data (monitoring mode only).
+ UsesProductionData param.Field[bool] `json:"usesProductionData"`
+ // Whether the test uses a reference dataset (monitoring mode only).
+ UsesReferenceDataset param.Field[bool] `json:"usesReferenceDataset"`
+ // Whether the test uses a training dataset.
+ UsesTrainingDataset param.Field[bool] `json:"usesTrainingDataset"`
+ // Whether the test uses a validation dataset.
+ UsesValidationDataset param.Field[bool] `json:"usesValidationDataset"`
+}
+
+func (r ProjectTestNewParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The test subtype.
+type ProjectTestNewParamsSubtype string
+
+const (
+ ProjectTestNewParamsSubtypeAnomalousColumnCount ProjectTestNewParamsSubtype = "anomalousColumnCount"
+ ProjectTestNewParamsSubtypeCharacterLength ProjectTestNewParamsSubtype = "characterLength"
+ ProjectTestNewParamsSubtypeClassImbalanceRatio ProjectTestNewParamsSubtype = "classImbalanceRatio"
+ ProjectTestNewParamsSubtypeExpectColumnAToBeInColumnB ProjectTestNewParamsSubtype = "expectColumnAToBeInColumnB"
+ ProjectTestNewParamsSubtypeColumnAverage ProjectTestNewParamsSubtype = "columnAverage"
+ ProjectTestNewParamsSubtypeColumnDrift ProjectTestNewParamsSubtype = "columnDrift"
+ ProjectTestNewParamsSubtypeColumnStatistic ProjectTestNewParamsSubtype = "columnStatistic"
+ ProjectTestNewParamsSubtypeColumnValuesMatch ProjectTestNewParamsSubtype = "columnValuesMatch"
+ ProjectTestNewParamsSubtypeConflictingLabelRowCount ProjectTestNewParamsSubtype = "conflictingLabelRowCount"
+ ProjectTestNewParamsSubtypeContainsPii ProjectTestNewParamsSubtype = "containsPii"
+ ProjectTestNewParamsSubtypeContainsValidURL ProjectTestNewParamsSubtype = "containsValidUrl"
+ ProjectTestNewParamsSubtypeCorrelatedFeatureCount ProjectTestNewParamsSubtype = "correlatedFeatureCount"
+ ProjectTestNewParamsSubtypeCustomMetricThreshold ProjectTestNewParamsSubtype = "customMetricThreshold"
+ ProjectTestNewParamsSubtypeDuplicateRowCount ProjectTestNewParamsSubtype = "duplicateRowCount"
+ ProjectTestNewParamsSubtypeEmptyFeature ProjectTestNewParamsSubtype = "emptyFeature"
+ ProjectTestNewParamsSubtypeEmptyFeatureCount ProjectTestNewParamsSubtype = "emptyFeatureCount"
+ ProjectTestNewParamsSubtypeDriftedFeatureCount ProjectTestNewParamsSubtype = "driftedFeatureCount"
+ ProjectTestNewParamsSubtypeFeatureMissingValues ProjectTestNewParamsSubtype = "featureMissingValues"
+ ProjectTestNewParamsSubtypeFeatureValueValidation ProjectTestNewParamsSubtype = "featureValueValidation"
+ ProjectTestNewParamsSubtypeGreatExpectations ProjectTestNewParamsSubtype = "greatExpectations"
+ ProjectTestNewParamsSubtypeGroupByColumnStatsCheck ProjectTestNewParamsSubtype = "groupByColumnStatsCheck"
+ ProjectTestNewParamsSubtypeIllFormedRowCount ProjectTestNewParamsSubtype = "illFormedRowCount"
+ ProjectTestNewParamsSubtypeIsCode ProjectTestNewParamsSubtype = "isCode"
+ ProjectTestNewParamsSubtypeIsJson ProjectTestNewParamsSubtype = "isJson"
+ ProjectTestNewParamsSubtypeLlmRubricThresholdV2 ProjectTestNewParamsSubtype = "llmRubricThresholdV2"
+ ProjectTestNewParamsSubtypeLabelDrift ProjectTestNewParamsSubtype = "labelDrift"
+ ProjectTestNewParamsSubtypeMetricThreshold ProjectTestNewParamsSubtype = "metricThreshold"
+ ProjectTestNewParamsSubtypeNewCategoryCount ProjectTestNewParamsSubtype = "newCategoryCount"
+ ProjectTestNewParamsSubtypeNewLabelCount ProjectTestNewParamsSubtype = "newLabelCount"
+ ProjectTestNewParamsSubtypeNullRowCount ProjectTestNewParamsSubtype = "nullRowCount"
+ ProjectTestNewParamsSubtypeRowCount ProjectTestNewParamsSubtype = "rowCount"
+ ProjectTestNewParamsSubtypePpScoreValueValidation ProjectTestNewParamsSubtype = "ppScoreValueValidation"
+ ProjectTestNewParamsSubtypeQuasiConstantFeature ProjectTestNewParamsSubtype = "quasiConstantFeature"
+ ProjectTestNewParamsSubtypeQuasiConstantFeatureCount ProjectTestNewParamsSubtype = "quasiConstantFeatureCount"
+ ProjectTestNewParamsSubtypeSqlQuery ProjectTestNewParamsSubtype = "sqlQuery"
+ ProjectTestNewParamsSubtypeDtypeValidation ProjectTestNewParamsSubtype = "dtypeValidation"
+ ProjectTestNewParamsSubtypeSentenceLength ProjectTestNewParamsSubtype = "sentenceLength"
+ ProjectTestNewParamsSubtypeSizeRatio ProjectTestNewParamsSubtype = "sizeRatio"
+ ProjectTestNewParamsSubtypeSpecialCharactersRatio ProjectTestNewParamsSubtype = "specialCharactersRatio"
+ ProjectTestNewParamsSubtypeStringValidation ProjectTestNewParamsSubtype = "stringValidation"
+ ProjectTestNewParamsSubtypeTrainValLeakageRowCount ProjectTestNewParamsSubtype = "trainValLeakageRowCount"
+)
+
+func (r ProjectTestNewParamsSubtype) IsKnown() bool {
+ switch r {
+ case ProjectTestNewParamsSubtypeAnomalousColumnCount, ProjectTestNewParamsSubtypeCharacterLength, ProjectTestNewParamsSubtypeClassImbalanceRatio, ProjectTestNewParamsSubtypeExpectColumnAToBeInColumnB, ProjectTestNewParamsSubtypeColumnAverage, ProjectTestNewParamsSubtypeColumnDrift, ProjectTestNewParamsSubtypeColumnStatistic, ProjectTestNewParamsSubtypeColumnValuesMatch, ProjectTestNewParamsSubtypeConflictingLabelRowCount, ProjectTestNewParamsSubtypeContainsPii, ProjectTestNewParamsSubtypeContainsValidURL, ProjectTestNewParamsSubtypeCorrelatedFeatureCount, ProjectTestNewParamsSubtypeCustomMetricThreshold, ProjectTestNewParamsSubtypeDuplicateRowCount, ProjectTestNewParamsSubtypeEmptyFeature, ProjectTestNewParamsSubtypeEmptyFeatureCount, ProjectTestNewParamsSubtypeDriftedFeatureCount, ProjectTestNewParamsSubtypeFeatureMissingValues, ProjectTestNewParamsSubtypeFeatureValueValidation, ProjectTestNewParamsSubtypeGreatExpectations, ProjectTestNewParamsSubtypeGroupByColumnStatsCheck, ProjectTestNewParamsSubtypeIllFormedRowCount, ProjectTestNewParamsSubtypeIsCode, ProjectTestNewParamsSubtypeIsJson, ProjectTestNewParamsSubtypeLlmRubricThresholdV2, ProjectTestNewParamsSubtypeLabelDrift, ProjectTestNewParamsSubtypeMetricThreshold, ProjectTestNewParamsSubtypeNewCategoryCount, ProjectTestNewParamsSubtypeNewLabelCount, ProjectTestNewParamsSubtypeNullRowCount, ProjectTestNewParamsSubtypeRowCount, ProjectTestNewParamsSubtypePpScoreValueValidation, ProjectTestNewParamsSubtypeQuasiConstantFeature, ProjectTestNewParamsSubtypeQuasiConstantFeatureCount, ProjectTestNewParamsSubtypeSqlQuery, ProjectTestNewParamsSubtypeDtypeValidation, ProjectTestNewParamsSubtypeSentenceLength, ProjectTestNewParamsSubtypeSizeRatio, ProjectTestNewParamsSubtypeSpecialCharactersRatio, ProjectTestNewParamsSubtypeStringValidation, ProjectTestNewParamsSubtypeTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type ProjectTestNewParamsThreshold struct {
+ // The insight name to be evaluated.
+ InsightName param.Field[ProjectTestNewParamsThresholdsInsightName] `json:"insightName"`
+ // The insight parameters. Required only for some test subtypes. For example, for
+ // tests that require a column name, the insight parameters will be [{'name':
+ // 'column_name', 'value': 'Age'}]
+ InsightParameters param.Field[[]ProjectTestNewParamsThresholdsInsightParameter] `json:"insightParameters"`
+ // The measurement to be evaluated.
+ Measurement param.Field[string] `json:"measurement"`
+ // The operator to be used for the evaluation.
+ Operator param.Field[ProjectTestNewParamsThresholdsOperator] `json:"operator"`
+ // Whether to use automatic anomaly detection or manual thresholds
+ ThresholdMode param.Field[ProjectTestNewParamsThresholdsThresholdMode] `json:"thresholdMode"`
+ // The value to be compared.
+ Value param.Field[ProjectTestNewParamsThresholdsValueUnion] `json:"value"`
+}
+
+func (r ProjectTestNewParamsThreshold) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The insight name to be evaluated.
+type ProjectTestNewParamsThresholdsInsightName string
+
+const (
+ ProjectTestNewParamsThresholdsInsightNameCharacterLength ProjectTestNewParamsThresholdsInsightName = "characterLength"
+ ProjectTestNewParamsThresholdsInsightNameClassImbalance ProjectTestNewParamsThresholdsInsightName = "classImbalance"
+ ProjectTestNewParamsThresholdsInsightNameExpectColumnAToBeInColumnB ProjectTestNewParamsThresholdsInsightName = "expectColumnAToBeInColumnB"
+ ProjectTestNewParamsThresholdsInsightNameColumnAverage ProjectTestNewParamsThresholdsInsightName = "columnAverage"
+ ProjectTestNewParamsThresholdsInsightNameColumnDrift ProjectTestNewParamsThresholdsInsightName = "columnDrift"
+ ProjectTestNewParamsThresholdsInsightNameColumnValuesMatch ProjectTestNewParamsThresholdsInsightName = "columnValuesMatch"
+ ProjectTestNewParamsThresholdsInsightNameConfidenceDistribution ProjectTestNewParamsThresholdsInsightName = "confidenceDistribution"
+ ProjectTestNewParamsThresholdsInsightNameConflictingLabelRowCount ProjectTestNewParamsThresholdsInsightName = "conflictingLabelRowCount"
+ ProjectTestNewParamsThresholdsInsightNameContainsPii ProjectTestNewParamsThresholdsInsightName = "containsPii"
+ ProjectTestNewParamsThresholdsInsightNameContainsValidURL ProjectTestNewParamsThresholdsInsightName = "containsValidUrl"
+ ProjectTestNewParamsThresholdsInsightNameCorrelatedFeatures ProjectTestNewParamsThresholdsInsightName = "correlatedFeatures"
+ ProjectTestNewParamsThresholdsInsightNameCustomMetric ProjectTestNewParamsThresholdsInsightName = "customMetric"
+ ProjectTestNewParamsThresholdsInsightNameDuplicateRowCount ProjectTestNewParamsThresholdsInsightName = "duplicateRowCount"
+ ProjectTestNewParamsThresholdsInsightNameEmptyFeatures ProjectTestNewParamsThresholdsInsightName = "emptyFeatures"
+ ProjectTestNewParamsThresholdsInsightNameFeatureDrift ProjectTestNewParamsThresholdsInsightName = "featureDrift"
+ ProjectTestNewParamsThresholdsInsightNameFeatureProfile ProjectTestNewParamsThresholdsInsightName = "featureProfile"
+ ProjectTestNewParamsThresholdsInsightNameGreatExpectations ProjectTestNewParamsThresholdsInsightName = "greatExpectations"
+ ProjectTestNewParamsThresholdsInsightNameGroupByColumnStatsCheck ProjectTestNewParamsThresholdsInsightName = "groupByColumnStatsCheck"
+ ProjectTestNewParamsThresholdsInsightNameIllFormedRowCount ProjectTestNewParamsThresholdsInsightName = "illFormedRowCount"
+ ProjectTestNewParamsThresholdsInsightNameIsCode ProjectTestNewParamsThresholdsInsightName = "isCode"
+ ProjectTestNewParamsThresholdsInsightNameIsJson ProjectTestNewParamsThresholdsInsightName = "isJson"
+ ProjectTestNewParamsThresholdsInsightNameLlmRubricV2 ProjectTestNewParamsThresholdsInsightName = "llmRubricV2"
+ ProjectTestNewParamsThresholdsInsightNameLabelDrift ProjectTestNewParamsThresholdsInsightName = "labelDrift"
+ ProjectTestNewParamsThresholdsInsightNameMetrics ProjectTestNewParamsThresholdsInsightName = "metrics"
+ ProjectTestNewParamsThresholdsInsightNameNewCategories ProjectTestNewParamsThresholdsInsightName = "newCategories"
+ ProjectTestNewParamsThresholdsInsightNameNewLabels ProjectTestNewParamsThresholdsInsightName = "newLabels"
+ ProjectTestNewParamsThresholdsInsightNameNullRowCount ProjectTestNewParamsThresholdsInsightName = "nullRowCount"
+ ProjectTestNewParamsThresholdsInsightNamePpScore ProjectTestNewParamsThresholdsInsightName = "ppScore"
+ ProjectTestNewParamsThresholdsInsightNameQuasiConstantFeatures ProjectTestNewParamsThresholdsInsightName = "quasiConstantFeatures"
+ ProjectTestNewParamsThresholdsInsightNameSentenceLength ProjectTestNewParamsThresholdsInsightName = "sentenceLength"
+ ProjectTestNewParamsThresholdsInsightNameSizeRatio ProjectTestNewParamsThresholdsInsightName = "sizeRatio"
+ ProjectTestNewParamsThresholdsInsightNameSpecialCharacters ProjectTestNewParamsThresholdsInsightName = "specialCharacters"
+ ProjectTestNewParamsThresholdsInsightNameStringValidation ProjectTestNewParamsThresholdsInsightName = "stringValidation"
+ ProjectTestNewParamsThresholdsInsightNameTrainValLeakageRowCount ProjectTestNewParamsThresholdsInsightName = "trainValLeakageRowCount"
+)
+
+func (r ProjectTestNewParamsThresholdsInsightName) IsKnown() bool {
+ switch r {
+ case ProjectTestNewParamsThresholdsInsightNameCharacterLength, ProjectTestNewParamsThresholdsInsightNameClassImbalance, ProjectTestNewParamsThresholdsInsightNameExpectColumnAToBeInColumnB, ProjectTestNewParamsThresholdsInsightNameColumnAverage, ProjectTestNewParamsThresholdsInsightNameColumnDrift, ProjectTestNewParamsThresholdsInsightNameColumnValuesMatch, ProjectTestNewParamsThresholdsInsightNameConfidenceDistribution, ProjectTestNewParamsThresholdsInsightNameConflictingLabelRowCount, ProjectTestNewParamsThresholdsInsightNameContainsPii, ProjectTestNewParamsThresholdsInsightNameContainsValidURL, ProjectTestNewParamsThresholdsInsightNameCorrelatedFeatures, ProjectTestNewParamsThresholdsInsightNameCustomMetric, ProjectTestNewParamsThresholdsInsightNameDuplicateRowCount, ProjectTestNewParamsThresholdsInsightNameEmptyFeatures, ProjectTestNewParamsThresholdsInsightNameFeatureDrift, ProjectTestNewParamsThresholdsInsightNameFeatureProfile, ProjectTestNewParamsThresholdsInsightNameGreatExpectations, ProjectTestNewParamsThresholdsInsightNameGroupByColumnStatsCheck, ProjectTestNewParamsThresholdsInsightNameIllFormedRowCount, ProjectTestNewParamsThresholdsInsightNameIsCode, ProjectTestNewParamsThresholdsInsightNameIsJson, ProjectTestNewParamsThresholdsInsightNameLlmRubricV2, ProjectTestNewParamsThresholdsInsightNameLabelDrift, ProjectTestNewParamsThresholdsInsightNameMetrics, ProjectTestNewParamsThresholdsInsightNameNewCategories, ProjectTestNewParamsThresholdsInsightNameNewLabels, ProjectTestNewParamsThresholdsInsightNameNullRowCount, ProjectTestNewParamsThresholdsInsightNamePpScore, ProjectTestNewParamsThresholdsInsightNameQuasiConstantFeatures, ProjectTestNewParamsThresholdsInsightNameSentenceLength, ProjectTestNewParamsThresholdsInsightNameSizeRatio, ProjectTestNewParamsThresholdsInsightNameSpecialCharacters, ProjectTestNewParamsThresholdsInsightNameStringValidation, ProjectTestNewParamsThresholdsInsightNameTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type ProjectTestNewParamsThresholdsInsightParameter struct {
+ // The name of the insight filter.
+ Name param.Field[string] `json:"name,required"`
+ Value param.Field[interface{}] `json:"value,required"`
+}
+
+func (r ProjectTestNewParamsThresholdsInsightParameter) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The operator to be used for the evaluation.
+type ProjectTestNewParamsThresholdsOperator string
+
+const (
+ ProjectTestNewParamsThresholdsOperatorIs ProjectTestNewParamsThresholdsOperator = "is"
+ ProjectTestNewParamsThresholdsOperatorGreater ProjectTestNewParamsThresholdsOperator = ">"
+ ProjectTestNewParamsThresholdsOperatorGreaterOrEquals ProjectTestNewParamsThresholdsOperator = ">="
+ ProjectTestNewParamsThresholdsOperatorLess ProjectTestNewParamsThresholdsOperator = "<"
+ ProjectTestNewParamsThresholdsOperatorLessOrEquals ProjectTestNewParamsThresholdsOperator = "<="
+ ProjectTestNewParamsThresholdsOperatorNotEquals ProjectTestNewParamsThresholdsOperator = "!="
+)
+
+func (r ProjectTestNewParamsThresholdsOperator) IsKnown() bool {
+ switch r {
+ case ProjectTestNewParamsThresholdsOperatorIs, ProjectTestNewParamsThresholdsOperatorGreater, ProjectTestNewParamsThresholdsOperatorGreaterOrEquals, ProjectTestNewParamsThresholdsOperatorLess, ProjectTestNewParamsThresholdsOperatorLessOrEquals, ProjectTestNewParamsThresholdsOperatorNotEquals:
+ return true
+ }
+ return false
+}
+
+// Whether to use automatic anomaly detection or manual thresholds
+type ProjectTestNewParamsThresholdsThresholdMode string
+
+const (
+ ProjectTestNewParamsThresholdsThresholdModeAutomatic ProjectTestNewParamsThresholdsThresholdMode = "automatic"
+ ProjectTestNewParamsThresholdsThresholdModeManual ProjectTestNewParamsThresholdsThresholdMode = "manual"
+)
+
+func (r ProjectTestNewParamsThresholdsThresholdMode) IsKnown() bool {
+ switch r {
+ case ProjectTestNewParamsThresholdsThresholdModeAutomatic, ProjectTestNewParamsThresholdsThresholdModeManual:
+ return true
+ }
+ return false
+}
+
+// The value to be compared.
+//
+// Satisfied by [shared.UnionFloat], [shared.UnionBool], [shared.UnionString],
+// [ProjectTestNewParamsThresholdsValueArray].
+type ProjectTestNewParamsThresholdsValueUnion interface {
+ ImplementsProjectTestNewParamsThresholdsValueUnion()
+}
+
+type ProjectTestNewParamsThresholdsValueArray []string
+
+func (r ProjectTestNewParamsThresholdsValueArray) ImplementsProjectTestNewParamsThresholdsValueUnion() {
+}
+
+// The test type.
+type ProjectTestNewParamsType string
+
+const (
+ ProjectTestNewParamsTypeIntegrity ProjectTestNewParamsType = "integrity"
+ ProjectTestNewParamsTypeConsistency ProjectTestNewParamsType = "consistency"
+ ProjectTestNewParamsTypePerformance ProjectTestNewParamsType = "performance"
+)
+
+func (r ProjectTestNewParamsType) IsKnown() bool {
+ switch r {
+ case ProjectTestNewParamsTypeIntegrity, ProjectTestNewParamsTypeConsistency, ProjectTestNewParamsTypePerformance:
+ return true
+ }
+ return false
+}
+
+type ProjectTestUpdateParams struct {
+ Payloads param.Field[[]ProjectTestUpdateParamsPayload] `json:"payloads,required"`
+}
+
+func (r ProjectTestUpdateParams) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ProjectTestUpdateParamsPayload struct {
+ ID param.Field[string] `json:"id,required" format:"uuid"`
+ // Whether the test is archived.
+ Archived param.Field[bool] `json:"archived"`
+ // The test description.
+ Description param.Field[interface{}] `json:"description"`
+ // The test name.
+ Name param.Field[string] `json:"name"`
+ Suggested param.Field[ProjectTestUpdateParamsPayloadsSuggested] `json:"suggested"`
+ Thresholds param.Field[[]ProjectTestUpdateParamsPayloadsThreshold] `json:"thresholds"`
+}
+
+func (r ProjectTestUpdateParamsPayload) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+type ProjectTestUpdateParamsPayloadsSuggested bool
+
+const (
+ ProjectTestUpdateParamsPayloadsSuggestedFalse ProjectTestUpdateParamsPayloadsSuggested = false
+)
+
+func (r ProjectTestUpdateParamsPayloadsSuggested) IsKnown() bool {
+ switch r {
+ case ProjectTestUpdateParamsPayloadsSuggestedFalse:
+ return true
+ }
+ return false
+}
+
+type ProjectTestUpdateParamsPayloadsThreshold struct {
+ // The insight name to be evaluated.
+ InsightName param.Field[ProjectTestUpdateParamsPayloadsThresholdsInsightName] `json:"insightName"`
+ // The insight parameters. Required only for some test subtypes. For example, for
+ // tests that require a column name, the insight parameters will be [{'name':
+ // 'column_name', 'value': 'Age'}]
+ InsightParameters param.Field[[]ProjectTestUpdateParamsPayloadsThresholdsInsightParameter] `json:"insightParameters"`
+ // The measurement to be evaluated.
+ Measurement param.Field[string] `json:"measurement"`
+ // The operator to be used for the evaluation.
+ Operator param.Field[ProjectTestUpdateParamsPayloadsThresholdsOperator] `json:"operator"`
+ // Whether to use automatic anomaly detection or manual thresholds
+ ThresholdMode param.Field[ProjectTestUpdateParamsPayloadsThresholdsThresholdMode] `json:"thresholdMode"`
+ // The value to be compared.
+ Value param.Field[ProjectTestUpdateParamsPayloadsThresholdsValueUnion] `json:"value"`
+}
+
+func (r ProjectTestUpdateParamsPayloadsThreshold) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The insight name to be evaluated.
+type ProjectTestUpdateParamsPayloadsThresholdsInsightName string
+
+const (
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameCharacterLength ProjectTestUpdateParamsPayloadsThresholdsInsightName = "characterLength"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameClassImbalance ProjectTestUpdateParamsPayloadsThresholdsInsightName = "classImbalance"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameExpectColumnAToBeInColumnB ProjectTestUpdateParamsPayloadsThresholdsInsightName = "expectColumnAToBeInColumnB"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameColumnAverage ProjectTestUpdateParamsPayloadsThresholdsInsightName = "columnAverage"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameColumnDrift ProjectTestUpdateParamsPayloadsThresholdsInsightName = "columnDrift"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameColumnValuesMatch ProjectTestUpdateParamsPayloadsThresholdsInsightName = "columnValuesMatch"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameConfidenceDistribution ProjectTestUpdateParamsPayloadsThresholdsInsightName = "confidenceDistribution"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameConflictingLabelRowCount ProjectTestUpdateParamsPayloadsThresholdsInsightName = "conflictingLabelRowCount"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameContainsPii ProjectTestUpdateParamsPayloadsThresholdsInsightName = "containsPii"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameContainsValidURL ProjectTestUpdateParamsPayloadsThresholdsInsightName = "containsValidUrl"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameCorrelatedFeatures ProjectTestUpdateParamsPayloadsThresholdsInsightName = "correlatedFeatures"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameCustomMetric ProjectTestUpdateParamsPayloadsThresholdsInsightName = "customMetric"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameDuplicateRowCount ProjectTestUpdateParamsPayloadsThresholdsInsightName = "duplicateRowCount"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameEmptyFeatures ProjectTestUpdateParamsPayloadsThresholdsInsightName = "emptyFeatures"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameFeatureDrift ProjectTestUpdateParamsPayloadsThresholdsInsightName = "featureDrift"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameFeatureProfile ProjectTestUpdateParamsPayloadsThresholdsInsightName = "featureProfile"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameGreatExpectations ProjectTestUpdateParamsPayloadsThresholdsInsightName = "greatExpectations"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameGroupByColumnStatsCheck ProjectTestUpdateParamsPayloadsThresholdsInsightName = "groupByColumnStatsCheck"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameIllFormedRowCount ProjectTestUpdateParamsPayloadsThresholdsInsightName = "illFormedRowCount"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameIsCode ProjectTestUpdateParamsPayloadsThresholdsInsightName = "isCode"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameIsJson ProjectTestUpdateParamsPayloadsThresholdsInsightName = "isJson"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameLlmRubricV2 ProjectTestUpdateParamsPayloadsThresholdsInsightName = "llmRubricV2"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameLabelDrift ProjectTestUpdateParamsPayloadsThresholdsInsightName = "labelDrift"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameMetrics ProjectTestUpdateParamsPayloadsThresholdsInsightName = "metrics"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameNewCategories ProjectTestUpdateParamsPayloadsThresholdsInsightName = "newCategories"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameNewLabels ProjectTestUpdateParamsPayloadsThresholdsInsightName = "newLabels"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameNullRowCount ProjectTestUpdateParamsPayloadsThresholdsInsightName = "nullRowCount"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNamePpScore ProjectTestUpdateParamsPayloadsThresholdsInsightName = "ppScore"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameQuasiConstantFeatures ProjectTestUpdateParamsPayloadsThresholdsInsightName = "quasiConstantFeatures"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameSentenceLength ProjectTestUpdateParamsPayloadsThresholdsInsightName = "sentenceLength"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameSizeRatio ProjectTestUpdateParamsPayloadsThresholdsInsightName = "sizeRatio"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameSpecialCharacters ProjectTestUpdateParamsPayloadsThresholdsInsightName = "specialCharacters"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameStringValidation ProjectTestUpdateParamsPayloadsThresholdsInsightName = "stringValidation"
+ ProjectTestUpdateParamsPayloadsThresholdsInsightNameTrainValLeakageRowCount ProjectTestUpdateParamsPayloadsThresholdsInsightName = "trainValLeakageRowCount"
+)
+
+func (r ProjectTestUpdateParamsPayloadsThresholdsInsightName) IsKnown() bool {
+ switch r {
+ case ProjectTestUpdateParamsPayloadsThresholdsInsightNameCharacterLength, ProjectTestUpdateParamsPayloadsThresholdsInsightNameClassImbalance, ProjectTestUpdateParamsPayloadsThresholdsInsightNameExpectColumnAToBeInColumnB, ProjectTestUpdateParamsPayloadsThresholdsInsightNameColumnAverage, ProjectTestUpdateParamsPayloadsThresholdsInsightNameColumnDrift, ProjectTestUpdateParamsPayloadsThresholdsInsightNameColumnValuesMatch, ProjectTestUpdateParamsPayloadsThresholdsInsightNameConfidenceDistribution, ProjectTestUpdateParamsPayloadsThresholdsInsightNameConflictingLabelRowCount, ProjectTestUpdateParamsPayloadsThresholdsInsightNameContainsPii, ProjectTestUpdateParamsPayloadsThresholdsInsightNameContainsValidURL, ProjectTestUpdateParamsPayloadsThresholdsInsightNameCorrelatedFeatures, ProjectTestUpdateParamsPayloadsThresholdsInsightNameCustomMetric, ProjectTestUpdateParamsPayloadsThresholdsInsightNameDuplicateRowCount, ProjectTestUpdateParamsPayloadsThresholdsInsightNameEmptyFeatures, ProjectTestUpdateParamsPayloadsThresholdsInsightNameFeatureDrift, ProjectTestUpdateParamsPayloadsThresholdsInsightNameFeatureProfile, ProjectTestUpdateParamsPayloadsThresholdsInsightNameGreatExpectations, ProjectTestUpdateParamsPayloadsThresholdsInsightNameGroupByColumnStatsCheck, ProjectTestUpdateParamsPayloadsThresholdsInsightNameIllFormedRowCount, ProjectTestUpdateParamsPayloadsThresholdsInsightNameIsCode, ProjectTestUpdateParamsPayloadsThresholdsInsightNameIsJson, ProjectTestUpdateParamsPayloadsThresholdsInsightNameLlmRubricV2, ProjectTestUpdateParamsPayloadsThresholdsInsightNameLabelDrift, ProjectTestUpdateParamsPayloadsThresholdsInsightNameMetrics, ProjectTestUpdateParamsPayloadsThresholdsInsightNameNewCategories, ProjectTestUpdateParamsPayloadsThresholdsInsightNameNewLabels, ProjectTestUpdateParamsPayloadsThresholdsInsightNameNullRowCount, ProjectTestUpdateParamsPayloadsThresholdsInsightNamePpScore, ProjectTestUpdateParamsPayloadsThresholdsInsightNameQuasiConstantFeatures, ProjectTestUpdateParamsPayloadsThresholdsInsightNameSentenceLength, ProjectTestUpdateParamsPayloadsThresholdsInsightNameSizeRatio, ProjectTestUpdateParamsPayloadsThresholdsInsightNameSpecialCharacters, ProjectTestUpdateParamsPayloadsThresholdsInsightNameStringValidation, ProjectTestUpdateParamsPayloadsThresholdsInsightNameTrainValLeakageRowCount:
+ return true
+ }
+ return false
+}
+
+type ProjectTestUpdateParamsPayloadsThresholdsInsightParameter struct {
+ // The name of the insight filter.
+ Name param.Field[string] `json:"name,required"`
+ Value param.Field[interface{}] `json:"value,required"`
+}
+
+func (r ProjectTestUpdateParamsPayloadsThresholdsInsightParameter) MarshalJSON() (data []byte, err error) {
+ return apijson.MarshalRoot(r)
+}
+
+// The operator to be used for the evaluation.
+type ProjectTestUpdateParamsPayloadsThresholdsOperator string
+
+const (
+ ProjectTestUpdateParamsPayloadsThresholdsOperatorIs ProjectTestUpdateParamsPayloadsThresholdsOperator = "is"
+ ProjectTestUpdateParamsPayloadsThresholdsOperatorGreater ProjectTestUpdateParamsPayloadsThresholdsOperator = ">"
+ ProjectTestUpdateParamsPayloadsThresholdsOperatorGreaterOrEquals ProjectTestUpdateParamsPayloadsThresholdsOperator = ">="
+ ProjectTestUpdateParamsPayloadsThresholdsOperatorLess ProjectTestUpdateParamsPayloadsThresholdsOperator = "<"
+ ProjectTestUpdateParamsPayloadsThresholdsOperatorLessOrEquals ProjectTestUpdateParamsPayloadsThresholdsOperator = "<="
+ ProjectTestUpdateParamsPayloadsThresholdsOperatorNotEquals ProjectTestUpdateParamsPayloadsThresholdsOperator = "!="
+)
+
+func (r ProjectTestUpdateParamsPayloadsThresholdsOperator) IsKnown() bool {
+ switch r {
+ case ProjectTestUpdateParamsPayloadsThresholdsOperatorIs, ProjectTestUpdateParamsPayloadsThresholdsOperatorGreater, ProjectTestUpdateParamsPayloadsThresholdsOperatorGreaterOrEquals, ProjectTestUpdateParamsPayloadsThresholdsOperatorLess, ProjectTestUpdateParamsPayloadsThresholdsOperatorLessOrEquals, ProjectTestUpdateParamsPayloadsThresholdsOperatorNotEquals:
+ return true
+ }
+ return false
+}
+
+// Whether to use automatic anomaly detection or manual thresholds
+type ProjectTestUpdateParamsPayloadsThresholdsThresholdMode string
+
+const (
+ ProjectTestUpdateParamsPayloadsThresholdsThresholdModeAutomatic ProjectTestUpdateParamsPayloadsThresholdsThresholdMode = "automatic"
+ ProjectTestUpdateParamsPayloadsThresholdsThresholdModeManual ProjectTestUpdateParamsPayloadsThresholdsThresholdMode = "manual"
+)
+
+func (r ProjectTestUpdateParamsPayloadsThresholdsThresholdMode) IsKnown() bool {
+ switch r {
+ case ProjectTestUpdateParamsPayloadsThresholdsThresholdModeAutomatic, ProjectTestUpdateParamsPayloadsThresholdsThresholdModeManual:
+ return true
+ }
+ return false
+}
+
+// The value to be compared.
+//
+// Satisfied by [shared.UnionFloat], [shared.UnionBool], [shared.UnionString],
+// [ProjectTestUpdateParamsPayloadsThresholdsValueArray].
+type ProjectTestUpdateParamsPayloadsThresholdsValueUnion interface {
+ ImplementsProjectTestUpdateParamsPayloadsThresholdsValueUnion()
+}
+
+type ProjectTestUpdateParamsPayloadsThresholdsValueArray []string
+
+func (r ProjectTestUpdateParamsPayloadsThresholdsValueArray) ImplementsProjectTestUpdateParamsPayloadsThresholdsValueUnion() {
+}
+
+type ProjectTestListParams struct {
+ // Filter for archived tests.
+ IncludeArchived param.Field[bool] `query:"includeArchived"`
+ // Retrive tests created by a specific project version.
+ OriginVersionID param.Field[string] `query:"originVersionId" format:"uuid"`
+ // The page to return in a paginated query.
+ Page param.Field[int64] `query:"page"`
+ // Maximum number of items to return per page.
+ PerPage param.Field[int64] `query:"perPage"`
+ // Filter for suggested tests.
+ Suggested param.Field[bool] `query:"suggested"`
+ // Filter objects by test type. Available types are `integrity`, `consistency`,
+ // `performance`, `fairness`, and `robustness`.
+ Type param.Field[ProjectTestListParamsType] `query:"type"`
+ // Retrive tests with usesProductionData (monitoring).
+ UsesProductionData param.Field[bool] `query:"usesProductionData"`
+}
+
+// URLQuery serializes [ProjectTestListParams]'s query parameters as `url.Values`.
+func (r ProjectTestListParams) URLQuery() (v url.Values) {
+ return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
+ ArrayFormat: apiquery.ArrayQueryFormatComma,
+ NestedFormat: apiquery.NestedQueryFormatBrackets,
+ })
+}
+
+// Filter objects by test type. Available types are `integrity`, `consistency`,
+// `performance`, `fairness`, and `robustness`.
+type ProjectTestListParamsType string
+
+const (
+ ProjectTestListParamsTypeIntegrity ProjectTestListParamsType = "integrity"
+ ProjectTestListParamsTypeConsistency ProjectTestListParamsType = "consistency"
+ ProjectTestListParamsTypePerformance ProjectTestListParamsType = "performance"
+ ProjectTestListParamsTypeFairness ProjectTestListParamsType = "fairness"
+ ProjectTestListParamsTypeRobustness ProjectTestListParamsType = "robustness"
+)
+
+func (r ProjectTestListParamsType) IsKnown() bool {
+ switch r {
+ case ProjectTestListParamsTypeIntegrity, ProjectTestListParamsTypeConsistency, ProjectTestListParamsTypePerformance, ProjectTestListParamsTypeFairness, ProjectTestListParamsTypeRobustness:
+ return true
+ }
+ return false
+}
diff --git a/projecttest_test.go b/projecttest_test.go
new file mode 100644
index 0000000..bd54a3a
--- /dev/null
+++ b/projecttest_test.go
@@ -0,0 +1,144 @@
+// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+package openlayer_test
+
+import (
+ "context"
+ "errors"
+ "os"
+ "testing"
+
+ "github.com/openlayer-ai/openlayer-go"
+ "github.com/openlayer-ai/openlayer-go/internal/testutil"
+ "github.com/openlayer-ai/openlayer-go/option"
+ "github.com/openlayer-ai/openlayer-go/shared"
+)
+
+func TestProjectTestNewWithOptionalParams(t *testing.T) {
+ baseURL := "http://localhost:4010"
+ if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
+ baseURL = envURL
+ }
+ if !testutil.CheckTestServer(t, baseURL) {
+ return
+ }
+ client := openlayer.NewClient(
+ option.WithBaseURL(baseURL),
+ option.WithAPIKey("My API Key"),
+ )
+ _, err := client.Projects.Tests.New(
+ context.TODO(),
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ openlayer.ProjectTestNewParams{
+ Description: openlayer.F[any]("This test checks for duplicate rows in the dataset."),
+ Name: openlayer.F("No duplicate rows"),
+ Subtype: openlayer.F(openlayer.ProjectTestNewParamsSubtypeDuplicateRowCount),
+ Thresholds: openlayer.F([]openlayer.ProjectTestNewParamsThreshold{{
+ InsightName: openlayer.F(openlayer.ProjectTestNewParamsThresholdsInsightNameDuplicateRowCount),
+ InsightParameters: openlayer.F([]openlayer.ProjectTestNewParamsThresholdsInsightParameter{{
+ Name: openlayer.F("column_name"),
+ Value: openlayer.F[any]("Age"),
+ }}),
+ Measurement: openlayer.F("duplicateRowCount"),
+ Operator: openlayer.F(openlayer.ProjectTestNewParamsThresholdsOperatorLessOrEquals),
+ ThresholdMode: openlayer.F(openlayer.ProjectTestNewParamsThresholdsThresholdModeAutomatic),
+ Value: openlayer.F[openlayer.ProjectTestNewParamsThresholdsValueUnion](shared.UnionFloat(0.000000)),
+ }}),
+ Type: openlayer.F(openlayer.ProjectTestNewParamsTypeIntegrity),
+ Archived: openlayer.F(false),
+ DelayWindow: openlayer.F(0.000000),
+ EvaluationWindow: openlayer.F(3600.000000),
+ UsesMlModel: openlayer.F(false),
+ UsesProductionData: openlayer.F(false),
+ UsesReferenceDataset: openlayer.F(false),
+ UsesTrainingDataset: openlayer.F(false),
+ UsesValidationDataset: openlayer.F(true),
+ },
+ )
+ if err != nil {
+ var apierr *openlayer.Error
+ if errors.As(err, &apierr) {
+ t.Log(string(apierr.DumpRequest(true)))
+ }
+ t.Fatalf("err should be nil: %s", err.Error())
+ }
+}
+
+func TestProjectTestUpdate(t *testing.T) {
+ baseURL := "http://localhost:4010"
+ if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
+ baseURL = envURL
+ }
+ if !testutil.CheckTestServer(t, baseURL) {
+ return
+ }
+ client := openlayer.NewClient(
+ option.WithBaseURL(baseURL),
+ option.WithAPIKey("My API Key"),
+ )
+ _, err := client.Projects.Tests.Update(
+ context.TODO(),
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ openlayer.ProjectTestUpdateParams{
+ Payloads: openlayer.F([]openlayer.ProjectTestUpdateParamsPayload{{
+ ID: openlayer.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
+ Archived: openlayer.F(false),
+ Description: openlayer.F[any]("This test checks for duplicate rows in the dataset."),
+ Name: openlayer.F("No duplicate rows"),
+ Suggested: openlayer.F(openlayer.ProjectTestUpdateParamsPayloadsSuggestedFalse),
+ Thresholds: openlayer.F([]openlayer.ProjectTestUpdateParamsPayloadsThreshold{{
+ InsightName: openlayer.F(openlayer.ProjectTestUpdateParamsPayloadsThresholdsInsightNameDuplicateRowCount),
+ InsightParameters: openlayer.F([]openlayer.ProjectTestUpdateParamsPayloadsThresholdsInsightParameter{{
+ Name: openlayer.F("column_name"),
+ Value: openlayer.F[any]("Age"),
+ }}),
+ Measurement: openlayer.F("duplicateRowCount"),
+ Operator: openlayer.F(openlayer.ProjectTestUpdateParamsPayloadsThresholdsOperatorLessOrEquals),
+ ThresholdMode: openlayer.F(openlayer.ProjectTestUpdateParamsPayloadsThresholdsThresholdModeAutomatic),
+ Value: openlayer.F[openlayer.ProjectTestUpdateParamsPayloadsThresholdsValueUnion](shared.UnionFloat(0.000000)),
+ }}),
+ }}),
+ },
+ )
+ if err != nil {
+ var apierr *openlayer.Error
+ if errors.As(err, &apierr) {
+ t.Log(string(apierr.DumpRequest(true)))
+ }
+ t.Fatalf("err should be nil: %s", err.Error())
+ }
+}
+
+func TestProjectTestListWithOptionalParams(t *testing.T) {
+ baseURL := "http://localhost:4010"
+ if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
+ baseURL = envURL
+ }
+ if !testutil.CheckTestServer(t, baseURL) {
+ return
+ }
+ client := openlayer.NewClient(
+ option.WithBaseURL(baseURL),
+ option.WithAPIKey("My API Key"),
+ )
+ _, err := client.Projects.Tests.List(
+ context.TODO(),
+ "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ openlayer.ProjectTestListParams{
+ IncludeArchived: openlayer.F(true),
+ OriginVersionID: openlayer.F("3fa85f64-5717-4562-b3fc-2c963f66afa6"),
+ Page: openlayer.F(int64(1)),
+ PerPage: openlayer.F(int64(1)),
+ Suggested: openlayer.F(true),
+ Type: openlayer.F(openlayer.ProjectTestListParamsTypeIntegrity),
+ UsesProductionData: openlayer.F(true),
+ },
+ )
+ if err != nil {
+ var apierr *openlayer.Error
+ if errors.As(err, &apierr) {
+ t.Log(string(apierr.DumpRequest(true)))
+ }
+ t.Fatalf("err should be nil: %s", err.Error())
+ }
+}
diff --git a/scripts/bootstrap b/scripts/bootstrap
index 99810d3..d6ac165 100755
--- a/scripts/bootstrap
+++ b/scripts/bootstrap
@@ -13,4 +13,4 @@ fi
echo "==> Installing Go dependencies…"
-go mod tidy
+go mod tidy -e
diff --git a/shared/union.go b/shared/union.go
index c3c50a4..fc40b09 100644
--- a/shared/union.go
+++ b/shared/union.go
@@ -4,15 +4,27 @@ package shared
type UnionString string
+func (UnionString) ImplementsProjectTestNewResponseThresholdsValueUnion() {}
+func (UnionString) ImplementsProjectTestListResponseItemsThresholdsValueUnion() {}
+func (UnionString) ImplementsProjectTestNewParamsThresholdsValueUnion() {}
+func (UnionString) ImplementsProjectTestUpdateParamsPayloadsThresholdsValueUnion() {}
func (UnionString) ImplementsCommitTestResultListResponseItemsGoalThresholdsValueUnion() {}
func (UnionString) ImplementsInferencePipelineTestResultListResponseItemsGoalThresholdsValueUnion() {}
type UnionBool bool
+func (UnionBool) ImplementsProjectTestNewResponseThresholdsValueUnion() {}
+func (UnionBool) ImplementsProjectTestListResponseItemsThresholdsValueUnion() {}
+func (UnionBool) ImplementsProjectTestNewParamsThresholdsValueUnion() {}
+func (UnionBool) ImplementsProjectTestUpdateParamsPayloadsThresholdsValueUnion() {}
func (UnionBool) ImplementsCommitTestResultListResponseItemsGoalThresholdsValueUnion() {}
func (UnionBool) ImplementsInferencePipelineTestResultListResponseItemsGoalThresholdsValueUnion() {}
type UnionFloat float64
+func (UnionFloat) ImplementsProjectTestNewResponseThresholdsValueUnion() {}
+func (UnionFloat) ImplementsProjectTestListResponseItemsThresholdsValueUnion() {}
+func (UnionFloat) ImplementsProjectTestNewParamsThresholdsValueUnion() {}
+func (UnionFloat) ImplementsProjectTestUpdateParamsPayloadsThresholdsValueUnion() {}
func (UnionFloat) ImplementsCommitTestResultListResponseItemsGoalThresholdsValueUnion() {}
func (UnionFloat) ImplementsInferencePipelineTestResultListResponseItemsGoalThresholdsValueUnion() {}