Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 5938750

Browse files
feat(v3beta1): added GitIntegrationSettings to the Agent (#531)
* feat: added GitIntegrationSettings to the Agent PiperOrigin-RevId: 546355900 Source-Link: googleapis/googleapis@dc3d3a2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2480a9f8bfbc7987f583d70e199584a46b52133f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjQ4MGE5ZjhiZmJjNzk4N2Y1ODNkNzBlMTk5NTg0YTQ2YjUyMTMzZiJ9 * 🦉 Updates from OwlBot post-processor 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 f0d0deb commit 5938750

File tree

9 files changed

+185
-9
lines changed

9 files changed

+185
-9
lines changed

google/cloud/dialogflowcx_v3beta1/services/test_cases/async_client.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,9 @@ async def list_test_case_results(
12901290
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12911291
metadata: Sequence[Tuple[str, str]] = (),
12921292
) -> pagers.ListTestCaseResultsAsyncPager:
1293-
r"""Fetches a list of results for a given test case.
1293+
r"""Fetches the list of run results for the given test
1294+
case. A maximum of 100 results are kept for each test
1295+
case.
12941296
12951297
.. code-block:: python
12961298

google/cloud/dialogflowcx_v3beta1/services/test_cases/client.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,9 @@ def list_test_case_results(
17261726
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17271727
metadata: Sequence[Tuple[str, str]] = (),
17281728
) -> pagers.ListTestCaseResultsPager:
1729-
r"""Fetches a list of results for a given test case.
1729+
r"""Fetches the list of run results for the given test
1730+
case. A maximum of 100 results are kept for each test
1731+
case.
17301732
17311733
.. code-block:: python
17321734

google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,9 @@ def list_test_case_results(
567567
]:
568568
r"""Return a callable for the list test case results method over gRPC.
569569
570-
Fetches a list of results for a given test case.
570+
Fetches the list of run results for the given test
571+
case. A maximum of 100 results are kept for each test
572+
case.
571573
572574
Returns:
573575
Callable[[~.ListTestCaseResultsRequest],

google/cloud/dialogflowcx_v3beta1/services/test_cases/transports/grpc_asyncio.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,9 @@ def list_test_case_results(
586586
]:
587587
r"""Return a callable for the list test case results method over gRPC.
588588
589-
Fetches a list of results for a given test case.
589+
Fetches the list of run results for the given test
590+
case. A maximum of 100 results are kept for each test
591+
case.
590592
591593
Returns:
592594
Callable[[~.ListTestCaseResultsRequest],

google/cloud/dialogflowcx_v3beta1/types/agent.py

+133-1
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,75 @@ class Agent(proto.Message):
142142
agent. The settings exposed at the lower level
143143
overrides the settings exposed at the higher
144144
level.
145+
git_integration_settings (google.cloud.dialogflowcx_v3beta1.types.Agent.GitIntegrationSettings):
146+
Git integration settings for this agent.
145147
text_to_speech_settings (google.cloud.dialogflowcx_v3beta1.types.TextToSpeechSettings):
146148
Settings on instructing the speech
147149
synthesizer on how to generate the output audio
148150
content.
149151
"""
150152

153+
class GitIntegrationSettings(proto.Message):
154+
r"""Settings for connecting to Git repository for an agent.
155+
156+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
157+
158+
Attributes:
159+
github_settings (google.cloud.dialogflowcx_v3beta1.types.Agent.GitIntegrationSettings.GithubSettings):
160+
GitHub settings.
161+
162+
This field is a member of `oneof`_ ``git_settings``.
163+
"""
164+
165+
class GithubSettings(proto.Message):
166+
r"""Settings of integration with GitHub.
167+
168+
Attributes:
169+
display_name (str):
170+
The unique repository display name for the
171+
GitHub repository.
172+
repository_uri (str):
173+
The GitHub repository URI related to the
174+
agent.
175+
tracking_branch (str):
176+
The branch of the GitHub repository tracked
177+
for this agent.
178+
access_token (str):
179+
The access token used to authenticate the
180+
access to the GitHub repository.
181+
branches (MutableSequence[str]):
182+
A list of branches configured to be used from
183+
Dialogflow.
184+
"""
185+
186+
display_name: str = proto.Field(
187+
proto.STRING,
188+
number=1,
189+
)
190+
repository_uri: str = proto.Field(
191+
proto.STRING,
192+
number=2,
193+
)
194+
tracking_branch: str = proto.Field(
195+
proto.STRING,
196+
number=3,
197+
)
198+
access_token: str = proto.Field(
199+
proto.STRING,
200+
number=4,
201+
)
202+
branches: MutableSequence[str] = proto.RepeatedField(
203+
proto.STRING,
204+
number=5,
205+
)
206+
207+
github_settings: "Agent.GitIntegrationSettings.GithubSettings" = proto.Field(
208+
proto.MESSAGE,
209+
number=1,
210+
oneof="git_settings",
211+
message="Agent.GitIntegrationSettings.GithubSettings",
212+
)
213+
151214
name: str = proto.Field(
152215
proto.STRING,
153216
number=1,
@@ -206,6 +269,11 @@ class Agent(proto.Message):
206269
number=22,
207270
message=gcdc_advanced_settings.AdvancedSettings,
208271
)
272+
git_integration_settings: GitIntegrationSettings = proto.Field(
273+
proto.MESSAGE,
274+
number=30,
275+
message=GitIntegrationSettings,
276+
)
209277
text_to_speech_settings: audio_config.TextToSpeechSettings = proto.Field(
210278
proto.MESSAGE,
211279
number=31,
@@ -379,6 +447,9 @@ class ExportAgentRequest(proto.Message):
379447
Optional. Environment name. If not set, draft environment is
380448
assumed. Format:
381449
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID>``.
450+
git_destination (google.cloud.dialogflowcx_v3beta1.types.ExportAgentRequest.GitDestination):
451+
Optional. The Git branch to export the agent
452+
to.
382453
include_bigquery_export_settings (bool):
383454
Optional. Whether to include BigQuery Export
384455
setting.
@@ -400,6 +471,25 @@ class DataFormat(proto.Enum):
400471
BLOB = 1
401472
JSON_PACKAGE = 4
402473

474+
class GitDestination(proto.Message):
475+
r"""Settings for exporting to a git branch.
476+
477+
Attributes:
478+
tracking_branch (str):
479+
Tracking branch for the git push.
480+
commit_message (str):
481+
Commit message for the git push.
482+
"""
483+
484+
tracking_branch: str = proto.Field(
485+
proto.STRING,
486+
number=1,
487+
)
488+
commit_message: str = proto.Field(
489+
proto.STRING,
490+
number=2,
491+
)
492+
403493
name: str = proto.Field(
404494
proto.STRING,
405495
number=1,
@@ -417,6 +507,11 @@ class DataFormat(proto.Enum):
417507
proto.STRING,
418508
number=5,
419509
)
510+
git_destination: GitDestination = proto.Field(
511+
proto.MESSAGE,
512+
number=6,
513+
message=GitDestination,
514+
)
420515
include_bigquery_export_settings: bool = proto.Field(
421516
proto.BOOL,
422517
number=7,
@@ -442,7 +537,16 @@ class ExportAgentResponse(proto.Message):
442537
443538
This field is a member of `oneof`_ ``agent``.
444539
agent_content (bytes):
445-
Uncompressed raw byte content for agent.
540+
Uncompressed raw byte content for agent. This field is
541+
populated if none of ``agent_uri`` and ``git_destination``
542+
are specified in
543+
[ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
544+
545+
This field is a member of `oneof`_ ``agent``.
546+
commit_sha (str):
547+
Commit SHA of the git push. This field is populated if
548+
``git_destination`` is specified in
549+
[ExportAgentRequest][google.cloud.dialogflow.cx.v3beta1.ExportAgentRequest].
446550
447551
This field is a member of `oneof`_ ``agent``.
448552
"""
@@ -457,6 +561,11 @@ class ExportAgentResponse(proto.Message):
457561
number=2,
458562
oneof="agent",
459563
)
564+
commit_sha: str = proto.Field(
565+
proto.STRING,
566+
number=3,
567+
oneof="agent",
568+
)
460569

461570

462571
class RestoreAgentRequest(proto.Message):
@@ -490,6 +599,10 @@ class RestoreAgentRequest(proto.Message):
490599
agent_content (bytes):
491600
Uncompressed raw byte content for agent.
492601
602+
This field is a member of `oneof`_ ``agent``.
603+
git_source (google.cloud.dialogflowcx_v3beta1.types.RestoreAgentRequest.GitSource):
604+
Setting for restoring from a git branch
605+
493606
This field is a member of `oneof`_ ``agent``.
494607
restore_option (google.cloud.dialogflowcx_v3beta1.types.RestoreAgentRequest.RestoreOption):
495608
Agent restore mode. If not specified, ``KEEP`` is assumed.
@@ -514,6 +627,19 @@ class RestoreOption(proto.Enum):
514627
KEEP = 1
515628
FALLBACK = 2
516629

630+
class GitSource(proto.Message):
631+
r"""Settings for restoring from a git branch
632+
633+
Attributes:
634+
tracking_branch (str):
635+
tracking branch for the git pull
636+
"""
637+
638+
tracking_branch: str = proto.Field(
639+
proto.STRING,
640+
number=1,
641+
)
642+
517643
name: str = proto.Field(
518644
proto.STRING,
519645
number=1,
@@ -528,6 +654,12 @@ class RestoreOption(proto.Enum):
528654
number=3,
529655
oneof="agent",
530656
)
657+
git_source: GitSource = proto.Field(
658+
proto.MESSAGE,
659+
number=6,
660+
oneof="agent",
661+
message=GitSource,
662+
)
531663
restore_option: RestoreOption = proto.Field(
532664
proto.ENUM,
533665
number=5,

samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-dialogflow-cx",
11-
"version": "1.23.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.dialogflow.cx.v3beta1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-dialogflow-cx",
11-
"version": "1.23.1"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

scripts/fixup_dialogflowcx_v3beta1_keywords.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class dialogflowcxCallTransformer(cst.CSTTransformer):
7070
'delete_webhook': ('name', 'force', ),
7171
'deploy_flow': ('environment', 'flow_version', ),
7272
'detect_intent': ('session', 'query_input', 'query_params', 'output_audio_config', ),
73-
'export_agent': ('name', 'agent_uri', 'data_format', 'environment', 'include_bigquery_export_settings', ),
73+
'export_agent': ('name', 'agent_uri', 'data_format', 'environment', 'git_destination', 'include_bigquery_export_settings', ),
7474
'export_flow': ('name', 'flow_uri', 'include_referenced_flows', ),
7575
'export_test_cases': ('parent', 'gcs_uri', 'data_format', 'filter', ),
7676
'fulfill_intent': ('match_intent_request', 'match', 'output_audio_config', ),
@@ -114,7 +114,7 @@ class dialogflowcxCallTransformer(cst.CSTTransformer):
114114
'load_version': ('name', 'allow_override_agent_resources', ),
115115
'lookup_environment_history': ('name', 'page_size', 'page_token', ),
116116
'match_intent': ('session', 'query_input', 'query_params', 'persist_parameter_changes', ),
117-
'restore_agent': ('name', 'agent_uri', 'agent_content', 'restore_option', ),
117+
'restore_agent': ('name', 'agent_uri', 'agent_content', 'git_source', 'restore_option', ),
118118
'run_continuous_test': ('environment', ),
119119
'run_test_case': ('name', 'environment', ),
120120
'start_experiment': ('name', ),

tests/unit/gapic/dialogflowcx_v3beta1/test_agents.py

+36
Original file line numberDiff line numberDiff line change
@@ -3492,6 +3492,15 @@ def test_create_agent_rest(request_type):
34923492
"enable_interaction_logging": True,
34933493
},
34943494
},
3495+
"git_integration_settings": {
3496+
"github_settings": {
3497+
"display_name": "display_name_value",
3498+
"repository_uri": "repository_uri_value",
3499+
"tracking_branch": "tracking_branch_value",
3500+
"access_token": "access_token_value",
3501+
"branches": ["branches_value1", "branches_value2"],
3502+
}
3503+
},
34953504
"text_to_speech_settings": {"synthesize_speech_configs": {}},
34963505
}
34973506
request = request_type(**request_init)
@@ -3718,6 +3727,15 @@ def test_create_agent_rest_bad_request(
37183727
"enable_interaction_logging": True,
37193728
},
37203729
},
3730+
"git_integration_settings": {
3731+
"github_settings": {
3732+
"display_name": "display_name_value",
3733+
"repository_uri": "repository_uri_value",
3734+
"tracking_branch": "tracking_branch_value",
3735+
"access_token": "access_token_value",
3736+
"branches": ["branches_value1", "branches_value2"],
3737+
}
3738+
},
37213739
"text_to_speech_settings": {"synthesize_speech_configs": {}},
37223740
}
37233741
request = request_type(**request_init)
@@ -3839,6 +3857,15 @@ def test_update_agent_rest(request_type):
38393857
"enable_interaction_logging": True,
38403858
},
38413859
},
3860+
"git_integration_settings": {
3861+
"github_settings": {
3862+
"display_name": "display_name_value",
3863+
"repository_uri": "repository_uri_value",
3864+
"tracking_branch": "tracking_branch_value",
3865+
"access_token": "access_token_value",
3866+
"branches": ["branches_value1", "branches_value2"],
3867+
}
3868+
},
38423869
"text_to_speech_settings": {"synthesize_speech_configs": {}},
38433870
}
38443871
request = request_type(**request_init)
@@ -4056,6 +4083,15 @@ def test_update_agent_rest_bad_request(
40564083
"enable_interaction_logging": True,
40574084
},
40584085
},
4086+
"git_integration_settings": {
4087+
"github_settings": {
4088+
"display_name": "display_name_value",
4089+
"repository_uri": "repository_uri_value",
4090+
"tracking_branch": "tracking_branch_value",
4091+
"access_token": "access_token_value",
4092+
"branches": ["branches_value1", "branches_value2"],
4093+
}
4094+
},
40594095
"text_to_speech_settings": {"synthesize_speech_configs": {}},
40604096
}
40614097
request = request_type(**request_init)

0 commit comments

Comments
 (0)