- [Resource: Source](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#Source)
  - [JSON representation](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#Source.SCHEMA_REPRESENTATION)
- [WebContent](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#WebContent)
  - [JSON representation](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#WebContent.SCHEMA_REPRESENTATION)
- [TextContent](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#TextContent)
  - [JSON representation](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#TextContent.SCHEMA_REPRESENTATION)
- [State](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#State)
- [Status](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#Status)
  - [JSON representation](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#Status.SCHEMA_REPRESENTATION)
- [Methods](https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#METHODS_SUMMARY)

## Resource: Source

Represents a source resource in Gemini Notebook.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "mimeType": string, "state": enum (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#State`), "createTime": string, "error": { object (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#Status`) }, "originalUrl": string, // Union field `input_spec` can be only one of the following: "webContent": { object (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#WebContent`) }, "textContent": { object (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#TextContent`) } // End of list of possible types for union field `input_spec`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Identifier. The resource name of the source. Format: `notebooks/{notebook}/sources/{source}` |
| `displayName` | `string` Optional. The display name of the source. |
| `mimeType` | `string` Optional. The original MIME type of the source, as an [IANA media type](https://www.iana.org/assignments/media-types/media-types.xhtml). For `textContent` sources, supported values are `text/plain` and `text/markdown`; other values are rejected with `INVALID_ARGUMENT`. If unset, the format is detected automatically. On output, populated by the server (such as `text/html` for web URLs or `video/vnd.youtube.yt` for YouTube videos). |
| `state` | ``enum (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#State`)`` Output only. The current state of the source. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. Timestamp when the source was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `error` | ``object (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#Status`)`` Output only. The error status of the source if it is in FAILED state. |
| `originalUrl` | `string` Output only. The original URL of the source, if applicable. |
| Union field `input_spec`. Input content for creating a source. `input_spec` can be only one of the following: ||
| `webContent` | ``object (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#WebContent`)`` A source from a web page. |
| `textContent` | ``object (`https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#TextContent`)`` A source from plain text. |

## WebContent

Models a source from a web page.

| JSON representation |
|---|
| ``` { "url": string } ``` |

| Fields ||
|---|---|
| `url` | `string` Required. The URL of the web page to process. |

## TextContent

Models a source from text-based content.

| JSON representation |
|---|
| ``` { "content": string } ``` |

| Fields ||
|---|---|
| `content` | `string` Required. The text content. The format of this content (e.g., `text/plain`, `text/markdown`) can be specified in the `Source.mime_type` field. |

## State

The state of the source.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | State is unspecified. |
| `PROCESSING` | The source is being processed. |
| `ACTIVE` | The source is active and ready for use. |
| `FAILED` | The source failed to be processed. |
| `DELETING` | The source is being deleted. |

## Status

The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details.

You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).

| JSON representation |
|---|
| ``` { "code": integer, "message": string, "details": [ { "@type": string, field1: ..., ... } ] } ``` |

| Fields ||
|---|---|
| `code` | `integer` The status code, which should be an enum value of `google.rpc.Code`. |
| `message` | `string` A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the `https://developers.google.com/notebook/reference/rest/v1/notebooks.sources#Status.FIELDS.details` field, or localized by the client. |
| `details[]` | `object` A list of messages that carry the error details. There is a common set of message types for APIs to use. An object containing fields of an arbitrary type. An additional field `"@type"` contains a URI identifying the type. Example: `{ "id": 1234, "@type": "types.example.com/standard/id" }`. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/notebook/reference/rest/v1/notebooks.sources/create` | Creates a new source. |
| ### `https://developers.google.com/notebook/reference/rest/v1/notebooks.sources/get` | Gets a specific source. |
| ### `https://developers.google.com/notebook/reference/rest/v1/notebooks.sources/list` | Lists sources in a notebook. |