# REST Resource: projects.datasets

- [Resource: Dataset](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Dataset)
  - [JSON representation](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Dataset.SCHEMA_REPRESENTATION)
- [Usage](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Usage)
- [LocalFileSource](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource)
  - [JSON representation](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource.SCHEMA_REPRESENTATION)
- [FileFormat](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#FileFormat)
- [GcsSource](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource)
  - [JSON representation](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource.SCHEMA_REPRESENTATION)
- [Status](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Status)
  - [JSON representation](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Status.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#State)
- [Methods](https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#METHODS_SUMMARY)

## Resource: Dataset

A representation of a dataset resource.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "description": string, "versionId": string, "usage": [ enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Usage`) ], "status": { object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Status`) }, "createTime": string, "updateTime": string, "versionCreateTime": string, "versionDescription": string, // Union field `data_source` can be only one of the following: "localFileSource": { object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource`) }, "gcsSource": { object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource`) } // End of list of possible types for union field `data_source`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Resource name. Format: projects/{project}/datasets/{datasetId} |
| `displayName` | `string` Human readable name, shown in the console UI. Must be unique within a project. |
| `description` | `string` A description of this dataset. |
| `versionId` | `string` The version ID of the dataset. |
| `usage[]` | ``enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Usage`)`` Specified use case for this dataset. |
| `status` | ``object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#Status`)`` Output only. The status of this dataset version. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. Time when the dataset was first created. |
| `updateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. Time when the dataset metadata was last updated. |
| `versionCreateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. Time when this version was created. |
| `versionDescription` | `string` Output only. The description for this version of dataset. It is provided when importing data to the dataset. |
| Union field `data_source`. Details about the source of the data for the dataset. `data_source` can be only one of the following: ||
| `localFileSource` | ``object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#LocalFileSource`)`` A local file source for the dataset for a single upload. |
| `gcsSource` | ``object (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#GcsSource`)`` A Google Cloud Storage file source for the dataset for a single upload. |

## Usage

Usage specifies where the data is intended to be used to inform how to process the data.

| Enums ||
|---|---|
| `USAGE_UNSPECIFIED` | The usage of this dataset is not set. |
| `USAGE_DATA_DRIVEN_STYLING` | This dataset will be used for data driven styling. |

## LocalFileSource

The details about the data source when it is a local file.

| JSON representation |
|---|
| ``` { "filename": string, "fileFormat": enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#FileFormat`) } ``` |

| Fields ||
|---|---|
| `filename` | `string` The file name of the uploaded file. |
| `fileFormat` | ``enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#FileFormat`)`` The format of the file that is being uploaded. |

## FileFormat

The format of the file being uploaded.

| Enums ||
|---|---|
| `FILE_FORMAT_UNSPECIFIED` | Unspecified file format. |
| `FILE_FORMAT_GEOJSON` | GeoJson file. |
| `FILE_FORMAT_KML` | KML file. |
| `FILE_FORMAT_CSV` | CSV file. |

## GcsSource

The details about the data source when it is in Google Cloud Storage.

| JSON representation |
|---|
| ``` { "inputUri": string, "fileFormat": enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#FileFormat`) } ``` |

| Fields ||
|---|---|
| `inputUri` | `string` Source data URI. For example, `gs://my_bucket/my_object`. |
| `fileFormat` | ``enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#FileFormat`)`` The file format of the Google Cloud Storage object. This is used mainly for validation. |

## Status

Status of the dataset.

| JSON representation |
|---|
| ``` { "state": enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#State`), "errorMessage": string } ``` |

| Fields ||
|---|---|
| `state` | ``enum (`https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets#State`)`` State enum for status. |
| `errorMessage` | `string` Error message indicating reason of failure. It is empty if the datasets is not in a failed state. |

## State

A list of states for the dataset.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | The state of this dataset is not set. |
| `STATE_IMPORTING` | Data is being imported to a dataset. |
| `STATE_IMPORT_SUCCEEDED` | Importing data to a dataset succeeded. |
| `STATE_IMPORT_FAILED` | Importing data to a dataset failed. |
| `STATE_DELETING` | The dataset is in the process of getting deleted. |
| `STATE_DELETION_FAILED` | The deletion failed state. This state represents that dataset deletion has failed. Deletion may be retried. |
| `STATE_PROCESSING` | Data is being processed. |
| `STATE_PROCESSING_FAILED` | The processing failed state. This state represents that processing has failed and may report errors. |
| `STATE_NEEDS_REVIEW` | This state is currently not used. |
| `STATE_PUBLISHING` | The publishing state. This state represents the publishing is in progress. |
| `STATE_PUBLISHING_FAILED` | The publishing failed states. This state represents that the publishing failed. Publishing may be retried. |
| `STATE_COMPLETED` | The completed state. This state represents the dataset being available for its specific usage. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets/create` | Creates a new dataset for the specified project. |
| ### `https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets/delete` | Deletes the specified dataset. |
| ### `https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets/fetchDatasetErrors` | Gets all the errors of a dataset. |
| ### `https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets/get` | Gets the dataset. |
| ### `https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets/list` | Lists all the datasets for the specified project. |
| ### `https://developers.google.com/maps/documentation/datasets/reference/rest/v1/projects.datasets/patch` | Updates the metadata for the dataset. |