Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.56.2 (#162)
Browse files Browse the repository at this point in the history
* chore: update Java and Python dependencies

PiperOrigin-RevId: 408420890

Source-Link: googleapis/googleapis@2921f9f

Source-Link: googleapis/googleapis-gen@6598ca8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjU5OGNhOGNiYmY1MjI2NzMzYTA5OWM0NTA2NTE4YTVhZjZmZjc0YyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 9, 2021
1 parent d309865 commit b1ca7ad
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.analytics.data_v1beta.types import analytics_data_api
from google.analytics.data_v1beta.types import data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,25 @@
# limitations under the License.
#
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.analytics.data_v1beta.types import analytics_data_api
from google.analytics.data_v1beta.types import data
Expand Down Expand Up @@ -280,8 +282,15 @@ def __init__(
client_options = client_options_lib.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
"true",
"false",
):
raise ValueError(
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
)
use_client_cert = (
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
)

client_cert_source_func = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import pkg_resources

import google.auth # type: ignore
import google.api_core # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import grpc_helpers # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class MinuteRange(proto.Message):
minutes of event data (``startMinutesAgo <= 29``), and 360
Analytics properties can request up to the last 60 minutes
of event data (``startMinutesAgo <= 59``).
This field is a member of `oneof`_ ``_start_minutes_ago``.
end_minutes_ago (int):
The inclusive end minute for the query as a number of
Expand All @@ -157,6 +158,7 @@ class MinuteRange(proto.Message):
last 30 minutes of event data (``endMinutesAgo <= 29``), and
360 Analytics properties can request any minute in the last
60 minutes of event data (``endMinutesAgo <= 59``).
This field is a member of `oneof`_ ``_end_minutes_ago``.
name (str):
Assigns a name to this minute range. The dimension
Expand Down Expand Up @@ -226,15 +228,18 @@ class DimensionExpression(proto.Message):
lower_case (google.analytics.data_v1beta.types.DimensionExpression.CaseExpression):
Used to convert a dimension value to lower
case.
This field is a member of `oneof`_ ``one_expression``.
upper_case (google.analytics.data_v1beta.types.DimensionExpression.CaseExpression):
Used to convert a dimension value to upper
case.
This field is a member of `oneof`_ ``one_expression``.
concatenate (google.analytics.data_v1beta.types.DimensionExpression.ConcatenateExpression):
Used to combine dimension values to a single
dimension. For example, dimension "country,
city": concatenate(country, ", ", city).
This field is a member of `oneof`_ ``one_expression``.
"""

Expand Down Expand Up @@ -333,17 +338,21 @@ class FilterExpression(proto.Message):
Attributes:
and_group (google.analytics.data_v1beta.types.FilterExpressionList):
The FilterExpressions in and_group have an AND relationship.
This field is a member of `oneof`_ ``expr``.
or_group (google.analytics.data_v1beta.types.FilterExpressionList):
The FilterExpressions in or_group have an OR relationship.
This field is a member of `oneof`_ ``expr``.
not_expression (google.analytics.data_v1beta.types.FilterExpression):
The FilterExpression is NOT of not_expression.
This field is a member of `oneof`_ ``expr``.
filter (google.analytics.data_v1beta.types.Filter):
A primitive filter.
All fields in filter in same FilterExpression
needs to be either all dimensions or metrics.
This field is a member of `oneof`_ ``expr``.
"""

Expand Down Expand Up @@ -388,15 +397,19 @@ class Filter(proto.Message):
name defined in dimensions or metrics.
string_filter (google.analytics.data_v1beta.types.Filter.StringFilter):
Strings related filter.
This field is a member of `oneof`_ ``one_filter``.
in_list_filter (google.analytics.data_v1beta.types.Filter.InListFilter):
A filter for in list values.
This field is a member of `oneof`_ ``one_filter``.
numeric_filter (google.analytics.data_v1beta.types.Filter.NumericFilter):
A filter for numeric or date values.
This field is a member of `oneof`_ ``one_filter``.
between_filter (google.analytics.data_v1beta.types.Filter.BetweenFilter):
A filter for two values.
This field is a member of `oneof`_ ``one_filter``.
"""

Expand Down Expand Up @@ -508,13 +521,16 @@ class OrderBy(proto.Message):
Attributes:
metric (google.analytics.data_v1beta.types.OrderBy.MetricOrderBy):
Sorts results by a metric's values.
This field is a member of `oneof`_ ``one_order_by``.
dimension (google.analytics.data_v1beta.types.OrderBy.DimensionOrderBy):
Sorts results by a dimension's values.
This field is a member of `oneof`_ ``one_order_by``.
pivot (google.analytics.data_v1beta.types.OrderBy.PivotOrderBy):
Sorts results by a metric's values within a
pivot column group.
This field is a member of `oneof`_ ``one_order_by``.
desc (bool):
If true, sorts by descending order.
Expand Down Expand Up @@ -836,6 +852,7 @@ class ResponseMetaData(proto.Message):
creating this report. To learn more, see `Access and
data-restriction
management <https://support.google.com/analytics/answer/10851388>`__.
This field is a member of `oneof`_ ``_schema_restriction_response``.
currency_code (str):
The currency code used in this report. Intended to be used
Expand All @@ -850,17 +867,20 @@ class ResponseMetaData(proto.Message):
(https://en.wikipedia.org/wiki/ISO_4217); for example "USD",
"EUR", "JPY". To learn more, see
https://support.google.com/analytics/answer/9796179.
This field is a member of `oneof`_ ``_currency_code``.
time_zone (str):
The property's current timezone. Intended to be used to
interpret time-based dimensions like ``hour`` and
``minute``. Formatted as strings from the IANA Time Zone
database (https://www.iana.org/time-zones); for example
"America/New_York" or "Asia/Tokyo".
This field is a member of `oneof`_ ``_time_zone``.
empty_reason (str):
If empty reason is specified, the report is
empty for this reason.
This field is a member of `oneof`_ ``_empty_reason``.
"""

Expand All @@ -884,6 +904,7 @@ class ActiveMetricRestriction(proto.Message):
Attributes:
metric_name (str):
The name of the restricted metric.
This field is a member of `oneof`_ ``_metric_name``.
restricted_metric_types (Sequence[google.analytics.data_v1beta.types.RestrictedMetricType]):
The reason for this metric's restriction.
Expand Down Expand Up @@ -1036,6 +1057,7 @@ class DimensionValue(proto.Message):
value (str):
Value as a string if the dimension type is a
string.
This field is a member of `oneof`_ ``one_value``.
"""

Expand All @@ -1050,6 +1072,7 @@ class MetricValue(proto.Message):
Attributes:
value (str):
Measurement value. See MetricHeader for type.
This field is a member of `oneof`_ ``one_value``.
"""

Expand All @@ -1069,9 +1092,11 @@ class NumericValue(proto.Message):
Attributes:
int64_value (int):
Integer value
This field is a member of `oneof`_ ``one_value``.
double_value (float):
Double value
This field is a member of `oneof`_ ``one_value``.
"""

Expand Down Expand Up @@ -1249,11 +1274,13 @@ class DimensionCompatibility(proto.Message):
for this compatibility information. The
dimension metadata also contains other helpful
information like the UI name and description.
This field is a member of `oneof`_ ``_dimension_metadata``.
compatibility (google.analytics.data_v1beta.types.Compatibility):
The compatibility of this dimension. If the
compatibility is COMPATIBLE, this dimension can
be successfully added to the report.
This field is a member of `oneof`_ ``_compatibility``.
"""

Expand All @@ -1274,11 +1301,13 @@ class MetricCompatibility(proto.Message):
this compatibility information. The metric
metadata also contains other helpful information
like the UI name and description.
This field is a member of `oneof`_ ``_metric_metadata``.
compatibility (google.analytics.data_v1beta.types.Compatibility):
The compatibility of this metric. If the
compatibility is COMPATIBLE, this metric can be
successfully added to the report.
This field is a member of `oneof`_ ``_compatibility``.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,9 @@ def test_get_metadata_flattened():
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].name == "name_value"
arg = args[0].name
mock_val = "name_value"
assert arg == mock_val


def test_get_metadata_flattened_error():
Expand Down Expand Up @@ -1246,7 +1248,9 @@ async def test_get_metadata_flattened_async():
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].name == "name_value"
arg = args[0].name
mock_val = "name_value"
assert arg == mock_val


@pytest.mark.asyncio
Expand Down

0 comments on commit b1ca7ad

Please sign in to comment.