Files
sdk/docs/DatasetAPI.md

14 KiB

\DatasetAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
RiskCreateDataset Post /v1/dataset Declare the next version of a dataset
RiskDataset Get /v1/dataset/{name} Describe every version of one dataset
RiskDatasetLineage Get /v1/dataset/{name}/lineage Show where a version's rows came from, and whether that can still be demonstrated
RiskDatasets Get /v1/dataset List this org's datasets
RiskDeleteDataset Delete /v1/dataset/{name} Dispose of one dataset and every version of it
RiskExportDataset Get /v1/dataset/{name}/export Read a version's rows back, one page at a time
RiskMaterializeDataset Post /v1/dataset/{name}/materialize Materialise the declared version into immutable rows

RiskCreateDataset

DatasetRiskDataset RiskCreateDataset(ctx).DatasetRiskDatasetSpec(datasetRiskDatasetSpec).Execute()

Declare the next version of a dataset

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	datasetRiskDatasetSpec := *openapiclient.NewDatasetRiskDatasetSpec() // DatasetRiskDatasetSpec | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DatasetAPI.RiskCreateDataset(context.Background()).DatasetRiskDatasetSpec(datasetRiskDatasetSpec).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.RiskCreateDataset``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RiskCreateDataset`: DatasetRiskDataset
	fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.RiskCreateDataset`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiRiskCreateDatasetRequest struct via the builder pattern

Name Type Description Notes
datasetRiskDatasetSpec DatasetRiskDatasetSpec

Return type

DatasetRiskDataset

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RiskDataset

DatasetRiskDatasetVersions RiskDataset(ctx, name).Execute()

Describe every version of one dataset

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "signups" // string | Name is the dataset, from the path.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DatasetAPI.RiskDataset(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.RiskDataset``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RiskDataset`: DatasetRiskDatasetVersions
	fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.RiskDataset`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the dataset, from the path.

Other Parameters

Other parameters are passed through a pointer to a apiRiskDatasetRequest struct via the builder pattern

Name Type Description Notes

Return type

DatasetRiskDatasetVersions

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RiskDatasetLineage

DatasetRiskLineage RiskDatasetLineage(ctx, name).Version(version).Execute()

Show where a version's rows came from, and whether that can still be demonstrated

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "signups" // string | Name is the dataset, from the path.
	version := int64(1) // int64 | Version is the version to trace. Zero takes the newest published one. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DatasetAPI.RiskDatasetLineage(context.Background(), name).Version(version).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.RiskDatasetLineage``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RiskDatasetLineage`: DatasetRiskLineage
	fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.RiskDatasetLineage`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the dataset, from the path.

Other Parameters

Other parameters are passed through a pointer to a apiRiskDatasetLineageRequest struct via the builder pattern

Name Type Description Notes

version | int64 | Version is the version to trace. Zero takes the newest published one. |

Return type

DatasetRiskLineage

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RiskDatasets

DatasetRiskDatasetList RiskDatasets(ctx).Execute()

List this org's datasets

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DatasetAPI.RiskDatasets(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.RiskDatasets``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RiskDatasets`: DatasetRiskDatasetList
	fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.RiskDatasets`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiRiskDatasetsRequest struct via the builder pattern

Return type

DatasetRiskDatasetList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RiskDeleteDataset

DatasetRiskDatasetDisposal RiskDeleteDataset(ctx, name).Execute()

Dispose of one dataset and every version of it

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "signups" // string | Name is the dataset, from the path.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DatasetAPI.RiskDeleteDataset(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.RiskDeleteDataset``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RiskDeleteDataset`: DatasetRiskDatasetDisposal
	fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.RiskDeleteDataset`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the dataset, from the path.

Other Parameters

Other parameters are passed through a pointer to a apiRiskDeleteDatasetRequest struct via the builder pattern

Name Type Description Notes

Return type

DatasetRiskDatasetDisposal

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RiskExportDataset

DatasetRiskDatasetRows RiskExportDataset(ctx, name).Version(version).Split(split).Offset(offset).Limit(limit).Execute()

Read a version's rows back, one page at a time

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "signups" // string | Name is the dataset, from the path.
	version := int64(1) // int64 | Version is the version to read. Zero takes the newest published one. (optional)
	split := "train" // string | Split narrows to train, val or test. Empty reads every split. (optional)
	offset := int64(789) // int64 | Offset is where the page starts, in the version's own row order (by id, which is derived from the row and therefore stable forever). (optional)
	limit := int64(500) // int64 | Limit is how many rows to return. Zero and anything above the plane's bound take the bound. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DatasetAPI.RiskExportDataset(context.Background(), name).Version(version).Split(split).Offset(offset).Limit(limit).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.RiskExportDataset``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RiskExportDataset`: DatasetRiskDatasetRows
	fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.RiskExportDataset`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the dataset, from the path.

Other Parameters

Other parameters are passed through a pointer to a apiRiskExportDatasetRequest struct via the builder pattern

Name Type Description Notes

version | int64 | Version is the version to read. Zero takes the newest published one. | split | string | Split narrows to train, val or test. Empty reads every split. | offset | int64 | Offset is where the page starts, in the version's own row order (by id, which is derived from the row and therefore stable forever). | limit | int64 | Limit is how many rows to return. Zero and anything above the plane's bound take the bound. |

Return type

DatasetRiskDatasetRows

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RiskMaterializeDataset

DatasetRiskDataset RiskMaterializeDataset(ctx, name).Execute()

Materialise the declared version into immutable rows

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	name := "signups" // string | Name is the dataset, from the path.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.DatasetAPI.RiskMaterializeDataset(context.Background(), name).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.RiskMaterializeDataset``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `RiskMaterializeDataset`: DatasetRiskDataset
	fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.RiskMaterializeDataset`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
name string Name is the dataset, from the path.

Other Parameters

Other parameters are passed through a pointer to a apiRiskMaterializeDatasetRequest struct via the builder pattern

Name Type Description Notes

Return type

DatasetRiskDataset

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]