REST Resource: notebooks.sources

Resource: Source

Represents a source resource in Gemini Notebook.

JSON representation
{
  "name": string,
  "displayName": string,
  "mimeType": string,
  "state": enum (State),
  "createTime": string,
  "error": {
    object (Status)
  },
  "originalUrl": string,

  // Union field input_spec can be only one of the following:
  "webContent": {
    object (WebContent)
  },
  "textContent": {
    object (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. 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 (State)

Output only. The current state of the source.

createTime

string (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 (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 (WebContent)

A source from a web page.

textContent

object (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. 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.

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 google.rpc.Status.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

create

Creates a new source.

get

Gets a specific source.

list

Lists sources in a notebook.