10BC0 docs: add generated snippets (#473) · googleapis/python-dialogflow@c0c7789 · GitHub
[go: up one dir, main page]

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

Commit c0c7789

Browse files
docs: add generated snippets (#473)
* chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: googleapis/googleapis@55b9e1e Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 62bbb7f commit c0c7789

File tree

408 files changed

+39178
-0
lines changed
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    408 files changed

    +39178
    -0
    lines changed

    google/cloud/dialogflow_v2/services/agents/async_client.py

    Lines changed: 201 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -209,6 +209,25 @@ async def get_agent(
    209209
    ) -> agent.Agent:
    210210
    r"""Retrieves the specified agent.
    211211
    212+
    .. code-block::
    213+
    214+
    from google.cloud import dialogflow_v2
    215+
    216+
    def sample_get_agent():
    217+
    # Create a client
    218+
    client = dialogflow_v2.AgentsClient()
    219+
    220+
    # Initialize request argument(s)
    221+
    request = dialogflow_v2.GetAgentRequest(
    222+
    parent="parent_value",
    223+
    )
    224+
    225+
    # Make the request
    226+
    response = client.get_agent(request=request)
    227+
    228+
    # Handle the response
    229+
    print(response)
    230+
    212231
    Args:
    213232
    request (Union[google.cloud.dialogflow_v2.types.GetAgentRequest, dict]):
    214233
    The request object. The request message for
    @@ -293,6 +312,32 @@ async def set_agent(
    293312
    queries. See the `training
    294313
    documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
    295314
    315+
    316+
    .. code-block::
    317+
    318+
    from google.cloud import dialogflow_v2
    319+
    320+
    def sample_set_agent():
    321+
    # Create a client
    322+
    client = dialogflow_v2.AgentsClient()
    323+
    324+
    # Initialize request argument(s)
    325+
    agent = dialogflow_v2.Agent()
    326+ 4204
    agent.parent = "parent_value"
    327+
    agent.display_name = "display_name_value"
    328+
    agent.default_language_code = "default_language_code_value"
    329+
    agent.time_zone = "time_zone_value"
    330+
    331+
    request = dialogflow_v2.SetAgentRequest(
    332+
    agent=agent,
    333+
    )
    334+
    335+
    # Make the request
    336+
    response = client.set_agent(request=request)
    337+
    338+
    # Handle the response
    339+
    print(response)
    340+
    296341
    Args:
    297342
    request (Union[google.cloud.dialogflow_v2.types.SetAgentRequest, dict]):
    298343
    The request object. The request message for
    @@ -373,6 +418,22 @@ async def delete_agent(
    373418
    ) -> None:
    374419
    r"""Deletes the specified agent.
    375420
    421+
    .. code-block::
    422+
    423+
    from google.cloud import dialogflow_v2
    424+
    425+
    def sample_delete_agent():
    426+
    # Create a client
    427+
    client = dialogflow_v2.AgentsClient()
    428+
    429+
    # Initialize request argument(s)
    430+
    request = dialogflow_v2.DeleteAgentRequest(
    431+
    parent="parent_value",
    432+
    )
    433+
    434+
    # Make the request
    435+
    client.delete_agent(request=request)
    436+
    376437
    Args:
    377438
    request (Union[google.cloud.dialogflow_v2.types.DeleteAgentRequest, dict]):
    378439
    The request object. The request message for
    @@ -443,6 +504,27 @@ async def search_agents(
    443504
    wildcard project collection id "-". Refer to `List
    444505
    Sub-Collections <https://cloud.google.com/apis/design/design_patterns#list_sub-collections>`__.
    445506
    507+
    508+
    .. code-block::
    509+
    510+
    from google.cloud import dialogflow_v2
    511+
    512+
    def sample_search_agents():
    513+
    # Create a client
    514+
    client = dialogflow_v2.AgentsClient()
    515+
    516+
    # Initialize request argument(s)
    517+
    request = dialogflow_v2.SearchAgentsRequest(
    518+
    parent="parent_value",
    519+
    )
    520+
    521+
    # Make the request
    522+
    page_result = client.search_agents(request=request)
    523+
    524+
    # Handle the response
    525+
    for response in page_result:
    526+
    print(response)
    527+
    446528
    Args:
    447529
    request (Union[google.cloud.dialogflow_v2.types.SearchAgentsRequest, dict]):
    448530
    The request object. The request message for
    @@ -537,6 +619,30 @@ async def train_agent(
    537619
    queries. See the `training
    538620
    documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
    539621
    622+
    623+
    .. code-block::
    624+
    625+
    from google.cloud import dialogflow_v2
    626+
    627+
    def sample_train_agent():
    628+
    # Create a client
    629+
    client = dialogflow_v2.AgentsClient()
    630+
    631+
    # Initialize request argument(s)
    632+
    request = dialogflow_v2.TrainAgentRequest(
    633+
    parent="parent_value",
    634+
    )
    635+
    636+
    # Make the request
    637+
    operation = client.train_agent(request=request)
    638+
    639+
    print("Waiting for operation to complete...")
    640+
    641+
    response = operation.result()
    642+
    643+
    # Handle the response
    644+
    print(response)
    645+
    540646
    Args:
    541647
    request (Union[google.cloud.dialogflow_v2.types.TrainAgentRequest, dict]):
    542648
    The request object. The request message for
    @@ -639,6 +745,31 @@ async def export_agent(
    639745
    - ``response``:
    640746
    [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
    641747
    748+
    749+
    .. code-block::
    750+
    751+
    from google.cloud import dialogflow_v2
    752+
    753+
    def sample_export_agent():
    754+
    # Create a client
    755+
    client = dialogflow_v2.AgentsClient()
    756+
    757+
    # Initialize request argument(s)
    758+
    request = dialogflow_v2.ExportAgentRequest(
    759+
    parent="parent_value",
    760+
    agent_uri="agent_uri_value",
    761+
    )
    762+
    763+
    # Make the request
    764+
    operation = client.export_agent(request=request)
    765+
    766+
    print("Waiting for operation to complete...")
    767+
    768+
    response = operation.result()
    769+
    770+
    # Handle the response
    771+
    print(response)
    772+
    642773
    Args:
    643774
    request (Union[google.cloud.dialogflow_v2.types.ExportAgentRequest, dict]):
    644775
    The request object. The request message for
    @@ -749,6 +880,31 @@ async def import_agent(
    749880
    queries. See the `training
    750881
    documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
    751882
    883+
    884+
    .. code-block::
    885+
    886+
    from google.cloud import dialogflow_v2
    887+
    888+
    def sample_import_agent():
    889+
    # Create a client
    890+
    client = dialogflow_v2.AgentsClient()
    891+
    892+
    # Initialize request argument(s)
    893+
    request = dialogflow_v2.ImportAgentRequest(
    894+
    agent_uri="agent_uri_value",
    895+
    parent="parent_value",
    896+
    )
    897+
    898+
    # Make the request
    899+
    operation = client.import_agent(request=request)
    900+
    901+
    print("Waiting for operation to complete...")
    902+
    903+
    response = operation.result()
    904+
    905+
    # Handle the response
    906+
    print(response)
    907+
    752908
    Args:
    753909
    request (Union[google.cloud.dialogflow_v2.types.ImportAgentRequest, dict]):
    754910
    The request object. The request message for
    @@ -845,6 +1001,31 @@ async def restore_agent(
    8451001
    queries. See the `training
    8461002
    documentation <https://cloud.google.com/dialogflow/es/docs/training>`__.
    8471003
    1004+
    1005+
    .. code-block::
    1006+
    1007+
    from google.cloud import dialogflow_v2
    1008+
    1009+
    def sample_restore_agent():
    1010+
    # Create a client
    1011+
    client = dialogflow_v2.AgentsClient()
    1012+
    1013+
    # Initialize request argument(s)
    1014+
    request = dialogflow_v2.RestoreAgentRequest(
    1015+
    agent_uri="agent_uri_value",
    1016+
    parent="parent_value",
    1017+
    )
    1018+
    1019+
    # Make the request
    1020+
    operation = client.restore_agent(request=request)
    1021+
    1022+
    print("Waiting for operation to complete...")
    1023+
    1024+
    response = operation.result()
    1025+
    1026+
    # Handle the response
    1027+
    print(response)
    1028+
    8481029
    Args:
    8491030
    request (Union[google.cloud.dialogflow_v2.types.RestoreAgentRequest, dict]):
    8501031
    The request object. The request message for
    @@ -917,6 +1098,26 @@ async def get_validation_result(
    9171098
    performed during training time and is updated
    9181099
    automatically when training is completed.
    9191100
    1101+
    1102+
    .. code-block::
    1103+
    1104+
    from google.cloud import dialogflow_v2
    1105+
    1106+
    def sample_get_validation_result():
    1107+
    # Create a client
    1108+
    client = dialogflow_v2.AgentsClient()
    1109+
    1110+
    # Initialize request argument(s)
    1111+
    request = dialogflow_v2.GetValidationResultRequest(
    1112+
    parent="parent_value",
    1113+
    )
    1114+
    1115+
    # Make the request
    1116+
    response = client.get_validation_result(request=request)
    1117+
    1118+
    # Handle the response
    1119+
    print(response)
    1120+
    9201121
    Args:
    9211122
    request (Union[google.cloud.dialogflow_v2.types.GetValidationResultRequest, dict]):
    9221123
    The request object. The request message for

    0 commit comments

    Comments
     (0)
    0