# Discovery Engine API . projects . locations . dataStores . branches . documents . chunks

## Instance Methods

Close httplib2 connections.

Gets a Document.

Gets a list of Chunks.

Retrieves the next page of results.

### Method Details

`close()`

    Close httplib2 connections.

`get(name, x__xgafv=None)`

    Gets a Document.

    Args:
      name: string, Required. Full resource name of Chunk, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}`. If the caller does not have permission to access the Chunk, regardless of whether or not it exists, a `PERMISSION_DENIED` error is returned. If the requested Chunk does not exist, a `NOT_FOUND` error is returned. (required)
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode.
      "annotationContents": [ # Output only. Annotation contents if the current chunk contains annotations.
        "A String",
      ],
      "annotationMetadata": [ # Output only. The annotation metadata includes structured content in the current chunk.
        { # The annotation metadata includes structured content in the current chunk.
          "imageId": "A String", # Output only. Image id is provided if the structured content is based on an image.
          "structuredContent": { # The structured content information. # Output only. The structured content information.
            "content": "A String", # Output only. The content of the structured content.
            "structureType": "A String", # Output only. The structure type of the structured content.
          },
        },
      ],
      "chunkMetadata": { # Metadata of the current chunk. This field is only populated on SearchService.Search API. # Output only. Metadata of the current chunk.
        "nextChunks": [ # The next chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is only populated on SearchService.Search API.
          # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
        ],
        "previousChunks": [ # The previous chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field is only populated on SearchService.Search API.
          # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
        ],
      },
      "content": "A String", # Content is a string from a document (parsed content).
      "dataUrls": [ # Output only. Image Data URLs if the current chunk contains images. Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:,
        "A String",
      ],
      "derivedStructData": { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
        "a_key": "", # Properties of the object.
      },
      "documentMetadata": { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
        "mimeType": "A String", # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
        "structData": { # Data representation. The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
          "a_key": "", # Properties of the object.
        },
        "title": "A String", # Title of the document.
        "uri": "A String", # Uri of the document.
      },
      "id": "A String", # Unique chunk ID of the current chunk.
      "name": "A String", # The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
      "pageSpan": { # Page span of the chunk. # Page span of the chunk.
        "pageEnd": 42, # The end page of the chunk.
        "pageStart": 42, # The start page of the chunk.
      },
      "relevanceScore": 3.14, # Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse.
    }

`list(parent, pageSize=None, pageToken=None, x__xgafv=None)`

    Gets a list of Chunks.

    Args:
      parent: string, Required. The parent document resource name, such as `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`. If the caller does not have permission to list Chunks under this document, regardless of whether or not this document exists, a `PERMISSION_DENIED` error is returned. (required)
      pageSize: integer, Maximum number of Chunks to return. If unspecified, defaults to 100. The maximum allowed value is 1000. Values above 1000 will be coerced to 1000. If this field is negative, an `INVALID_ARGUMENT` error is returned.
      pageToken: string, A page token ListChunksResponse.next_page_token, received from a previous ChunkService.ListChunks call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ChunkService.ListChunks must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response message for ChunkService.ListChunks method.
      "chunks": [ # The Chunks.
        { # Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode.
          "annotationContents": [ # Output only. Annotation contents if the current chunk contains annotations.
            "A String",
          ],
          "annotationMetadata": [ # Output only. The annotation metadata includes structured content in the current chunk.
            { # The annotation metadata includes structured content in the current chunk.
              "imageId": "A String", # Output only. Image id is provided if the structured content is based on an image.
              "structuredContent": { # The structured content information. # Output only. The structured content information.
                "content": "A String", # Output only. The content of the structured content.
                "structureType": "A String", # Output only. The structure type of the structured content.
              },
            },
          ],
          "chunkMetadata": { # Metadata of the current chunk. This field is only populated on SearchService.Search API. # Output only. Metadata of the current chunk.
            "nextChunks": [ # The next chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is only populated on SearchService.Search API.
              # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
            ],
            "previousChunks": [ # The previous chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field is only populated on SearchService.Search API.
              # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
            ],
          },
          "content": "A String", # Content is a string from a document (parsed content).
          "dataUrls": [ # Output only. Image Data URLs if the current chunk contains images. Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:,
            "A String",
          ],
          "derivedStructData": { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
            "a_key": "", # Properties of the object.
          },
          "documentMetadata": { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
            "mimeType": "A String", # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
            "structData": { # Data representation. The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
              "a_key": "", # Properties of the object.
            },
            "title": "A String", # Title of the document.
            "uri": "A String", # Uri of the document.
          },
          "id": "A String", # Unique chunk ID of the current chunk.
          "name": "A String", # The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
          "pageSpan": { # Page span of the chunk. # Page span of the chunk.
            "pageEnd": 42, # The end page of the chunk.
            "pageStart": 42, # The start page of the chunk.
          },
          "relevanceScore": 3.14, # Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse.
        },
      ],
      "nextPageToken": "A String", # A token that can be sent as ListChunksRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
    }

`list_next()`

    Retrieves the next page of results.

            Args:
              previous_request: The request for the previous page. (required)
              previous_response: The response from the request for the previous page. (required)

            Returns:
              A request object that you can call 'execute()' on to request the next
              page. Returns None if there are no more items in the collection.