Create a new dataset (admin only)
client.Datasets.New(ctx, body) (*Dataset, error)
POST/api/v1/datasets
Create a new dataset (admin only)
package main
import (
"context"
"fmt"
"github.com/plazafyi/plaza-go"
"github.com/plazafyi/plaza-go/option"
)
func main() {
client := githubcomplazafyiplazago.NewClient(
option.WithAPIKey("My API Key"),
)
dataset, err := client.Datasets.New(context.TODO(), githubcomplazafyiplazago.DatasetNewParams{
Name: githubcomplazafyiplazago.F("name"),
Slug: githubcomplazafyiplazago.F("slug"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", dataset.ID)
}
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"inserted_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"attribution": "attribution",
"description": "description",
"license": "license",
"source_url": "source_url"
}Returns Examples
{
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"inserted_at": "2019-12-27T18:11:19.117Z",
"name": "name",
"slug": "slug",
"updated_at": "2019-12-27T18:11:19.117Z",
"attribution": "attribution",
"description": "description",
"license": "license",
"source_url": "source_url"
}