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

Commit 81d4f53

Browse files
1 parent 750a055 commit 81d4f53

File tree

11 files changed

+1416
-27
lines changed

11 files changed

+1416
-27
lines changed

google/cloud/dialogflowcx_v3beta1/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,20 @@
7373
from .types.entity_type import ListEntityTypesRequest
7474
from .types.entity_type import ListEntityTypesResponse
7575
from .types.entity_type import UpdateEntityTypeRequest
76+
from .types.environment import ContinuousTestResult
7677
from .types.environment import CreateEnvironmentRequest
7778
from .types.environment import DeleteEnvironmentRequest
7879
from .types.environment import Environment
7980
from .types.environment import GetEnvironmentRequest
81+
from .types.environment import ListContinuousTestResultsRequest
82+
from .types.environment import ListContinuousTestResultsResponse
8083
from .types.environment import ListEnvironmentsRequest
8184
from .types.environment import ListEnvironmentsResponse
8285
from .types.environment import LookupEnvironmentHistoryRequest
8386
from .types.environment import LookupEnvironmentHistoryResponse
87+
from .types.environment import RunContinuousTestMetadata
88+
from .types.environment import RunContinuousTestRequest
89+
from .types.environment import RunContinuousTestResponse
8490
from .types.environment import UpdateEnvironmentRequest
8591
from .types.experiment import CreateExperimentRequest
8692
from .types.experiment import DeleteExperimentRequest
@@ -252,6 +258,7 @@
252258
"BatchRunTestCasesResponse",
253259
"CalculateCoverageRequest",
254260
"CalculateCoverageResponse",
261+
"ContinuousTestResult",
255262
"ConversationTurn",
256263
"CreateAgentRequest",
257264
"CreateEntityTypeRequest",
@@ -333,6 +340,8 @@
333340
"IntentsClient",
334341
"ListAgentsRequest",
335342
"ListAgentsResponse",
343+
"ListContinuousTestResultsRequest",
344+
"ListContinuousTestResultsResponse",
336345
"ListEntityTypesRequest",
337346
"ListEntityTypesResponse",
338347
"ListEnvironmentsRequest",
@@ -377,6 +386,9 @@
377386
"ResourceName",
378387
"ResponseMessage",
379388
"RestoreAgentRequest",
389+
"RunContinuousTestMetadata",
390+
"RunContinuousTestRequest",
391+
"RunContinuousTestResponse",
380392
"RunTestCaseMetadata",
381393
"RunTestCaseRequest",
382394
"RunTestCaseResponse",

google/cloud/dialogflowcx_v3beta1/gapic_metadata.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@
193193
"get_environment"
194194
]
195195
},
196+
"ListContinuousTestResults": {
197+
"methods": [
198+
"list_continuous_test_results"
199+
]
200+
},
196201
"ListEnvironments": {
197202
"methods": [
198203
"list_environments"
@@ -203,6 +208,11 @@
203208
"lookup_environment_history"
204209
]
205210
},
211+
"RunContinuousTest": {
212+
"methods": [
213+
"run_continuous_test"
214+
]
215+
},
206216
"UpdateEnvironment": {
207217
"methods": [
208218
"update_environment"
@@ -228,6 +238,11 @@
228238
"get_environment"
229239
]
230240
},
241+
"ListContinuousTestResults": {
242+
"methods": [
243+
"list_continuous_test_results"
244+
]
245+
},
231246
"ListEnvironments": {
232247
"methods": [
233248
"list_environments"
@@ -238,6 +253,11 @@
238253
"lookup_environment_history"
239254
]
240255
},
256+
"RunContinuousTest": {
257+
"methods": [
258+
"run_continuous_test"
259+
]
260+
},
241261
"UpdateEnvironment": {
242262
"methods": [
243263
"update_environment"

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

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,18 @@ class EnvironmentsAsyncClient:
4949
DEFAULT_ENDPOINT = EnvironmentsClient.DEFAULT_ENDPOINT
5050
DEFAULT_MTLS_ENDPOINT = EnvironmentsClient.DEFAULT_MTLS_ENDPOINT
5151

52+
continuous_test_result_path = staticmethod(
53+
EnvironmentsClient.continuous_test_result_path
54+
)
55+
parse_continuous_test_result_path = staticmethod(
56+
EnvironmentsClient.parse_continuous_test_result_path
57+
)
5258
environment_path = staticmethod(EnvironmentsClient.environment_path)
5359
parse_environment_path = staticmethod(EnvironmentsClient.parse_environment_path)
60+
test_case_result_path = staticmethod(EnvironmentsClient.test_case_result_path)
61+
parse_test_case_result_path = staticmethod(
62+
EnvironmentsClient.parse_test_case_result_path
63+
)
5464
version_path = staticmethod(EnvironmentsClient.version_path)
5565
parse_version_path = staticmethod(EnvironmentsClient.parse_version_path)
5666
common_billing_account_path = staticmethod(
@@ -691,6 +701,151 @@ async def lookup_environment_history(
691701
# Done; return the response.
692702
return response
693703

704+
async def run_continuous_test(
705+
self,
706+
request: environment.RunContinuousTestRequest = None,
707+
*,
708+
retry: retries.Retry = gapic_v1.method.DEFAULT,
709+
timeout: float = None,
710+
metadata: Sequence[Tuple[str, str]] = (),
711+
) -> operation_async.AsyncOperation:
712+
r"""Kicks off a continuous test under the specified
713+
[Environment][google.cloud.dialogflow.cx.v3beta1.Environment].
714+
715+
Args:
716+
request (:class:`google.cloud.dialogflowcx_v3beta1.types.RunContinuousTestRequest`):
717+
The request object. The request message for
718+
[Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest].
719+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
720+
should be retried.
721+
timeout (float): The timeout for this request.
722+
metadata (Sequence[Tuple[str, str]]): Strings which should be
723+
sent along with the request as metadata.
724+
725+
Returns:
726+
google.api_core.operation_async.AsyncOperation:
727+
An object representing a long-running operation.
728+
729+
The result type for the operation will be
730+
:class:`google.cloud.dialogflowcx_v3beta1.types.RunContinuousTestResponse`
731+
The response message for
732+
[Environments.RunContinuousTest][google.cloud.dialogflow.cx.v3beta1.Environments.RunContinuousTest].
733+
734+
"""
735+
# Create or coerce a protobuf request object.
736+
request = environment.RunContinuousTestRequest(request)
737+
738+
# Wrap the RPC method; this adds retry and timeout information,
739+
# and friendly error handling.
740+
rpc = gapic_v1.method_async.wrap_method(
741+
self._client._transport.run_continuous_test,
742+
default_timeout=None,
743+
client_info=DEFAULT_CLIENT_INFO,
744+
)
745+
746+
# Certain fields should be provided within the metadata header;
747+
# add these here.
748+
metadata = tuple(metadata) + (
749+
gapic_v1.routing_header.to_grpc_metadata(
750+
(("environment", request.environment),)
751+
),
752+
)
753+
754+
# Send the request.
755+
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
756+
757+
# Wrap the response in an operation future.
758+
response = operation_async.from_gapic(
759+
response,
760+
self._client._transport.operations_client,
761+
environment.RunContinuousTestResponse,
762+
metadata_type=environment.RunContinuousTestMetadata,
763+
)
764+
765+
# Done; return the response.
766+
return response
767+
768+
async def list_continuous_test_results(
769+
self,
770+
request: environment.ListContinuousTestResultsRequest = None,
771+
*,
772+
parent: str = None,
773+
retry: retries.Retry = gapic_v1.method.DEFAULT,
774+
timeout: float = None,
775+
metadata: Sequence[Tuple[str, str]] = (),
776+
) -> pagers.ListContinuousTestResultsAsyncPager:
777+
r"""Fetches a list of continuous test results for a given
778+
environment.
779+
780+
Args:
781+
request (:class:`google.cloud.dialogflowcx_v3beta1.types.ListContinuousTestResultsRequest`):
782+
The request object. The request message for
783+
[Environments.ListContinuousTestResults][google.cloud.dialogflow.cx.v3beta1.Environments.ListContinuousTestResults].
784+
parent (:class:`str`):
785+
Required. The environment to list results for. Format:
786+
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/ environments/<Environment ID>``.
787+
788+
This corresponds to the ``parent`` field
789+
on the ``request`` instance; if ``request`` is provided, this
790+
should not be set.
791+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
792+
should be retried.
793+
timeout (float): The timeout for this request.
794+
metadata (Sequence[Tuple[str, str]]): Strings which should be
795+
sent along with the request as metadata.
796+
797+
Returns:
798+
google.cloud.dialogflowcx_v3beta1.services.environments.pagers.ListContinuousTestResultsAsyncPager:
799+
The response message for
800+
[Environments.ListTestCaseResults][].
801+
802+
Iterating over this object will yield results and
803+
resolve additional pages automatically.
804+
805+
"""
806+
# Create or coerce a protobuf request object.
807+
# Sanity check: If we got a request object, we should *not* have
808+
# gotten any keyword arguments that map to the request.
809+
has_flattened_params = any([parent])
810+
if request is not None and has_flattened_params:
811+
raise ValueError(
812+
"If the `request` argument is set, then none of "
813+
"the individual field arguments should be set."
814+
)
815+
816+
request = environment.ListContinuousTestResultsRequest(request)
817+
818+
# If we have keyword arguments corresponding to fields on the
819+
# request, apply these.
820+
if parent is not None:
821+
request.parent = parent
822+
823+
# Wrap the RPC method; this adds retry and timeout information,
824+
# and friendly error handling.
825+
rpc = gapic_v1.method_async.wrap_method(
826+
self._client._transport.list_continuous_test_results,
827+
default_timeout=None,
828+
client_info=DEFAULT_CLIENT_INFO,
829+
)
830+
831+
# Certain fields should be provided within the metadata header;
832+
# add these here.
833+
metadata = tuple(metadata) + (
834+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
835+
)
836+
837+
# Send the request.
838+
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
839+
840+
# This method is paged; wrap the response in a pager, which provides
841+
# an `__aiter__` convenience method.
842+
response = pagers.ListContinuousTestResultsAsyncPager(
843+
method=rpc, request=request, response=response, metadata=metadata,
844+
)
845+
846+
# Done; return the response.
847+
return response
848+
694849

695850
try:
696851
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(

0 commit comments

Comments
 (0)