Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit96b9091

Browse files
feat: Add NotificationType field for advisorynotifications.googleapis.com (#10877)
* feat: updating Cloud Client Libraries with new field NotificationType for advisorynotifications.googleapis.comPiperOrigin-RevId: 520321196Source-Link:googleapis/googleapis@8feac32Source-Link:googleapis/googleapis-gen@484a555Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWFkdmlzb3J5bm90aWZpY2F0aW9ucy8uT3dsQm90LnlhbWwiLCJoIjoiNDg0YTU1NTliMTM0YjNjYTA2ODJjOGJlZGM1OWY1NDAxODExZGZhZiJ9* 🦉 Updates from OwlBot post-processorSeehttps://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>
1 parentfc85381 commit96b9091

File tree

6 files changed

+46
-1
lines changed

6 files changed

+46
-1
lines changed

‎packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
LocalizationState,
3434
Message,
3535
Notification,
36+
NotificationType,
3637
NotificationView,
3738
Subject,
3839
Text,
@@ -51,5 +52,6 @@
5152
"Subject",
5253
"Text",
5354
"LocalizationState",
55+
"NotificationType",
5456
"NotificationView",
5557
)

‎packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications_v1/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
LocalizationState,
3232
Message,
3333
Notification,
34+
NotificationType,
3435
NotificationView,
3536
Subject,
3637
Text,
@@ -47,6 +48,7 @@
4748
"LocalizationState",
4849
"Message",
4950
"Notification",
51+
"NotificationType",
5052
"NotificationView",
5153
"Subject",
5254
"Text",

‎packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications_v1/types/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
LocalizationState,
2323
Message,
2424
Notification,
25+
NotificationType,
2526
NotificationView,
2627
Subject,
2728
Text,
@@ -38,5 +39,6 @@
3839
"Subject",
3940
"Text",
4041
"LocalizationState",
42+
"NotificationType",
4143
"NotificationView",
4244
)

‎packages/google-cloud-advisorynotifications/google/cloud/advisorynotifications_v1/types/service.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
manifest={
2626
"NotificationView",
2727
"LocalizationState",
28+
"NotificationType",
2829
"Notification",
2930
"Text",
3031
"Subject",
@@ -86,6 +87,22 @@ class LocalizationState(proto.Enum):
8687
LOCALIZATION_STATE_COMPLETED=3
8788

8889

90+
classNotificationType(proto.Enum):
91+
r"""Type of notification
92+
93+
Values:
94+
NOTIFICATION_TYPE_UNSPECIFIED (0):
95+
Default type
96+
NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY (1):
97+
Security and privacy advisory notifications
98+
NOTIFICATION_TYPE_SENSITIVE_ACTIONS (2):
99+
Sensitive action notifications
100+
"""
101+
NOTIFICATION_TYPE_UNSPECIFIED=0
102+
NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY=1
103+
NOTIFICATION_TYPE_SENSITIVE_ACTIONS=2
104+
105+
89106
classNotification(proto.Message):
90107
r"""A notification object for notifying customers about security
91108
and privacy issues.
@@ -102,6 +119,8 @@ class Notification(proto.Message):
102119
create_time (google.protobuf.timestamp_pb2.Timestamp):
103120
Output only. Time the notification was
104121
created.
122+
notification_type (google.cloud.advisorynotifications_v1.types.NotificationType):
123+
Type of notification
105124
"""
106125

107126
name:str=proto.Field(
@@ -123,6 +142,11 @@ class Notification(proto.Message):
123142
number=4,
124143
message=timestamp_pb2.Timestamp,
125144
)
145+
notification_type:"NotificationType"=proto.Field(
146+
proto.ENUM,
147+
number=12,
148+
enum="NotificationType",
149+
)
126150

127151

128152
classText(proto.Message):

‎packages/google-cloud-advisorynotifications/samples/generated_samples/snippet_metadata_google.cloud.advisorynotifications.v1.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language":"PYTHON",
1010
"name":"google-cloud-advisorynotifications",
11-
"version":"0.1.1"
11+
"version":"0.1.0"
1212
},
1313
"snippets": [
1414
{

‎packages/google-cloud-advisorynotifications/tests/unit/gapic/advisorynotifications_v1/test_advisory_notifications_service.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,7 @@ def test_get_notification(request_type, transport: str = "grpc"):
12261226
# Designate an appropriate return value for the call.
12271227
call.return_value=service.Notification(
12281228
name="name_value",
1229+
notification_type=service.NotificationType.NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY,
12291230
)
12301231
response=client.get_notification(request)
12311232

@@ -1237,6 +1238,10 @@ def test_get_notification(request_type, transport: str = "grpc"):
12371238
# Establish that the response is the type that we expect.
12381239
assertisinstance(response,service.Notification)
12391240
assertresponse.name=="name_value"
1241+
assert (
1242+
response.notification_type
1243+
==service.NotificationType.NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY
1244+
)
12401245

12411246

12421247
deftest_get_notification_empty_call():
@@ -1274,6 +1279,7 @@ async def test_get_notification_async(
12741279
call.return_value=grpc_helpers_async.FakeUnaryUnaryCall(
12751280
service.Notification(
12761281
name="name_value",
1282+
notification_type=service.NotificationType.NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY,
12771283
)
12781284
)
12791285
response=awaitclient.get_notification(request)
@@ -1286,6 +1292,10 @@ async def test_get_notification_async(
12861292
# Establish that the response is the type that we expect.
12871293
assertisinstance(response,service.Notification)
12881294
assertresponse.name=="name_value"
1295+
assert (
1296+
response.notification_type
1297+
==service.NotificationType.NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY
1298+
)
12891299

12901300

12911301
@pytest.mark.asyncio
@@ -1805,6 +1815,7 @@ def test_get_notification_rest(request_type):
18051815
# Designate an appropriate value for the returned response.
18061816
return_value=service.Notification(
18071817
name="name_value",
1818+
notification_type=service.NotificationType.NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY,
18081819
)
18091820

18101821
# Wrap the value into a proper Response obj
@@ -1820,6 +1831,10 @@ def test_get_notification_rest(request_type):
18201831
# Establish that the response is the type that we expect.
18211832
assertisinstance(response,service.Notification)
18221833
assertresponse.name=="name_value"
1834+
assert (
1835+
response.notification_type
1836+
==service.NotificationType.NOTIFICATION_TYPE_SECURITY_PRIVACY_ADVISORY
1837+
)
18231838

18241839

18251840
deftest_get_notification_rest_required_fields(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp