Skip to content

Commit bdb79f7

Browse files
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#268)
* fix(deps): Require google-api-core >=1.34.0, >=2.11.0 fix: Drop usage of pkg_resources fix: Fix timeout default values docs(samples): Snippetgen should call await on the operation coroutine before calling result PiperOrigin-RevId: 493260409 Source-Link: googleapis/googleapis@fea4387 Source-Link: googleapis/googleapis-gen@387b734 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * add gapic_version.py Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 4065828 commit bdb79f7

14 files changed

+113
-114
lines changed

packages/google-cloud-contact-center-insights/.coveragerc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,3 @@ exclude_lines =
1010
pragma: NO COVER
1111
# Ignore debug-only repr
1212
def __repr__
13-
# Ignore pkg_resources exceptions.
14-
# This is added at the module level as a safeguard for if someone
15-
# generates the code and tries to run it without pip installing. This
16-
# makes it virtually impossible to test properly.
17-
except pkg_resources.DistributionNotFound
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.4.5" # {x-release-please-version}

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/services/contact_center_insights/async_client.py

Lines changed: 45 additions & 49 deletions
Large diffs are not rendered by default.

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/services/contact_center_insights/client.py

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
from google.auth.transport import mtls # type: ignore
3939
from google.auth.transport.grpc import SslCredentials # type: ignore
4040
from google.oauth2 import service_account # type: ignore
41-
import pkg_resources
41+
42+
from google.cloud.contact_center_insights_v1 import gapic_version as package_version
4243

4344
try:
4445
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -621,7 +622,7 @@ def create_conversation(
621622
conversation: Optional[resources.Conversation] = None,
622623
conversation_id: Optional[str] = None,
623624
retry: OptionalRetry = gapic_v1.method.DEFAULT,
624-
timeout: Optional[float] = None,
625+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
625626
metadata: Sequence[Tuple[str, str]] = (),
626627
) -> resources.Conversation:
627628
r"""Creates a conversation.
@@ -747,7 +748,7 @@ def update_conversation(
747748
conversation: Optional[resources.Conversation] = None,
748749
update_mask: Optional[field_mask_pb2.FieldMask] = None,
749750
retry: OptionalRetry = gapic_v1.method.DEFAULT,
750-
timeout: Optional[float] = None,
751+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
751752
metadata: Sequence[Tuple[str, str]] = (),
752753
) -> resources.Conversation:
753754
r"""Updates a conversation.
@@ -857,7 +858,7 @@ def get_conversation(
857858
*,
858859
name: Optional[str] = None,
859860
retry: OptionalRetry = gapic_v1.method.DEFAULT,
860-
timeout: Optional[float] = None,
861+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
861862
metadata: Sequence[Tuple[str, str]] = (),
862863
) -> resources.Conversation:
863864
r"""Gets a conversation.
@@ -958,7 +959,7 @@ def list_conversations(
958959
*,
959960
parent: Optional[str] = None,
960961
retry: OptionalRetry = gapic_v1.method.DEFAULT,
961-
timeout: Optional[float] = None,
962+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
962963
metadata: Sequence[Tuple[str, str]] = (),
963964
) -> pagers.ListConversationsPager:
964965
r"""Lists conversations.
@@ -1074,7 +1075,7 @@ def delete_conversation(
10741075
*,
10751076
name: Optional[str] = None,
10761077
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1077-
timeout: Optional[float] = None,
1078+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
10781079
metadata: Sequence[Tuple[str, str]] = (),
10791080
) -> None:
10801081
r"""Deletes a conversation.
@@ -1167,7 +1168,7 @@ def create_analysis(
11671168
parent: Optional[str] = None,
11681169
analysis: Optional[resources.Analysis] = None,
11691170
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1170-
timeout: Optional[float] = None,
1171+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
11711172
metadata: Sequence[Tuple[str, str]] = (),
11721173
) -> operation.Operation:
11731174
r"""Creates an analysis. The long running operation is
@@ -1293,7 +1294,7 @@ def get_analysis(
12931294
*,
12941295
name: Optional[str] = None,
12951296
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1296-
timeout: Optional[float] = None,
1297+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
12971298
metadata: Sequence[Tuple[str, str]] = (),
12981299
) -> resources.Analysis:
12991300
r"""Gets an analysis.
@@ -1394,7 +1395,7 @@ def list_analyses(
13941395
*,
13951396
parent: Optional[str] = None,
13961397
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1397-
timeout: Optional[float] = None,
1398+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
13981399
metadata: Sequence[Tuple[str, str]] = (),
13991400
) -> pagers.ListAnalysesPager:
14001401
r"""Lists analyses.
@@ -1509,7 +1510,7 @@ def delete_analysis(
15091510
*,
15101511
name: Optional[str] = None,
15111512
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1512-
timeout: Optional[float] = None,
1513+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
15131514
metadata: Sequence[Tuple[str, str]] = (),
15141515
) -> None:
15151516
r"""Deletes an analysis.
@@ -1600,7 +1601,7 @@ def export_insights_data(
16001601
*,
16011602
parent: Optional[str] = None,
16021603
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1603-
timeout: Optional[float] = None,
1604+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
16041605
metadata: Sequence[Tuple[str, str]] = (),
16051606
) -> operation.Operation:
16061607
r"""Export insights data to a destination defined in the
@@ -1724,7 +1725,7 @@ def create_issue_model(
17241725
parent: Optional[str] = None,
17251726
issue_model: Optional[resources.IssueModel] = None,
17261727
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1727-
timeout: Optional[float] = None,
1728+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
17281729
metadata: Sequence[Tuple[str, str]] = (),
17291730
) -> operation.Operation:
17301731
r"""Creates an issue model.
@@ -1851,7 +1852,7 @@ def update_issue_model(
18511852
issue_model: Optional[resources.IssueModel] = None,
18521853
update_mask: Optional[field_mask_pb2.FieldMask] = None,
18531854
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1854-
timeout: Optional[float] = None,
1855+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
18551856
metadata: Sequence[Tuple[str, str]] = (),
18561857
) -> resources.IssueModel:
18571858
r"""Updates an issue model.
@@ -1961,7 +1962,7 @@ def get_issue_model(
19611962
*,
19621963
name: Optional[str] = None,
19631964
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1964-
timeout: Optional[float] = None,
1965+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
19651966
metadata: Sequence[Tuple[str, str]] = (),
19661967
) -> resources.IssueModel:
19671968
r"""Gets an issue model.
@@ -2062,7 +2063,7 @@ def list_issue_models(
20622063
*,
20632064
parent: Optional[str] = None,
20642065
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2065-
timeout: Optional[float] = None,
2066+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
20662067
metadata: Sequence[Tuple[str, str]] = (),
20672068
) -> contact_center_insights.ListIssueModelsResponse:
20682069
r"""Lists issue models.
@@ -2163,7 +2164,7 @@ def delete_issue_model(
21632164
*,
21642165
name: Optional[str] = None,
21652166
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2166-
timeout: Optional[float] = None,
2167+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
21672168
metadata: Sequence[Tuple[str, str]] = (),
21682169
) -> operation.Operation:
21692170
r"""Deletes an issue model.
@@ -2289,7 +2290,7 @@ def deploy_issue_model(
22892290
*,
22902291
name: Optional[str] = None,
22912292
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2292-
timeout: Optional[float] = None,
2293+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
22932294
metadata: Sequence[Tuple[str, str]] = (),
22942295
) -> operation.Operation:
22952296
r"""Deploys an issue model. Returns an error if a model
@@ -2408,7 +2409,7 @@ def undeploy_issue_model(
24082409
*,
24092410
name: Optional[str] = None,
24102411
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2411-
timeout: Optional[float] = None,
2412+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
24122413
metadata: Sequence[Tuple[str, str]] = (),
24132414
) -> operation.Operation:
24142415
r"""Undeploys an issue model.
@@ -2527,7 +2528,7 @@ def get_issue(
25272528
*,
25282529
name: Optional[str] = None,
25292530
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2530-
timeout: Optional[float] = None,
2531+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
25312532
metadata: Sequence[Tuple[str, str]] = (),
25322533
) -> resources.Issue:
25332534
r"""Gets an issue.
@@ -2628,7 +2629,7 @@ def list_issues(
26282629
*,
26292630
parent: Optional[str] = None,
26302631
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2631-
timeout: Optional[float] = None,
2632+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
26322633
metadata: Sequence[Tuple[str, str]] = (),
26332634
) -> contact_center_insights.ListIssuesResponse:
26342635
r"""Lists issues.
@@ -2730,7 +2731,7 @@ def update_issue(
27302731
issue: Optional[resources.Issue] = None,
27312732
update_mask: Optional[field_mask_pb2.FieldMask] = None,
27322733
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2733-
timeout: Optional[float] = None,
2734+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
27342735
metadata: Sequence[Tuple[str, str]] = (),
27352736
) -> resources.Issue:
27362737
r"""Updates an issue.
@@ -2839,7 +2840,7 @@ def calculate_issue_model_stats(
28392840
*,
28402841
issue_model: Optional[str] = None,
28412842
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2842-
timeout: Optional[float] = None,
2843+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
28432844
metadata: Sequence[Tuple[str, str]] = (),
28442845
) -> contact_center_insights.CalculateIssueModelStatsResponse:
28452846
r"""Gets an issue model's statistics.
@@ -2950,7 +2951,7 @@ def create_phrase_matcher(
29502951
parent: Optional[str] = None,
29512952
phrase_matcher: Optional[resources.PhraseMatcher] = None,
29522953
retry: OptionalRetry = gapic_v1.method.DEFAULT,
2953-
timeout: Optional[float] = None,
2954+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
29542955
metadata: Sequence[Tuple[str, str]] = (),
29552956
) -> resources.PhraseMatcher:
29562957
r"""Creates a phrase matcher.
@@ -3067,7 +3068,7 @@ def get_phrase_matcher(
30673068
*,
30683069
name: Optional[str] = None,
30693070
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3070-
timeout: Optional[float] = None,
3071+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
30713072
metadata: Sequence[Tuple[str, str]] = (),
30723073
) -> resources.PhraseMatcher:
30733074
r"""Gets a phrase matcher.
@@ -3169,7 +3170,7 @@ def list_phrase_matchers(
31693170
*,
31703171
parent: Optional[str] = None,
31713172
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3172-
timeout: Optional[float] = None,
3173+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
31733174
metadata: Sequence[Tuple[str, str]] = (),
31743175
) -> pagers.ListPhraseMatchersPager:
31753176
r"""Lists phrase matchers.
@@ -3285,7 +3286,7 @@ def delete_phrase_matcher(
32853286
*,
32863287
name: Optional[str] = None,
32873288
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3288-
timeout: Optional[float] = None,
3289+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
32893290
metadata: Sequence[Tuple[str, str]] = (),
32903291
) -> None:
32913292
r"""Deletes a phrase matcher.
@@ -3378,7 +3379,7 @@ def update_phrase_matcher(
33783379
phrase_matcher: Optional[resources.PhraseMatcher] = None,
33793380
update_mask: Optional[field_mask_pb2.FieldMask] = None,
33803381
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3381-
timeout: Optional[float] = None,
3382+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
33823383
metadata: Sequence[Tuple[str, str]] = (),
33833384
) -> resources.PhraseMatcher:
33843385
r"""Updates a phrase matcher.
@@ -3492,7 +3493,7 @@ def calculate_stats(
34923493
*,
34933494
location: Optional[str] = None,
34943495
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3495-
timeout: Optional[float] = None,
3496+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
34963497
metadata: Sequence[Tuple[str, str]] = (),
34973498
) -> contact_center_insights.CalculateStatsResponse:
34983499
r"""Gets conversation statistics.
@@ -3596,7 +3597,7 @@ def get_settings(
35963597
*,
35973598
name: Optional[str] = None,
35983599
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3599-
timeout: Optional[float] = None,
3600+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
36003601
metadata: Sequence[Tuple[str, str]] = (),
36013602
) -> resources.Settings:
36023603
r"""Gets project-level settings.
@@ -3699,7 +3700,7 @@ def update_settings(
36993700
settings: Optional[resources.Settings] = None,
37003701
update_mask: Optional[field_mask_pb2.FieldMask] = None,
37013702
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3702-
timeout: Optional[float] = None,
3703+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
37033704
metadata: Sequence[Tuple[str, str]] = (),
37043705
) -> resources.Settings:
37053706
r"""Updates project-level settings.
@@ -3810,7 +3811,7 @@ def create_view(
38103811
parent: Optional[str] = None,
38113812
view: Optional[resources.View] = None,
38123813
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3813-
timeout: Optional[float] = None,
3814+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
38143815
metadata: Sequence[Tuple[str, str]] = (),
38153816
) -> resources.View:
38163817
r"""Creates a view.
@@ -3920,7 +3921,7 @@ def get_view(
39203921
*,
39213922
name: Optional[str] = None,
39223923
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3923-
timeout: Optional[float] = None,
3924+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
39243925
metadata: Sequence[Tuple[str, str]] = (),
39253926
) -> resources.View:
39263927
r"""Gets a view.
@@ -4019,7 +4020,7 @@ def list_views(
40194020
*,
40204021
parent: Optional[str] = None,
40214022
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4022-
timeout: Optional[float] = None,
4023+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
40234024
metadata: Sequence[Tuple[str, str]] = (),
40244025
) -> pagers.ListViewsPager:
40254026
r"""Lists views.
@@ -4135,7 +4136,7 @@ def update_view(
41354136
view: Optional[resources.View] = None,
41364137
update_mask: Optional[field_mask_pb2.FieldMask] = None,
41374138
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4138-
timeout: Optional[float] = None,
4139+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
41394140
metadata: Sequence[Tuple[str, str]] = (),
41404141
) -> resources.View:
41414142
r"""Updates a view.
@@ -4242,7 +4243,7 @@ def delete_view(
42424243
*,
42434244
name: Optional[str] = None,
42444245
retry: OptionalRetry = gapic_v1.method.DEFAULT,
4245-
timeout: Optional[float] = None,
4246+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
42464247
metadata: Sequence[Tuple[str, str]] = (),
42474248
) -> None:
42484249
r"""Deletes a view.
@@ -4339,14 +4340,9 @@ def __exit__(self, type, value, traceback):
43394340
self.transport.close()
43404341

43414342

4342-
try:
4343-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
4344-
gapic_version=pkg_resources.get_distribution(
4345-
"google-cloud-contact-center-insights",
4346-
).version,
4347-
)
4348-
except pkg_resources.DistributionNotFound:
4349-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
4343+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
4344+
gapic_version=package_version.__version__
4345+
)
43504346

43514347

43524348
__all__ = ("ContactCenterInsightsClient",)

packages/google-cloud-contact-center-insights/google/cloud/contact_center_insights_v1/services/contact_center_insights/transports/base.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,16 @@
2525
from google.longrunning import operations_pb2 # type: ignore
2626
from google.oauth2 import service_account # type: ignore
2727
from google.protobuf import empty_pb2 # type: ignore
28-
import pkg_resources
2928

29+
from google.cloud.contact_center_insights_v1 import gapic_version as package_version
3030
from google.cloud.contact_center_insights_v1.types import (
3131
contact_center_insights,
3232
resources,
3333
)
3434

35-
try:
36-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
37-
gapic_version=pkg_resources.get_distribution(
38-
"google-cloud-contact-center-insights",
39-
).version,
40-
)
41-
except pkg_resources.DistributionNotFound:
42-
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
35+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
36+
gapic_version=package_version.__version__
37+
)
4338

4439

4540
class ContactCenterInsightsTransport(abc.ABC):

packages/google-cloud-contact-center-insights/release-please-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
".": {
55
"release-type": "python",
66
"extra-files": [
7+
"google/cloud/contact_center_insights_v1/gapic_version.py",
78
"google/cloud/contact_center_insights/gapic_version.py",
89
{
910
"type": "json",

0 commit comments

Comments
 (0)