## List datasets

`client.Datasets.List(ctx, query) (*CursorPage[Dataset], error)`

**get** `/v5/datasets`

Return a paginated list of the account's datasets.

Archived datasets are excluded unless `include_archived` is set to true. Results can be
narrowed by `tags` and by the standard filterable parameters; a `name` filter matches as a
case-insensitive substring rather than an exact match.

### Parameters

- `query DatasetListParams`

  - `EndingBefore param.Field[string]`

  - `IncludeArchived param.Field[bool]`

  - `Limit param.Field[int64]`

  - `Name param.Field[string]`

  - `SortBy param.Field[string]`

  - `SortOrder param.Field[SortOrder]`

  - `StartingAfter param.Field[string]`

  - `Tags param.Field[[]string]`

### Returns

- `type Dataset struct{…}`

  - `ID string`

    The unique identifier of the entity.

  - `CreatedAt Time`

    The date and time when the entity was created in ISO format.

  - `CreatedBy Identity`

    The identity that created the entity.

    - `ID string`

    - `Type IdentityType`

      - `const IdentityTypeUser IdentityType = "user"`

      - `const IdentityTypeServiceAccount IdentityType = "service_account"`

    - `Object IdentityObject`

      - `const IdentityObjectIdentity IdentityObject = "identity"`

  - `CurrentVersionNum int64`

  - `Name string`

  - `Tags []string`

    The tags associated with the entity

  - `ArchivedAt Time`

    The date and time when the entity was archived in ISO format.

  - `Description string`

  - `Object DatasetObject`

    - `const DatasetObjectDataset DatasetObject = "dataset"`

### Example

```go
package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  page, err := client.Datasets.List(context.TODO(), sgpdev.DatasetListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
```

#### Response

```json
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "current_version_num": 0,
      "name": "name",
      "tags": [
        "string"
      ],
      "archived_at": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "object": "dataset"
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
```
