Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

docs: clarified some LRO types #387

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 44 additions & 6 deletions google/cloud/dialogflow_v2/services/agents/async_client.py
Expand Up @@ -482,6 +482,16 @@ async def train_agent(
) -> operation_async.AsyncOperation:
r"""Trains the specified agent.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

Note: You should always train an agent prior to sending it
queries. See the `training
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
Expand Down Expand Up @@ -578,6 +588,16 @@ async def export_agent(
) -> operation_async.AsyncOperation:
r"""Exports the specified agent to a ZIP file.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``:
[ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]

Args:
request (:class:`google.cloud.dialogflow_v2.types.ExportAgentRequest`):
The request object. The request message for
Expand Down Expand Up @@ -671,9 +691,18 @@ async def import_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when importing is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when importing is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down Expand Up @@ -758,9 +787,18 @@ async def restore_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when restoring is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when restoring is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down
50 changes: 44 additions & 6 deletions google/cloud/dialogflow_v2/services/agents/client.py
Expand Up @@ -674,6 +674,16 @@ def train_agent(
) -> operation.Operation:
r"""Trains the specified agent.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

Note: You should always train an agent prior to sending it
queries. See the `training
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
Expand Down Expand Up @@ -770,6 +780,16 @@ def export_agent(
) -> operation.Operation:
r"""Exports the specified agent to a ZIP file.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``:
[ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]

Args:
request (google.cloud.dialogflow_v2.types.ExportAgentRequest):
The request object. The request message for
Expand Down Expand Up @@ -863,9 +883,18 @@ def import_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when importing is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when importing is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down Expand Up @@ -951,9 +980,18 @@ def restore_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when restoring is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when restoring is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down
50 changes: 44 additions & 6 deletions google/cloud/dialogflow_v2/services/agents/transports/grpc.py
Expand Up @@ -361,6 +361,16 @@ def train_agent(

Trains the specified agent.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

Note: You should always train an agent prior to sending it
queries. See the `training
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
Expand Down Expand Up @@ -391,6 +401,16 @@ def export_agent(

Exports the specified agent to a ZIP file.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``:
[ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]

Returns:
Callable[[~.ExportAgentRequest],
~.Operation]:
Expand Down Expand Up @@ -428,9 +448,18 @@ def import_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when importing is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when importing is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down Expand Up @@ -471,9 +500,18 @@ def restore_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when restoring is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when restoring is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down
Expand Up @@ -370,6 +370,16 @@ def train_agent(

Trains the specified agent.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

Note: You should always train an agent prior to sending it
queries. See the `training
documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
Expand Down Expand Up @@ -400,6 +410,16 @@ def export_agent(

Exports the specified agent to a ZIP file.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``:
[ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]

Returns:
Callable[[~.ExportAgentRequest],
Awaitable[~.Operation]]:
Expand Down Expand Up @@ -437,9 +457,18 @@ def import_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when importing is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when importing is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down Expand Up @@ -480,9 +509,18 @@ def restore_agent(
and wait for the operation it returns in order to train
explicitly.

An operation which tracks when restoring is complete. It only
tracks when the draft agent is updated not when it is done
training.
This method is a `long-running
operation <https://cloud.google.com/dialogflow/es/docs/how/long-running-operations>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``: An empty `Struct
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct>`__
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

The operation only tracks when restoring is complete, not when
it is done training.

Note: You should always train an agent prior to sending it
queries. See the `training
Expand Down
47 changes: 34 additions & 13 deletions google/cloud/dialogflow_v2/services/documents/async_client.py
Expand Up @@ -334,9 +334,14 @@ async def create_document(
) -> operation_async.AsyncOperation:
r"""Creates a new document.

Operation <response:
[Document][google.cloud.dialogflow.v2.Document], metadata:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
This method is a `long-running
operation <https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
- ``response``: [Document][google.cloud.dialogflow.v2.Document]

Args:
request (:class:`google.cloud.dialogflow_v2.types.CreateDocumentRequest`):
Expand Down Expand Up @@ -436,9 +441,15 @@ async def delete_document(
) -> operation_async.AsyncOperation:
r"""Deletes the specified document.

Operation <response:
[google.protobuf.Empty][google.protobuf.Empty], metadata:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
This method is a `long-running
operation <https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
- ``response``: An `Empty
message <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty>`__

Args:
request (:class:`google.cloud.dialogflow_v2.types.DeleteDocumentRequest`):
Expand Down Expand Up @@ -533,9 +544,14 @@ async def update_document(
) -> operation_async.AsyncOperation:
r"""Updates the specified document.

Operation <response:
[Document][google.cloud.dialogflow.v2.Document], metadata:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
This method is a `long-running
operation <https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
- ``response``: [Document][google.cloud.dialogflow.v2.Document]

Args:
request (:class:`google.cloud.dialogflow_v2.types.UpdateDocumentRequest`):
Expand Down Expand Up @@ -642,13 +658,18 @@ async def reload_document(
document has not changed, there still may be side effects
because of internal implementation changes.

This method is a `long-running
operation <https://cloud.google.com/dialogflow/cx/docs/how/long-running-operation>`__.
The returned ``Operation`` type has the following
method-specific fields:

- ``metadata``:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]
- ``response``: [Document][google.cloud.dialogflow.v2.Document]

Note: The ``projects.agent.knowledgeBases.documents`` resource
is deprecated; only use ``projects.knowledgeBases.documents``.

Operation <response:
[Document][google.cloud.dialogflow.v2.Document], metadata:
[KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>

Args:
request (:class:`google.cloud.dialogflow_v2.types.ReloadDocumentRequest`):
The request object. Request message for
Expand Down