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

Commit daf9af8

Browse files
chore: use gapic-generator-python 0.53.4 (#85)
- [ ] Regenerate this pull request now. docs: list oneofs in docstring fix(deps): require google-api-core >= 1.28.0 fix(deps): drop packaging dependency committer: busunkim96@ PiperOrigin-RevId: 406468269 Source-Link: googleapis/googleapis@83d81b0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2ff001fbacb9e77e71d734de5f955c05fdae8526 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
1 parent e264240 commit daf9af8

10 files changed

Lines changed: 201 additions & 238 deletions

File tree

google/cloud/contact_center_insights_v1/services/contact_center_insights/async_client.py

Lines changed: 89 additions & 85 deletions
Large diffs are not rendered by default.

google/cloud/contact_center_insights_v1/services/contact_center_insights/client.py

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3131
from google.oauth2 import service_account # type: ignore
3232

33+
OptionalRetry = Union[retries.Retry, object]
34+
3335
from google.api_core import operation # type: ignore
3436
from google.api_core import operation_async # type: ignore
3537
from google.cloud.contact_center_insights_v1.services.contact_center_insights import (
@@ -467,7 +469,7 @@ def create_conversation(
467469
parent: str = None,
468470
conversation: resources.Conversation = None,
469471
conversation_id: str = None,
470-
retry: retries.Retry = gapic_v1.method.DEFAULT,
472+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
471473
timeout: float = None,
472474
metadata: Sequence[Tuple[str, str]] = (),
473475
) -> resources.Conversation:
@@ -560,7 +562,7 @@ def update_conversation(
560562
*,
561563
conversation: resources.Conversation = None,
562564
update_mask: field_mask_pb2.FieldMask = None,
563-
retry: retries.Retry = gapic_v1.method.DEFAULT,
565+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
564566
timeout: float = None,
565567
metadata: Sequence[Tuple[str, str]] = (),
566568
) -> resources.Conversation:
@@ -638,7 +640,7 @@ def get_conversation(
638640
request: Union[contact_center_insights.GetConversationRequest, dict] = None,
639641
*,
640642
name: str = None,
641-
retry: retries.Retry = gapic_v1.method.DEFAULT,
643+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
642644
timeout: float = None,
643645
metadata: Sequence[Tuple[str, str]] = (),
644646
) -> resources.Conversation:
@@ -706,7 +708,7 @@ def list_conversations(
706708
request: Union[contact_center_insights.ListConversationsRequest, dict] = None,
707709
*,
708710
parent: str = None,
709-
retry: retries.Retry = gapic_v1.method.DEFAULT,
711+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
710712
timeout: float = None,
711713
metadata: Sequence[Tuple[str, str]] = (),
712714
) -> pagers.ListConversationsPager:
@@ -785,7 +787,7 @@ def delete_conversation(
785787
request: Union[contact_center_insights.DeleteConversationRequest, dict] = None,
786788
*,
787789
name: str = None,
788-
retry: retries.Retry = gapic_v1.method.DEFAULT,
790+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
789791
timeout: float = None,
790792
metadata: Sequence[Tuple[str, str]] = (),
791793
) -> None:
@@ -850,7 +852,7 @@ def create_analysis(
850852
*,
851853
parent: str = None,
852854
analysis: resources.Analysis = None,
853-
retry: retries.Retry = gapic_v1.method.DEFAULT,
855+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
854856
timeout: float = None,
855857
metadata: Sequence[Tuple[str, str]] = (),
856858
) -> operation.Operation:
@@ -939,7 +941,7 @@ def get_analysis(
939941
request: Union[contact_center_insights.GetAnalysisRequest, dict] = None,
940942
*,
941943
name: str = None,
942-
retry: retries.Retry = gapic_v1.method.DEFAULT,
944+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
943945
timeout: float = None,
944946
metadata: Sequence[Tuple[str, str]] = (),
945947
) -> resources.Analysis:
@@ -1007,7 +1009,7 @@ def list_analyses(
10071009
request: Union[contact_center_insights.ListAnalysesRequest, dict] = None,
10081010
*,
10091011
parent: str = None,
1010-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1012+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
10111013
timeout: float = None,
10121014
metadata: Sequence[Tuple[str, str]] = (),
10131015
) -> pagers.ListAnalysesPager:
@@ -1085,7 +1087,7 @@ def delete_analysis(
10851087
request: Union[contact_center_insights.DeleteAnalysisRequest, dict] = None,
10861088
*,
10871089
name: str = None,
1088-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1090+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
10891091
timeout: float = None,
10901092
metadata: Sequence[Tuple[str, str]] = (),
10911093
) -> None:
@@ -1148,7 +1150,7 @@ def export_insights_data(
11481150
request: Union[contact_center_insights.ExportInsightsDataRequest, dict] = None,
11491151
*,
11501152
parent: str = None,
1151-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1153+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
11521154
timeout: float = None,
11531155
metadata: Sequence[Tuple[str, str]] = (),
11541156
) -> operation.Operation:
@@ -1231,7 +1233,7 @@ def create_issue_model(
12311233
*,
12321234
parent: str = None,
12331235
issue_model: resources.IssueModel = None,
1234-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1236+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
12351237
timeout: float = None,
12361238
metadata: Sequence[Tuple[str, str]] = (),
12371239
) -> operation.Operation:
@@ -1321,7 +1323,7 @@ def update_issue_model(
13211323
*,
13221324
issue_model: resources.IssueModel = None,
13231325
update_mask: field_mask_pb2.FieldMask = None,
1324-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1326+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
13251327
timeout: float = None,
13261328
metadata: Sequence[Tuple[str, str]] = (),
13271329
) -> resources.IssueModel:
@@ -1399,7 +1401,7 @@ def get_issue_model(
13991401
request: Union[contact_center_insights.GetIssueModelRequest, dict] = None,
14001402
*,
14011403
name: str = None,
1402-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1404+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
14031405
timeout: float = None,
14041406
metadata: Sequence[Tuple[str, str]] = (),
14051407
) -> resources.IssueModel:
@@ -1467,7 +1469,7 @@ def list_issue_models(
14671469
request: Union[contact_center_insights.ListIssueModelsRequest, dict] = None,
14681470
*,
14691471
parent: str = None,
1470-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1472+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
14711473
timeout: float = None,
14721474
metadata: Sequence[Tuple[str, str]] = (),
14731475
) -> contact_center_insights.ListIssueModelsResponse:
@@ -1535,7 +1537,7 @@ def delete_issue_model(
15351537
request: Union[contact_center_insights.DeleteIssueModelRequest, dict] = None,
15361538
*,
15371539
name: str = None,
1538-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1540+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
15391541
timeout: float = None,
15401542
metadata: Sequence[Tuple[str, str]] = (),
15411543
) -> operation.Operation:
@@ -1627,7 +1629,7 @@ def deploy_issue_model(
16271629
request: Union[contact_center_insights.DeployIssueModelRequest, dict] = None,
16281630
*,
16291631
name: str = None,
1630-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1632+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
16311633
timeout: float = None,
16321634
metadata: Sequence[Tuple[str, str]] = (),
16331635
) -> operation.Operation:
@@ -1709,7 +1711,7 @@ def undeploy_issue_model(
17091711
request: Union[contact_center_insights.UndeployIssueModelRequest, dict] = None,
17101712
*,
17111713
name: str = None,
1712-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1714+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
17131715
timeout: float = None,
17141716
metadata: Sequence[Tuple[str, str]] = (),
17151717
) -> operation.Operation:
@@ -1793,7 +1795,7 @@ def get_issue(
17931795
request: Union[contact_center_insights.GetIssueRequest, dict] = None,
17941796
*,
17951797
name: str = None,
1796-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1798+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
17971799
timeout: float = None,
17981800
metadata: Sequence[Tuple[str, str]] = (),
17991801
) -> resources.Issue:
@@ -1861,7 +1863,7 @@ def list_issues(
18611863
request: Union[contact_center_insights.ListIssuesRequest, dict] = None,
18621864
*,
18631865
parent: str = None,
1864-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1866+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
18651867
timeout: float = None,
18661868
metadata: Sequence[Tuple[str, str]] = (),
18671869
) -> contact_center_insights.ListIssuesResponse:
@@ -1930,7 +1932,7 @@ def update_issue(
19301932
*,
19311933
issue: resources.Issue = None,
19321934
update_mask: field_mask_pb2.FieldMask = None,
1933-
retry: retries.Retry = gapic_v1.method.DEFAULT,
1935+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
19341936
timeout: float = None,
19351937
metadata: Sequence[Tuple[str, str]] = (),
19361938
) -> resources.Issue:
@@ -2009,7 +2011,7 @@ def calculate_issue_model_stats(
20092011
] = None,
20102012
*,
20112013
issue_model: str = None,
2012-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2014+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
20132015
timeout: float = None,
20142016
metadata: Sequence[Tuple[str, str]] = (),
20152017
) -> contact_center_insights.CalculateIssueModelStatsResponse:
@@ -2087,7 +2089,7 @@ def create_phrase_matcher(
20872089
*,
20882090
parent: str = None,
20892091
phrase_matcher: resources.PhraseMatcher = None,
2090-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2092+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
20912093
timeout: float = None,
20922094
metadata: Sequence[Tuple[str, str]] = (),
20932095
) -> resources.PhraseMatcher:
@@ -2167,7 +2169,7 @@ def get_phrase_matcher(
21672169
request: Union[contact_center_insights.GetPhraseMatcherRequest, dict] = None,
21682170
*,
21692171
name: str = None,
2170-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2172+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
21712173
timeout: float = None,
21722174
metadata: Sequence[Tuple[str, str]] = (),
21732175
) -> resources.PhraseMatcher:
@@ -2236,7 +2238,7 @@ def list_phrase_matchers(
22362238
request: Union[contact_center_insights.ListPhraseMatchersRequest, dict] = None,
22372239
*,
22382240
parent: str = None,
2239-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2241+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
22402242
timeout: float = None,
22412243
metadata: Sequence[Tuple[str, str]] = (),
22422244
) -> pagers.ListPhraseMatchersPager:
@@ -2315,7 +2317,7 @@ def delete_phrase_matcher(
23152317
request: Union[contact_center_insights.DeletePhraseMatcherRequest, dict] = None,
23162318
*,
23172319
name: str = None,
2318-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2320+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
23192321
timeout: float = None,
23202322
metadata: Sequence[Tuple[str, str]] = (),
23212323
) -> None:
@@ -2379,7 +2381,7 @@ def calculate_stats(
23792381
request: Union[contact_center_insights.CalculateStatsRequest, dict] = None,
23802382
*,
23812383
location: str = None,
2382-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2384+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
23832385
timeout: float = None,
23842386
metadata: Sequence[Tuple[str, str]] = (),
23852387
) -> contact_center_insights.CalculateStatsResponse:
@@ -2450,7 +2452,7 @@ def get_settings(
24502452
request: Union[contact_center_insights.GetSettingsRequest, dict] = None,
24512453
*,
24522454
name: str = None,
2453-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2455+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
24542456
timeout: float = None,
24552457
metadata: Sequence[Tuple[str, str]] = (),
24562458
) -> resources.Settings:
@@ -2520,7 +2522,7 @@ def update_settings(
25202522
*,
25212523
settings: resources.Settings = None,
25222524
update_mask: field_mask_pb2.FieldMask = None,
2523-
retry: retries.Retry = gapic_v1.method.DEFAULT,
2525+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
25242526
timeout: float = None,
25252527
metadata: Sequence[Tuple[str, str]] = (),
25262528
) -> resources.Settings:

google/cloud/contact_center_insights_v1/services/contact_center_insights/transports/base.py

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#
1616
import abc
1717
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18-
import packaging.version
1918
import pkg_resources
2019

2120
import google.auth # type: ignore
@@ -41,15 +40,6 @@
4140
except pkg_resources.DistributionNotFound:
4241
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
4342

44-
try:
45-
# google.auth.__version__ was added in 1.26.0
46-
_GOOGLE_AUTH_VERSION = google.auth.__version__
47-
except AttributeError:
48-
try: # try pkg_resources if it is available
49-
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
50-
except pkg_resources.DistributionNotFound: # pragma: NO COVER
51-
_GOOGLE_AUTH_VERSION = None
52-
5343

5444
class ContactCenterInsightsTransport(abc.ABC):
5545
"""Abstract transport class for ContactCenterInsights."""
@@ -99,7 +89,7 @@ def __init__(
9989
host += ":443"
10090
self._host = host
10191

102-
scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
92+
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
10393

10494
# Save the scopes.
10595
self._scopes = scopes
@@ -132,29 +122,6 @@ def __init__(
132122
# Save the credentials.
133123
self._credentials = credentials
134124

135-
# TODO(busunkim): This method is in the base transport
136-
# to avoid duplicating code across the transport classes. These functions
137-
# should be deleted once the minimum required versions of google-auth is increased.
138-
139-
# TODO: Remove this function once google-auth >= 1.25.0 is required
140-
@classmethod
141-
def _get_scopes_kwargs(
142-
cls, host: str, scopes: Optional[Sequence[str]]
143-
) -> Dict[str, Optional[Sequence[str]]]:
144-
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""
145-
146-
scopes_kwargs = {}
147-
148-
if _GOOGLE_AUTH_VERSION and (
149-
packaging.version.parse(_GOOGLE_AUTH_VERSION)
150-
>= packaging.version.parse("1.25.0")
151-
):
152-
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
153-
else:
154-
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}
155-
156-
return scopes_kwargs
157-
158125
def _prep_wrapped_messages(self, client_info):
159126
# Precompute the wrapped methods.
160127
self._wrapped_methods = {
@@ -266,7 +233,7 @@ def close(self):
266233
raise NotImplementedError()
267234

268235
@property
269-
def operations_client(self) -> operations_v1.OperationsClient:
236+
def operations_client(self):
270237
"""Return the client designed to process long-running operations."""
271238
raise NotImplementedError()
272239

google/cloud/contact_center_insights_v1/services/contact_center_insights/transports/grpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def __init__(
115115
self._grpc_channel = None
116116
self._ssl_channel_credentials = ssl_channel_credentials
117117
self._stubs: Dict[str, Callable] = {}
118-
self._operations_client = None
118+
self._operations_client: Optional[operations_v1.OperationsClient] = None
119119

120120
if api_mtls_endpoint:
121121
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)

google/cloud/contact_center_insights_v1/services/contact_center_insights/transports/grpc_asyncio.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from google.api_core import operations_v1 # type: ignore
2222
from google.auth import credentials as ga_credentials # type: ignore
2323
from google.auth.transport.grpc import SslCredentials # type: ignore
24-
import packaging.version
2524

2625
import grpc # type: ignore
2726
from grpc.experimental import aio # type: ignore
@@ -162,7 +161,7 @@ def __init__(
162161
self._grpc_channel = None
163162
self._ssl_channel_credentials = ssl_channel_credentials
164163
self._stubs: Dict[str, Callable] = {}
165-
self._operations_client = None
164+
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None
166165

167166
if api_mtls_endpoint:
168167
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)

google/cloud/contact_center_insights_v1/types/contact_center_insights.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,12 @@ class DeleteAnalysisRequest(proto.Message):
425425
class ExportInsightsDataRequest(proto.Message):
426426
r"""The request to export insights.
427427
428+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
429+
428430
Attributes:
429431
big_query_destination (google.cloud.contact_center_insights_v1.types.ExportInsightsDataRequest.BigQueryDestination):
430432
Specified if sink is a BigQuery table.
433+
This field is a member of `oneof`_ ``destination``.
431434
parent (str):
432435
Required. The parent resource to export data
433436
from.

0 commit comments

Comments
 (0)