diff --git a/google/cloud/monitoring/__init__.py b/google/cloud/monitoring/__init__.py index a95bc456..60f07f2d 100644 --- a/google/cloud/monitoring/__init__.py +++ b/google/cloud/monitoring/__init__.py @@ -64,6 +64,7 @@ from google.cloud.monitoring_v3.types.common import TimeInterval from google.cloud.monitoring_v3.types.common import TypedValue from google.cloud.monitoring_v3.types.common import ComparisonType +from google.cloud.monitoring_v3.types.common import ServiceTier from google.cloud.monitoring_v3.types.dropped_labels import DroppedLabels from google.cloud.monitoring_v3.types.group import Group from google.cloud.monitoring_v3.types.group_service import CreateGroupRequest @@ -235,6 +236,7 @@ "TimeInterval", "TypedValue", "ComparisonType", + "ServiceTier", "DroppedLabels", "Group", "CreateGroupRequest", diff --git a/google/cloud/monitoring_v3/__init__.py b/google/cloud/monitoring_v3/__init__.py index 3b18dfdb..77f1d7b9 100644 --- a/google/cloud/monitoring_v3/__init__.py +++ b/google/cloud/monitoring_v3/__init__.py @@ -40,6 +40,7 @@ from .types.common import TimeInterval from .types.common import TypedValue from .types.common import ComparisonType +from .types.common import ServiceTier from .types.dropped_labels import DroppedLabels from .types.group import Group from .types.group_service import CreateGroupRequest @@ -215,6 +216,7 @@ "ServiceLevelIndicator", "ServiceLevelObjective", "ServiceMonitoringServiceClient", + "ServiceTier", "SpanContext", "TextLocator", "TimeInterval", diff --git a/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py b/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py index 46d727cb..ff17dd21 100644 --- a/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py +++ b/google/cloud/monitoring_v3/services/notification_channel_service/async_client.py @@ -29,6 +29,7 @@ from google.api import label_pb2 # type: ignore from google.api import launch_stage_pb2 # type: ignore from google.cloud.monitoring_v3.services.notification_channel_service import pagers +from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.cloud.monitoring_v3.types import notification from google.cloud.monitoring_v3.types import notification_service diff --git a/google/cloud/monitoring_v3/services/notification_channel_service/client.py b/google/cloud/monitoring_v3/services/notification_channel_service/client.py index ff563341..6f933d34 100644 --- a/google/cloud/monitoring_v3/services/notification_channel_service/client.py +++ b/google/cloud/monitoring_v3/services/notification_channel_service/client.py @@ -33,6 +33,7 @@ from google.api import label_pb2 # type: ignore from google.api import launch_stage_pb2 # type: ignore from google.cloud.monitoring_v3.services.notification_channel_service import pagers +from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.cloud.monitoring_v3.types import notification from google.cloud.monitoring_v3.types import notification_service diff --git a/google/cloud/monitoring_v3/types/__init__.py b/google/cloud/monitoring_v3/types/__init__.py index 580e317a..427f3a20 100644 --- a/google/cloud/monitoring_v3/types/__init__.py +++ b/google/cloud/monitoring_v3/types/__init__.py @@ -27,6 +27,7 @@ TimeInterval, TypedValue, ComparisonType, + ServiceTier, ) from .dropped_labels import DroppedLabels from .group import Group @@ -143,6 +144,7 @@ "TimeInterval", "TypedValue", "ComparisonType", + "ServiceTier", "DroppedLabels", "Group", "CreateGroupRequest", diff --git a/google/cloud/monitoring_v3/types/alert.py b/google/cloud/monitoring_v3/types/alert.py index bea993da..0d04d385 100644 --- a/google/cloud/monitoring_v3/types/alert.py +++ b/google/cloud/monitoring_v3/types/alert.py @@ -404,8 +404,8 @@ class LogMatch(proto.Message): Attributes: filter (str): Required. A logs-based filter. See `Advanced Logs - Queries `__ for how - this filter should be constructed. + Queries `__ + for how this filter should be constructed. label_extractors (Sequence[google.cloud.monitoring_v3.types.AlertPolicy.Condition.LogMatch.LabelExtractorsEntry]): Optional. A map from a label key to an extractor expression, which is used to extract the value for this label key. Each @@ -417,7 +417,7 @@ class LogMatch(proto.Message): generated by this condition. Please see `the documentation on logs-based metric - ``valueExtractor``\ s `__ + ``valueExtractor``\ s `__ for syntax and examples. """ diff --git a/google/cloud/monitoring_v3/types/common.py b/google/cloud/monitoring_v3/types/common.py index c1a71544..b9fa83f0 100644 --- a/google/cloud/monitoring_v3/types/common.py +++ b/google/cloud/monitoring_v3/types/common.py @@ -22,7 +22,13 @@ __protobuf__ = proto.module( package="google.monitoring.v3", - manifest={"ComparisonType", "TypedValue", "TimeInterval", "Aggregation",}, + manifest={ + "ComparisonType", + "ServiceTier", + "TypedValue", + "TimeInterval", + "Aggregation", + }, ) @@ -39,6 +45,17 @@ class ComparisonType(proto.Enum): COMPARISON_NE = 6 +class ServiceTier(proto.Enum): + r"""The tier of service for a Workspace. Please see the `service tiers + documentation `__ + for more details. + """ + _pb_options = {"deprecated": True} + SERVICE_TIER_UNSPECIFIED = 0 + SERVICE_TIER_BASIC = 1 + SERVICE_TIER_PREMIUM = 2 + + class TypedValue(proto.Message): r"""A single strongly-typed value. diff --git a/google/cloud/monitoring_v3/types/notification.py b/google/cloud/monitoring_v3/types/notification.py index 1df93b17..b1da8ada 100644 --- a/google/cloud/monitoring_v3/types/notification.py +++ b/google/cloud/monitoring_v3/types/notification.py @@ -17,6 +17,7 @@ from google.api import label_pb2 # type: ignore from google.api import launch_stage_pb2 # type: ignore +from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.protobuf import wrappers_pb2 # type: ignore @@ -63,6 +64,9 @@ class NotificationChannelDescriptor(proto.Message): corresponding type. Each label includes a description for how that field should be populated. + supported_tiers (Sequence[google.cloud.monitoring_v3.types.ServiceTier]): + The tiers that support this notification channel; the + project service tier must be one of the supported_tiers. launch_stage (google.api.launch_stage_pb2.LaunchStage): The product launch stage for channels of this type. @@ -75,6 +79,9 @@ class NotificationChannelDescriptor(proto.Message): labels = proto.RepeatedField( proto.MESSAGE, number=4, message=label_pb2.LabelDescriptor, ) + supported_tiers = proto.RepeatedField( + proto.ENUM, number=5, enum=common.ServiceTier, + ) launch_stage = proto.Field(proto.ENUM, number=7, enum=launch_stage_pb2.LaunchStage,) diff --git a/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py b/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py index 3c25e779..167f60b0 100644 --- a/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py +++ b/tests/unit/gapic/monitoring_v3/test_notification_channel_service.py @@ -45,6 +45,7 @@ from google.cloud.monitoring_v3.services.notification_channel_service.transports.base import ( _GOOGLE_AUTH_VERSION, ) +from google.cloud.monitoring_v3.types import common from google.cloud.monitoring_v3.types import mutation_record from google.cloud.monitoring_v3.types import notification from google.cloud.monitoring_v3.types import notification_service @@ -987,6 +988,7 @@ def test_get_notification_channel_descriptor( type_="type__value", display_name="display_name_value", description="description_value", + supported_tiers=[common.ServiceTier.SERVICE_TIER_BASIC], ) response = client.get_notification_channel_descriptor(request) @@ -1001,6 +1003,7 @@ def test_get_notification_channel_descriptor( assert response.type_ == "type__value" assert response.display_name == "display_name_value" assert response.description == "description_value" + assert response.supported_tiers == [common.ServiceTier.SERVICE_TIER_BASIC] def test_get_notification_channel_descriptor_from_dict(): @@ -1048,6 +1051,7 @@ async def test_get_notification_channel_descriptor_async( type_="type__value", display_name="display_name_value", description="description_value", + supported_tiers=[common.ServiceTier.SERVICE_TIER_BASIC], ) ) response = await client.get_notification_channel_descriptor(request) @@ -1063,6 +1067,7 @@ async def test_get_notification_channel_descriptor_async( assert response.type_ == "type__value" assert response.display_name == "display_name_value" assert response.description == "description_value" + assert response.supported_tiers == [common.ServiceTier.SERVICE_TIER_BASIC] @pytest.mark.asyncio