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

Commit

Permalink
chore: use gapic-generator-python 0.53.4 (#85)
Browse files Browse the repository at this point in the history
- [ ] 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: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
  • Loading branch information
gcf-owl-bot[bot] committed Nov 1, 2021
1 parent e264240 commit daf9af8
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 238 deletions.

Large diffs are not rendered by default.

Expand Up @@ -30,6 +30,8 @@
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
from google.cloud.contact_center_insights_v1.services.contact_center_insights import (
Expand Down Expand Up @@ -467,7 +469,7 @@ def create_conversation(
parent: str = None,
conversation: resources.Conversation = None,
conversation_id: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Conversation:
Expand Down Expand Up @@ -560,7 +562,7 @@ def update_conversation(
*,
conversation: resources.Conversation = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Conversation:
Expand Down Expand Up @@ -638,7 +640,7 @@ def get_conversation(
request: Union[contact_center_insights.GetConversationRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Conversation:
Expand Down Expand Up @@ -706,7 +708,7 @@ def list_conversations(
request: Union[contact_center_insights.ListConversationsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListConversationsPager:
Expand Down Expand Up @@ -785,7 +787,7 @@ def delete_conversation(
request: Union[contact_center_insights.DeleteConversationRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -850,7 +852,7 @@ def create_analysis(
*,
parent: str = None,
analysis: resources.Analysis = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -939,7 +941,7 @@ def get_analysis(
request: Union[contact_center_insights.GetAnalysisRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Analysis:
Expand Down Expand Up @@ -1007,7 +1009,7 @@ def list_analyses(
request: Union[contact_center_insights.ListAnalysesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListAnalysesPager:
Expand Down Expand Up @@ -1085,7 +1087,7 @@ def delete_analysis(
request: Union[contact_center_insights.DeleteAnalysisRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -1148,7 +1150,7 @@ def export_insights_data(
request: Union[contact_center_insights.ExportInsightsDataRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1231,7 +1233,7 @@ def create_issue_model(
*,
parent: str = None,
issue_model: resources.IssueModel = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1321,7 +1323,7 @@ def update_issue_model(
*,
issue_model: resources.IssueModel = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.IssueModel:
Expand Down Expand Up @@ -1399,7 +1401,7 @@ def get_issue_model(
request: Union[contact_center_insights.GetIssueModelRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.IssueModel:
Expand Down Expand Up @@ -1467,7 +1469,7 @@ def list_issue_models(
request: Union[contact_center_insights.ListIssueModelsRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> contact_center_insights.ListIssueModelsResponse:
Expand Down Expand Up @@ -1535,7 +1537,7 @@ def delete_issue_model(
request: Union[contact_center_insights.DeleteIssueModelRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1627,7 +1629,7 @@ def deploy_issue_model(
request: Union[contact_center_insights.DeployIssueModelRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1709,7 +1711,7 @@ def undeploy_issue_model(
request: Union[contact_center_insights.UndeployIssueModelRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
Expand Down Expand Up @@ -1793,7 +1795,7 @@ def get_issue(
request: Union[contact_center_insights.GetIssueRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Issue:
Expand Down Expand Up @@ -1861,7 +1863,7 @@ def list_issues(
request: Union[contact_center_insights.ListIssuesRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> contact_center_insights.ListIssuesResponse:
Expand Down Expand Up @@ -1930,7 +1932,7 @@ def update_issue(
*,
issue: resources.Issue = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Issue:
Expand Down Expand Up @@ -2009,7 +2011,7 @@ def calculate_issue_model_stats(
] = None,
*,
issue_model: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> contact_center_insights.CalculateIssueModelStatsResponse:
Expand Down Expand Up @@ -2087,7 +2089,7 @@ def create_phrase_matcher(
*,
parent: str = None,
phrase_matcher: resources.PhraseMatcher = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.PhraseMatcher:
Expand Down Expand Up @@ -2167,7 +2169,7 @@ def get_phrase_matcher(
request: Union[contact_center_insights.GetPhraseMatcherRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.PhraseMatcher:
Expand Down Expand Up @@ -2236,7 +2238,7 @@ def list_phrase_matchers(
request: Union[contact_center_insights.ListPhraseMatchersRequest, dict] = None,
*,
parent: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListPhraseMatchersPager:
Expand Down Expand Up @@ -2315,7 +2317,7 @@ def delete_phrase_matcher(
request: Union[contact_center_insights.DeletePhraseMatcherRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
Expand Down Expand Up @@ -2379,7 +2381,7 @@ def calculate_stats(
request: Union[contact_center_insights.CalculateStatsRequest, dict] = None,
*,
location: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> contact_center_insights.CalculateStatsResponse:
Expand Down Expand Up @@ -2450,7 +2452,7 @@ def get_settings(
request: Union[contact_center_insights.GetSettingsRequest, dict] = None,
*,
name: str = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Settings:
Expand Down Expand Up @@ -2520,7 +2522,7 @@ def update_settings(
*,
settings: resources.Settings = None,
update_mask: field_mask_pb2.FieldMask = None,
retry: retries.Retry = gapic_v1.method.DEFAULT,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Settings:
Expand Down
Expand Up @@ -15,7 +15,6 @@
#
import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources

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

try:
# google.auth.__version__ was added in 1.26.0
_GOOGLE_AUTH_VERSION = google.auth.__version__
except AttributeError:
try: # try pkg_resources if it is available
_GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version
except pkg_resources.DistributionNotFound: # pragma: NO COVER
_GOOGLE_AUTH_VERSION = None


class ContactCenterInsightsTransport(abc.ABC):
"""Abstract transport class for ContactCenterInsights."""
Expand Down Expand Up @@ -99,7 +89,7 @@ def __init__(
host += ":443"
self._host = host

scopes_kwargs = self._get_scopes_kwargs(self._host, scopes)
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
Expand Down Expand Up @@ -132,29 +122,6 @@ def __init__(
# Save the credentials.
self._credentials = credentials

# TODO(busunkim): This method is in the base transport
# to avoid duplicating code across the transport classes. These functions
# should be deleted once the minimum required versions of google-auth is increased.

# TODO: Remove this function once google-auth >= 1.25.0 is required
@classmethod
def _get_scopes_kwargs(
cls, host: str, scopes: Optional[Sequence[str]]
) -> Dict[str, Optional[Sequence[str]]]:
"""Returns scopes kwargs to pass to google-auth methods depending on the google-auth version"""

scopes_kwargs = {}

if _GOOGLE_AUTH_VERSION and (
packaging.version.parse(_GOOGLE_AUTH_VERSION)
>= packaging.version.parse("1.25.0")
):
scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES}
else:
scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES}

return scopes_kwargs

def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
Expand Down Expand Up @@ -266,7 +233,7 @@ def close(self):
raise NotImplementedError()

@property
def operations_client(self) -> operations_v1.OperationsClient:
def operations_client(self):
"""Return the client designed to process long-running operations."""
raise NotImplementedError()

Expand Down
Expand Up @@ -115,7 +115,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
Expand Up @@ -21,7 +21,6 @@
from google.api_core import operations_v1 # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
import packaging.version

import grpc # type: ignore
from grpc.experimental import aio # type: ignore
Expand Down Expand Up @@ -162,7 +161,7 @@ def __init__(
self._grpc_channel = None
self._ssl_channel_credentials = ssl_channel_credentials
self._stubs: Dict[str, Callable] = {}
self._operations_client = None
self._operations_client: Optional[operations_v1.OperationsAsyncClient] = None

if api_mtls_endpoint:
warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
Expand Down
Expand Up @@ -425,9 +425,12 @@ class DeleteAnalysisRequest(proto.Message):
class ExportInsightsDataRequest(proto.Message):
r"""The request to export insights.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
big_query_destination (google.cloud.contact_center_insights_v1.types.ExportInsightsDataRequest.BigQueryDestination):
Specified if sink is a BigQuery table.
This field is a member of `oneof`_ ``destination``.
parent (str):
Required. The parent resource to export data
from.
Expand Down

0 comments on commit daf9af8

Please sign in to comment.