Google Documents

Actions for handling Google Documents data

To use this actions you need to configure Google Cloude. See more:

Google Cloud

Module: implementation.datasources.google_docs



GoogleDocsAction

Base Google Documents action. Subclass of Action.


__init__

Arguments:

  • client (GoogleCloudClient): Google client that will be used for access.

  • name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.




GoogleDocsCreate

Create document. Subclass of GoogleDocsAction. Type of GoogleDocsAction[Dict[str, Any], Dict[str, Any]].


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "title" (str): Name of the document;

Raises:

  • Exception: If unable to create document.

Returns:

  • Dict[str, Any]: Expected keys:

    • "document_id" (str): Document ID;




GoogleDocsRead

Read document. Subclass of GoogleDocsAction. Type of GoogleDocsAction[Dict[str, Any], Dict[str, Any]].


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "document_id" (str): ID of the document. Document ID (can be found in url: https://docs.google.com/documents/d/document_id/edit#gid=0);

Raises:

  • Exception: If unable to read document.

Returns:

  • Dict[str, Any]: Expected keys:

    • "document" (Dict[str, Any]): Document;




GoogleDocsWrite

Write to document. Subclass of GoogleDocsAction. Type of GoogleDocsAction[Dict[str, Any], Dict[str, Any]].


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "document_id" (str): ID of the document. Document ID (can be found in url: https://docs.google.com/documents/d/document_id/edit#gid=0);

    • "requests" (Dict[str, Any]): Actions for updating the document. For more details see:

Raises:

  • Exception: If unable to update document.

Returns:

  • Dict[str, Any]: Expected keys:

    • "document" (Dict[str, Any]): Updated document;




GoogleDocsClientConfig

Google Documents default configuration. Subclass of GoogleCloudClientConfig.


__init__

Arguments:

  • scopes (List[str]): Access scopes. Defaults to ["https://www.googleapis.com/auth/documents"] (Read and write acess to all documents).

  • service (str): Service name. Defaults to "docs" (Google Documents service).

  • version (str): API version. Defaults to "v1".



Last updated