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

Commit 8f3dc03

Browse files
feat(v3): allow setting custom CA for generic webhooks (#214)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 410299375 Source-Link: googleapis/googleapis@4a4ec6d Source-Link: https://github.com/googleapis/googleapis-gen/commit/043e044ca963a15966d50f4c2b21bfbd73afaa94 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDQzZTA0NGNhOTYzYTE1OTY2ZDUwZjRjMmIyMWJmYmQ3M2FmYWE5NCJ9 feat(v3): release CompareVersions API docs: clarify DLP template reader usage
1 parent 3d144aa commit 8f3dc03

File tree

15 files changed

+571
-27
lines changed

15 files changed

+571
-27
lines changed

google/cloud/dialogflowcx/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@
307307
)
308308
from google.cloud.dialogflowcx_v3.types.validation_message import ResourceName
309309
from google.cloud.dialogflowcx_v3.types.validation_message import ValidationMessage
310+
from google.cloud.dialogflowcx_v3.types.version import CompareVersionsRequest
311+
from google.cloud.dialogflowcx_v3.types.version import CompareVersionsResponse
310312
from google.cloud.dialogflowcx_v3.types.version import CreateVersionOperationMetadata
311313
from google.cloud.dialogflowcx_v3.types.version import CreateVersionRequest
312314
from google.cloud.dialogflowcx_v3.types.version import DeleteVersionRequest
@@ -543,6 +545,8 @@
543545
"UpdateTransitionRouteGroupRequest",
544546
"ResourceName",
545547
"ValidationMessage",
548+
"CompareVersionsRequest",
549+
"CompareVersionsResponse",
546550
"CreateVersionOperationMetadata",
547551
"CreateVersionRequest",
548552
"DeleteVersionRequest",

google/cloud/dialogflowcx_v3/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@
229229
from .types.transition_route_group import UpdateTransitionRouteGroupRequest
230230
from .types.validation_message import ResourceName
231231
from .types.validation_message import ValidationMessage
232+
from .types.version import CompareVersionsRequest
233+
from .types.version import CompareVersionsResponse
232234
from .types.version import CreateVersionOperationMetadata
233235
from .types.version import CreateVersionRequest
234236
from .types.version import DeleteVersionRequest
@@ -281,6 +283,8 @@
281283
"CalculateCoverageResponse",
282284
"Changelog",
283285
"ChangelogsClient",
286+
"CompareVersionsRequest",
287+
"CompareVersionsResponse",
284288
"ContinuousTestResult",
285289
"ConversationTurn",
286290
"CreateAgentRequest",

google/cloud/dialogflowcx_v3/gapic_metadata.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,11 @@
10561056
"grpc": {
10571057
"libraryClient": "VersionsClient",
10581058
"rpcs": {
1059+
"CompareVersions": {
1060+
"methods": [
1061+
"compare_versions"
1062+
]
1063+
},
10591064
"CreateVersion": {
10601065
"methods": [
10611066
"create_version"
@@ -1091,6 +1096,11 @@
10911096
"grpc-async": {
10921097
"libraryClient": "VersionsAsyncClient",
10931098
"rpcs": {
1099+
"CompareVersions": {
1100+
"methods": [
1101+
"compare_versions"
1102+
]
1103+
},
10941104
"CreateVersion": {
10951105
"methods": [
10961106
"create_version"

google/cloud/dialogflowcx_v3/services/versions/async_client.py

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ async def list_versions(
187187
parent (:class:`str`):
188188
Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow]
189189
to list all versions for. Format:
190-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>``.
190+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>``.
191191
192192
This corresponds to the ``parent`` field
193193
on the ``request`` instance; if ``request`` is provided, this
@@ -201,7 +201,7 @@ async def list_versions(
201201
Returns:
202202
google.cloud.dialogflowcx_v3.services.versions.pagers.ListVersionsAsyncPager:
203203
The response message for
204-
[Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions].
204+
[Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions].
205205
206206
Iterating over this object will yield results and
207207
resolve additional pages automatically.
@@ -270,7 +270,7 @@ async def get_version(
270270
Required. The name of the
271271
[Version][google.cloud.dialogflow.cx.v3.Version].
272272
Format:
273-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>``.
273+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
274274
275275
This corresponds to the ``name`` field
276276
on the ``request`` instance; if ``request`` is provided, this
@@ -354,7 +354,7 @@ async def create_version(
354354
to create an
355355
[Version][google.cloud.dialogflow.cx.v3.Version] for.
356356
Format:
357-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>``.
357+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>``.
358358
359359
This corresponds to the ``parent`` field
360360
on the ``request`` instance; if ``request`` is provided, this
@@ -527,7 +527,7 @@ async def delete_version(
527527
Required. The name of the
528528
[Version][google.cloud.dialogflow.cx.v3.Version] to
529529
delete. Format:
530-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>``.
530+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
531531
532532
This corresponds to the ``name`` field
533533
on the ``request`` instance; if ``request`` is provided, this
@@ -603,7 +603,7 @@ async def load_version(
603603
Required. The
604604
[Version][google.cloud.dialogflow.cx.v3.Version] to be
605605
loaded to draft flow. Format:
606-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>``.
606+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
607607
608608
This corresponds to the ``name`` field
609609
on the ``request`` instance; if ``request`` is provided, this
@@ -678,6 +678,84 @@ async def load_version(
678678
# Done; return the response.
679679
return response
680680

681+
async def compare_versions(
682+
self,
683+
request: Union[version.CompareVersionsRequest, dict] = None,
684+
*,
685+
base_version: str = None,
686+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
687+
timeout: float = None,
688+
metadata: Sequence[Tuple[str, str]] = (),
689+
) -> version.CompareVersionsResponse:
690+
r"""Compares the specified base version with target
691+
version.
692+
693+
Args:
694+
request (Union[google.cloud.dialogflowcx_v3.types.CompareVersionsRequest, dict]):
695+
The request object. The request message for
696+
[Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions].
697+
base_version (:class:`str`):
698+
Required. Name of the base flow version to compare with
699+
the target version. Use version ID ``0`` to indicate the
700+
draft version of the specified flow.
701+
702+
Format:
703+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
704+
705+
This corresponds to the ``base_version`` field
706+
on the ``request`` instance; if ``request`` is provided, this
707+
should not be set.
708+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
709+
should be retried.
710+
timeout (float): The timeout for this request.
711+
metadata (Sequence[Tuple[str, str]]): Strings which should be
712+
sent along with the request as metadata.
713+
714+
Returns:
715+
google.cloud.dialogflowcx_v3.types.CompareVersionsResponse:
716+
The response message for
717+
[Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions].
718+
719+
"""
720+
# Create or coerce a protobuf request object.
721+
# Sanity check: If we got a request object, we should *not* have
722+
# gotten any keyword arguments that map to the request.
723+
has_flattened_params = any([base_version])
724+
if request is not None and has_flattened_params:
725+
raise ValueError(
726+
"If the `request` argument is set, then none of "
727+
"the individual field arguments should be set."
728+
)
729+
730+
request = version.CompareVersionsRequest(request)
731+
732+
# If we have keyword arguments corresponding to fields on the
733+
# request, apply these.
734+
if base_version is not None:
735+
request.base_version = base_version
736+
737+
# Wrap the RPC method; this adds retry and timeout information,
738+
# and friendly error handling.
739+
rpc = gapic_v1.method_async.wrap_method(
740+
self._client._transport.compare_versions,
741+
default_timeout=None,
742+
client_info=DEFAULT_CLIENT_INFO,
743+
)
744+
745+
# Certain fields should be provided within the metadata header;
746+
# add these here.
747+
metadata = tuple(metadata) + (
748+
gapic_v1.routing_header.to_grpc_metadata(
749+
(("base_version", request.base_version),)
750+
),
751+
)
752+
753+
# Send the request.
754+
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
755+
756+
# Done; return the response.
757+
return response
758+
681759
async def __aenter__(self):
682760
return self
683761

google/cloud/dialogflowcx_v3/services/versions/client.py

Lines changed: 84 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def list_versions(
387387
parent (str):
388388
Required. The [Flow][google.cloud.dialogflow.cx.v3.Flow]
389389
to list all versions for. Format:
390-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>``.
390+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>``.
391391
392392
This corresponds to the ``parent`` field
393393
on the ``request`` instance; if ``request`` is provided, this
@@ -401,7 +401,7 @@ def list_versions(
401401
Returns:
402402
google.cloud.dialogflowcx_v3.services.versions.pagers.ListVersionsPager:
403403
The response message for
404-
[Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions].
404+
[Versions.ListVersions][google.cloud.dialogflow.cx.v3.Versions.ListVersions].
405405
406406
Iterating over this object will yield results and
407407
resolve additional pages automatically.
@@ -470,7 +470,7 @@ def get_version(
470470
Required. The name of the
471471
[Version][google.cloud.dialogflow.cx.v3.Version].
472472
Format:
473-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>``.
473+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
474474
475475
This corresponds to the ``name`` field
476476
on the ``request`` instance; if ``request`` is provided, this
@@ -554,7 +554,7 @@ def create_version(
554554
to create an
555555
[Version][google.cloud.dialogflow.cx.v3.Version] for.
556556
Format:
557-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>``.
557+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>``.
558558
559559
This corresponds to the ``parent`` field
560560
on the ``request`` instance; if ``request`` is provided, this
@@ -727,7 +727,7 @@ def delete_version(
727727
Required. The name of the
728728
[Version][google.cloud.dialogflow.cx.v3.Version] to
729729
delete. Format:
730-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>``.
730+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
731731
732732
This corresponds to the ``name`` field
733733
on the ``request`` instance; if ``request`` is provided, this
@@ -803,7 +803,7 @@ def load_version(
803803
Required. The
804804
[Version][google.cloud.dialogflow.cx.v3.Version] to be
805805
loaded to draft flow. Format:
806-
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>``.
806+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
807807
808808
This corresponds to the ``name`` field
809809
on the ``request`` instance; if ``request`` is provided, this
@@ -878,6 +878,84 @@ def load_version(
878878
# Done; return the response.
879879
return response
880880

881+
def compare_versions(
882+
self,
883+
request: Union[version.CompareVersionsRequest, dict] = None,
884+
*,
885+
base_version: str = None,
886+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
887+
timeout: float = None,
888+
metadata: Sequence[Tuple[str, str]] = (),
889+
) -> version.CompareVersionsResponse:
890+
r"""Compares the specified base version with target
891+
version.
892+
893+
Args:
894+
request (Union[google.cloud.dialogflowcx_v3.types.CompareVersionsRequest, dict]):
895+
The request object. The request message for
896+
[Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions].
897+
base_version (str):
898+
Required. Name of the base flow version to compare with
899+
the target version. Use version ID ``0`` to indicate the
900+
draft version of the specified flow.
901+
902+
Format:
903+
``projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/versions/<VersionID>``.
904+
905+
This corresponds to the ``base_version`` field
906+
on the ``request`` instance; if ``request`` is provided, this
907+
should not be set.
908+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
909+
should be retried.
910+
timeout (float): The timeout for this request.
911+
metadata (Sequence[Tuple[str, str]]): Strings which should be
912+
sent along with the request as metadata.
913+
914+
Returns:
915+
google.cloud.dialogflowcx_v3.types.CompareVersionsResponse:
916+
The response message for
917+
[Versions.CompareVersions][google.cloud.dialogflow.cx.v3.Versions.CompareVersions].
918+
919+
"""
920+
# Create or coerce a protobuf request object.
921+
# Sanity check: If we got a request object, we should *not* have
922+
# gotten any keyword arguments that map to the request.
923+
has_flattened_params = any([base_version])
924+
if request is not None and has_flattened_params:
925+
raise ValueError(
926+
"If the `request` argument is set, then none of "
927+
"the individual field arguments should be set."
928+
)
929+
930+
# Minor optimization to avoid making a copy if the user passes
931+
# in a version.CompareVersionsRequest.
932+
# There's no risk of modifying the input as we've already verified
933+
# there are no flattened fields.
934+
if not isinstance(request, version.CompareVersionsRequest):
935+
request = version.CompareVersionsRequest(request)
936+
# If we have keyword arguments corresponding to fields on the
937+
# request, apply these.
938+
if base_version is not None:
939+
request.base_version = base_version
940+
941+
# Wrap the RPC method; this adds retry and timeout information,
942+
# and friendly error handling.
943+
rpc = self._transport._wrapped_methods[self._transport.compare_versions]
944+
945+
# Certain fields should be provided within the metadata header;
946+
# add these here.
947+
metadata = tuple(metadata) + (
948+
gapic_v1.routing_header.to_grpc_metadata(
949+
(("base_version", request.base_version),)
950+
),
951+
)
952+
953+
# Send the request.
954+
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
955+
956+
# Done; return the response.
957+
return response
958+
881959
def __enter__(self):
882960
return self
883961

google/cloud/dialogflowcx_v3/services/versions/transports/base.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ def _prep_wrapped_messages(self, client_info):
146146
self.load_version: gapic_v1.method.wrap_method(
147147
self.load_version, default_timeout=None, client_info=client_info,
148148
),
149+
self.compare_versions: gapic_v1.method.wrap_method(
150+
self.compare_versions, default_timeout=None, client_info=client_info,
151+
),
149152
}
150153

151154
def close(self):
@@ -215,5 +218,16 @@ def load_version(
215218
]:
216219
raise NotImplementedError()
217220

221+
@property
222+
def compare_versions(
223+
self,
224+
) -> Callable[
225+
[version.CompareVersionsRequest],
226+
Union[
227+
version.CompareVersionsResponse, Awaitable[version.CompareVersionsResponse]
228+
],
229+
]:
230+
raise NotImplementedError()
231+
218232

219233
__all__ = ("VersionsTransport",)

google/cloud/dialogflowcx_v3/services/versions/transports/grpc.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,33 @@ def load_version(
424424
)
425425
return self._stubs["load_version"]
426426

427+
@property
428+
def compare_versions(
429+
self,
430+
) -> Callable[[version.CompareVersionsRequest], version.CompareVersionsResponse]:
431+
r"""Return a callable for the compare versions method over gRPC.
432+
433+
Compares the specified base version with target
434+
version.
435+
436+
Returns:
437+
Callable[[~.CompareVersionsRequest],
438+
~.CompareVersionsResponse]:
439+
A function that, when called, will call the underlying RPC
440+
on the server.
441+
"""
442+
# Generate a "stub function" on-the-fly which will actually make
443+
# the request.
444+
# gRPC handles serialization and deserialization, so we just need
445+
# to pass in the functions for each.
446+
if "compare_versions" not in self._stubs:
447+
self._stubs["compare_versions"] = self.grpc_channel.unary_unary(
448+
"/google.cloud.dialogflow.cx.v3.Versions/CompareVersions",
449+
request_serializer=version.CompareVersionsRequest.serialize,
450+
response_deserializer=version.CompareVersionsResponse.deserialize,
451+
)
452+
return self._stubs["compare_versions"]
453+
427454
def close(self):
428455
self.grpc_channel.close()
429456

0 commit comments

Comments
 (0)