Skip to content

Commit 3c73dee

Browse files
feat: [advisorynotifications] updating Cloud Client Libraries with new field NotificationType for advisorynotifications.googleapis.com (#9290)
* feat: updating Cloud Client Libraries with new field NotificationType for advisorynotifications.googleapis.com PiperOrigin-RevId: 520321196 Source-Link: googleapis/googleapis@8feac32 Source-Link: https://github.com/googleapis/googleapis-gen/commit/484a5559b134b3ca0682c8bedc59f5401811dfaf Copy-Tag: eyJwIjoiamF2YS1hZHZpc29yeW5vdGlmaWNhdGlvbnMvLk93bEJvdC55YW1sIiwiaCI6IjQ4NGE1NTU5YjEzNGIzY2EwNjgyYzhiZWRjNTlmNTQwMTgxMWRmYWYifQ== * 🦉 Updates from OwlBot post-processor 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> Co-authored-by: Deepankar Dixit <[email protected]>
1 parent c4e99d2 commit 3c73dee

File tree

7 files changed

+455
-71
lines changed

7 files changed

+455
-71
lines changed

java-advisorynotifications/google-cloud-advisorynotifications/src/test/java/com/google/cloud/advisorynotifications/v1/AdvisoryNotificationsServiceClientHttpJsonTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ public void getNotificationTest() throws Exception {
186186
.setSubject(Subject.newBuilder().build())
187187
.addAllMessages(new ArrayList<Message>())
188188
.setCreateTime(Timestamp.newBuilder().build())
189+
.setNotificationType(NotificationType.forNumber(0))
189190
.build();
190191
mockService.addResponse(expectedResponse);
191192

@@ -234,6 +235,7 @@ public void getNotificationTest2() throws Exception {
234235
.setSubject(Subject.newBuilder().build())
235236
.addAllMessages(new ArrayList<Message>())
236237
.setCreateTime(Timestamp.newBuilder().build())
238+
.setNotificationType(NotificationType.forNumber(0))
237239
.build();
238240
mockService.addResponse(expectedResponse);
239241

java-advisorynotifications/google-cloud-advisorynotifications/src/test/java/com/google/cloud/advisorynotifications/v1/AdvisoryNotificationsServiceClientTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ public void getNotificationTest() throws Exception {
178178
.setSubject(Subject.newBuilder().build())
179179
.addAllMessages(new ArrayList<Message>())
180180
.setCreateTime(Timestamp.newBuilder().build())
181+
.setNotificationType(NotificationType.forNumber(0))
181182
.build();
182183
mockAdvisoryNotificationsService.addResponse(expectedResponse);
183184

@@ -220,6 +221,7 @@ public void getNotificationTest2() throws Exception {
220221
.setSubject(Subject.newBuilder().build())
221222
.addAllMessages(new ArrayList<Message>())
222223
.setCreateTime(Timestamp.newBuilder().build())
224+
.setNotificationType(NotificationType.forNumber(0))
223225
.build();
224226
mockAdvisoryNotificationsService.addResponse(expectedResponse);
225227

java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/Notification.java

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ private Notification(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)
4141
private Notification() {
4242
name_ = "";
4343
messages_ = java.util.Collections.emptyList();
44+
notificationType_ = 0;
4445
}
4546

4647
@java.lang.Override
@@ -295,6 +296,43 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
295296
return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
296297
}
297298

299+
public static final int NOTIFICATION_TYPE_FIELD_NUMBER = 12;
300+
private int notificationType_ = 0;
301+
/**
302+
*
303+
*
304+
* <pre>
305+
* Type of notification
306+
* </pre>
307+
*
308+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
309+
*
310+
* @return The enum numeric value on the wire for notificationType.
311+
*/
312+
@java.lang.Override
313+
public int getNotificationTypeValue() {
314+
return notificationType_;
315+
}
316+
/**
317+
*
318+
*
319+
* <pre>
320+
* Type of notification
321+
* </pre>
322+
*
323+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
324+
*
325+
* @return The notificationType.
326+
*/
327+
@java.lang.Override
328+
public com.google.cloud.advisorynotifications.v1.NotificationType getNotificationType() {
329+
com.google.cloud.advisorynotifications.v1.NotificationType result =
330+
com.google.cloud.advisorynotifications.v1.NotificationType.forNumber(notificationType_);
331+
return result == null
332+
? com.google.cloud.advisorynotifications.v1.NotificationType.UNRECOGNIZED
333+
: result;
334+
}
335+
298336
private byte memoizedIsInitialized = -1;
299337

300338
@java.lang.Override
@@ -321,6 +359,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
321359
if (createTime_ != null) {
322360
output.writeMessage(4, getCreateTime());
323361
}
362+
if (notificationType_
363+
!= com.google.cloud.advisorynotifications.v1.NotificationType.NOTIFICATION_TYPE_UNSPECIFIED
364+
.getNumber()) {
365+
output.writeEnum(12, notificationType_);
366+
}
324367
getUnknownFields().writeTo(output);
325368
}
326369

@@ -342,6 +385,11 @@ public int getSerializedSize() {
342385
if (createTime_ != null) {
343386
size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime());
344387
}
388+
if (notificationType_
389+
!= com.google.cloud.advisorynotifications.v1.NotificationType.NOTIFICATION_TYPE_UNSPECIFIED
390+
.getNumber()) {
391+
size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, notificationType_);
392+
}
345393
size += getUnknownFields().getSerializedSize();
346394
memoizedSize = size;
347395
return size;
@@ -368,6 +416,7 @@ public boolean equals(final java.lang.Object obj) {
368416
if (hasCreateTime()) {
369417
if (!getCreateTime().equals(other.getCreateTime())) return false;
370418
}
419+
if (notificationType_ != other.notificationType_) return false;
371420
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
372421
return true;
373422
}
@@ -393,6 +442,8 @@ public int hashCode() {
393442
hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
394443
hash = (53 * hash) + getCreateTime().hashCode();
395444
}
445+
hash = (37 * hash) + NOTIFICATION_TYPE_FIELD_NUMBER;
446+
hash = (53 * hash) + notificationType_;
396447
hash = (29 * hash) + getUnknownFields().hashCode();
397448
memoizedHashCode = hash;
398449
return hash;
@@ -552,6 +603,7 @@ public Builder clear() {
552603
createTimeBuilder_.dispose();
553604
createTimeBuilder_ = null;
554605
}
606+
notificationType_ = 0;
555607
return this;
556608
}
557609

@@ -611,6 +663,9 @@ private void buildPartial0(com.google.cloud.advisorynotifications.v1.Notificatio
611663
if (((from_bitField0_ & 0x00000008) != 0)) {
612664
result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build();
613665
}
666+
if (((from_bitField0_ & 0x00000010) != 0)) {
667+
result.notificationType_ = notificationType_;
668+
}
614669
}
615670

616671
@java.lang.Override
@@ -697,6 +752,9 @@ public Builder mergeFrom(com.google.cloud.advisorynotifications.v1.Notification
697752
if (other.hasCreateTime()) {
698753
mergeCreateTime(other.getCreateTime());
699754
}
755+
if (other.notificationType_ != 0) {
756+
setNotificationTypeValue(other.getNotificationTypeValue());
757+
}
700758
this.mergeUnknownFields(other.getUnknownFields());
701759
onChanged();
702760
return this;
@@ -755,6 +813,12 @@ public Builder mergeFrom(
755813
bitField0_ |= 0x00000008;
756814
break;
757815
} // case 34
816+
case 96:
817+
{
818+
notificationType_ = input.readEnum();
819+
bitField0_ |= 0x00000010;
820+
break;
821+
} // case 96
758822
default:
759823
{
760824
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -1628,6 +1692,99 @@ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
16281692
return createTimeBuilder_;
16291693
}
16301694

1695+
private int notificationType_ = 0;
1696+
/**
1697+
*
1698+
*
1699+
* <pre>
1700+
* Type of notification
1701+
* </pre>
1702+
*
1703+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
1704+
*
1705+
* @return The enum numeric value on the wire for notificationType.
1706+
*/
1707+
@java.lang.Override
1708+
public int getNotificationTypeValue() {
1709+
return notificationType_;
1710+
}
1711+
/**
1712+
*
1713+
*
1714+
* <pre>
1715+
* Type of notification
1716+
* </pre>
1717+
*
1718+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
1719+
*
1720+
* @param value The enum numeric value on the wire for notificationType to set.
1721+
* @return This builder for chaining.
1722+
*/
1723+
public Builder setNotificationTypeValue(int value) {
1724+
notificationType_ = value;
1725+
bitField0_ |= 0x00000010;
1726+
onChanged();
1727+
return this;
1728+
}
1729+
/**
1730+
*
1731+
*
1732+
* <pre>
1733+
* Type of notification
1734+
* </pre>
1735+
*
1736+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
1737+
*
1738+
* @return The notificationType.
1739+
*/
1740+
@java.lang.Override
1741+
public com.google.cloud.advisorynotifications.v1.NotificationType getNotificationType() {
1742+
com.google.cloud.advisorynotifications.v1.NotificationType result =
1743+
com.google.cloud.advisorynotifications.v1.NotificationType.forNumber(notificationType_);
1744+
return result == null
1745+
? com.google.cloud.advisorynotifications.v1.NotificationType.UNRECOGNIZED
1746+
: result;
1747+
}
1748+
/**
1749+
*
1750+
*
1751+
* <pre>
1752+
* Type of notification
1753+
* </pre>
1754+
*
1755+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
1756+
*
1757+
* @param value The notificationType to set.
1758+
* @return This builder for chaining.
1759+
*/
1760+
public Builder setNotificationType(
1761+
com.google.cloud.advisorynotifications.v1.NotificationType value) {
1762+
if (value == null) {
1763+
throw new NullPointerException();
1764+
}
1765+
bitField0_ |= 0x00000010;
1766+
notificationType_ = value.getNumber();
1767+
onChanged();
1768+
return this;
1769+
}
1770+
/**
1771+
*
1772+
*
1773+
* <pre>
1774+
* Type of notification
1775+
* </pre>
1776+
*
1777+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
1778+
*
1779+
* @return This builder for chaining.
1780+
*/
1781+
public Builder clearNotificationType() {
1782+
bitField0_ = (bitField0_ & ~0x00000010);
1783+
notificationType_ = 0;
1784+
onChanged();
1785+
return this;
1786+
}
1787+
16311788
@java.lang.Override
16321789
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
16331790
return super.setUnknownFields(unknownFields);

java-advisorynotifications/proto-google-cloud-advisorynotifications-v1/src/main/java/com/google/cloud/advisorynotifications/v1/NotificationOrBuilder.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,29 @@ public interface NotificationOrBuilder
176176
* </code>
177177
*/
178178
com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();
179+
180+
/**
181+
*
182+
*
183+
* <pre>
184+
* Type of notification
185+
* </pre>
186+
*
187+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
188+
*
189+
* @return The enum numeric value on the wire for notificationType.
190+
*/
191+
int getNotificationTypeValue();
192+
/**
193+
*
194+
*
195+
* <pre>
196+
* Type of notification
197+
* </pre>
198+
*
199+
* <code>.google.cloud.advisorynotifications.v1.NotificationType notification_type = 12;</code>
200+
*
201+
* @return The notificationType.
202+
*/
203+
com.google.cloud.advisorynotifications.v1.NotificationType getNotificationType();
179204
}

0 commit comments

Comments
 (0)