Skip to content

Commit 670db3e

Browse files
feat: add service_account_email for export subscriptions (#2054)
* feat: add service_account_email for export subscriptions PiperOrigin-RevId: 638641437 Source-Link: googleapis/googleapis@a3016a8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/2001c330aee62a9d4e8a9852d8e5bf2662818ad4 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjAwMWMzMzBhZWU2MmE5ZDRlOGE5ODUyZDhlNWJmMjY2MjgxOGFkNCJ9 * 🦉 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
1 parent 3e5dfba commit 670db3e

File tree

8 files changed

+755
-231
lines changed

8 files changed

+755
-231
lines changed

proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfig.java

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ private BigQueryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder
4141
private BigQueryConfig() {
4242
table_ = "";
4343
state_ = 0;
44+
serviceAccountEmail_ = "";
4445
}
4546

4647
@java.lang.Override
@@ -477,6 +478,67 @@ public boolean getUseTableSchema() {
477478
return useTableSchema_;
478479
}
479480

481+
public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 7;
482+
483+
@SuppressWarnings("serial")
484+
private volatile java.lang.Object serviceAccountEmail_ = "";
485+
/**
486+
*
487+
*
488+
*
489+
* Optional. The service account to use to write to BigQuery. The subscription
490+
* creator or updater that specifies this field must have
491+
* `iam.serviceAccounts.actAs` permission on the service account. If not
492+
* specified, the Pub/Sub [service
493+
* agent](https://cloud.google.com/iam/docs/service-agents),
494+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
495+
*
496+
*
497+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
498+
*
499+
* @return The serviceAccountEmail.
500+
*/
501+
@java.lang.Override
502+
public java.lang.String getServiceAccountEmail() {
503+
java.lang.Object ref = serviceAccountEmail_;
504+
if (ref instanceof java.lang.String) {
505+
return (java.lang.String) ref;
506+
} else {
507+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
508+
java.lang.String s = bs.toStringUtf8();
509+
serviceAccountEmail_ = s;
510+
return s;
511+
}
512+
}
513+
/**
514+
*
515+
*
516+
*
517+
* Optional. The service account to use to write to BigQuery. The subscription
518+
* creator or updater that specifies this field must have
519+
* `iam.serviceAccounts.actAs` permission on the service account. If not
520+
* specified, the Pub/Sub [service
521+
* agent](https://cloud.google.com/iam/docs/service-agents),
522+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
523+
*
524+
*
525+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
526+
*
527+
* @return The bytes for serviceAccountEmail.
528+
*/
529+
@java.lang.Override
530+
public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
531+
java.lang.Object ref = serviceAccountEmail_;
532+
if (ref instanceof java.lang.String) {
533+
com.google.protobuf.ByteString b =
534+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
535+
serviceAccountEmail_ = b;
536+
return b;
537+
} else {
538+
return (com.google.protobuf.ByteString) ref;
539+
}
540+
}
541+
480542
private byte memoizedIsInitialized = -1;
481543

482544
@java.lang.Override
@@ -509,6 +571,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
509571
if (useTableSchema_ != false) {
510572
output.writeBool(6, useTableSchema_);
511573
}
574+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) {
575+
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, serviceAccountEmail_);
576+
}
512577
getUnknownFields().writeTo(output);
513578
}
514579

@@ -536,6 +601,9 @@ public int getSerializedSize() {
536601
if (useTableSchema_ != false) {
537602
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useTableSchema_);
538603
}
604+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) {
605+
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, serviceAccountEmail_);
606+
}
539607
size += getUnknownFields().getSerializedSize();
540608
memoizedSize = size;
541609
return size;
@@ -557,6 +625,7 @@ public boolean equals(final java.lang.Object obj) {
557625
if (getDropUnknownFields() != other.getDropUnknownFields()) return false;
558626
if (state_ != other.state_) return false;
559627
if (getUseTableSchema() != other.getUseTableSchema()) return false;
628+
if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false;
560629
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
561630
return true;
562631
}
@@ -580,6 +649,8 @@ public int hashCode() {
580649
hash = (53 * hash) + state_;
581650
hash = (37 * hash) + USE_TABLE_SCHEMA_FIELD_NUMBER;
582651
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTableSchema());
652+
hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER;
653+
hash = (53 * hash) + getServiceAccountEmail().hashCode();
583654
hash = (29 * hash) + getUnknownFields().hashCode();
584655
memoizedHashCode = hash;
585656
return hash;
@@ -724,6 +795,7 @@ public Builder clear() {
724795
dropUnknownFields_ = false;
725796
state_ = 0;
726797
useTableSchema_ = false;
798+
serviceAccountEmail_ = "";
727799
return this;
728800
}
729801

@@ -777,6 +849,9 @@ private void buildPartial0(com.google.pubsub.v1.BigQueryConfig result) {
777849
if (((from_bitField0_ & 0x00000020) != 0)) {
778850
result.useTableSchema_ = useTableSchema_;
779851
}
852+
if (((from_bitField0_ & 0x00000040) != 0)) {
853+
result.serviceAccountEmail_ = serviceAccountEmail_;
854+
}
780855
}
781856

782857
@java.lang.Override
@@ -844,6 +919,11 @@ public Builder mergeFrom(com.google.pubsub.v1.BigQueryConfig other) {
844919
if (other.getUseTableSchema() != false) {
845920
setUseTableSchema(other.getUseTableSchema());
846921
}
922+
if (!other.getServiceAccountEmail().isEmpty()) {
923+
serviceAccountEmail_ = other.serviceAccountEmail_;
924+
bitField0_ |= 0x00000040;
925+
onChanged();
926+
}
847927
this.mergeUnknownFields(other.getUnknownFields());
848928
onChanged();
849929
return this;
@@ -906,6 +986,12 @@ public Builder mergeFrom(
906986
bitField0_ |= 0x00000020;
907987
break;
908988
} // case 48
989+
case 58:
990+
{
991+
serviceAccountEmail_ = input.readStringRequireUtf8();
992+
bitField0_ |= 0x00000040;
993+
break;
994+
} // case 58
909995
default:
910996
{
911997
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
@@ -1389,6 +1475,137 @@ public Builder clearUseTableSchema() {
13891475
return this;
13901476
}
13911477

1478+
private java.lang.Object serviceAccountEmail_ = "";
1479+
/**
1480+
*
1481+
*
1482+
*
1483+
* Optional. The service account to use to write to BigQuery. The subscription
1484+
* creator or updater that specifies this field must have
1485+
* `iam.serviceAccounts.actAs` permission on the service account. If not
1486+
* specified, the Pub/Sub [service
1487+
* agent](https://cloud.google.com/iam/docs/service-agents),
1488+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
1489+
*
1490+
*
1491+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
1492+
*
1493+
* @return The serviceAccountEmail.
1494+
*/
1495+
public java.lang.String getServiceAccountEmail() {
1496+
java.lang.Object ref = serviceAccountEmail_;
1497+
if (!(ref instanceof java.lang.String)) {
1498+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1499+
java.lang.String s = bs.toStringUtf8();
1500+
serviceAccountEmail_ = s;
1501+
return s;
1502+
} else {
1503+
return (java.lang.String) ref;
1504+
}
1505+
}
1506+
/**
1507+
*
1508+
*
1509+
*
1510+
* Optional. The service account to use to write to BigQuery. The subscription
1511+
* creator or updater that specifies this field must have
1512+
* `iam.serviceAccounts.actAs` permission on the service account. If not
1513+
* specified, the Pub/Sub [service
1514+
* agent](https://cloud.google.com/iam/docs/service-agents),
1515+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
1516+
*
1517+
*
1518+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
1519+
*
1520+
* @return The bytes for serviceAccountEmail.
1521+
*/
1522+
public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
1523+
java.lang.Object ref = serviceAccountEmail_;
1524+
if (ref instanceof String) {
1525+
com.google.protobuf.ByteString b =
1526+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1527+
serviceAccountEmail_ = b;
1528+
return b;
1529+
} else {
1530+
return (com.google.protobuf.ByteString) ref;
1531+
}
1532+
}
1533+
/**
1534+
*
1535+
*
1536+
*
1537+
* Optional. The service account to use to write to BigQuery. The subscription
1538+
* creator or updater that specifies this field must have
1539+
* `iam.serviceAccounts.actAs` permission on the service account. If not
1540+
* specified, the Pub/Sub [service
1541+
* agent](https://cloud.google.com/iam/docs/service-agents),
1542+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
1543+
*
1544+
*
1545+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
1546+
*
1547+
* @param value The serviceAccountEmail to set.
1548+
* @return This builder for chaining.
1549+
*/
1550+
public Builder setServiceAccountEmail(java.lang.String value) {
1551+
if (value == null) {
1552+
throw new NullPointerException();
1553+
}
1554+
serviceAccountEmail_ = value;
1555+
bitField0_ |= 0x00000040;
1556+
onChanged();
1557+
return this;
1558+
}
1559+
/**
1560+
*
1561+
*
1562+
*
1563+
* Optional. The service account to use to write to BigQuery. The subscription
1564+
* creator or updater that specifies this field must have
1565+
* `iam.serviceAccounts.actAs` permission on the service account. If not
1566+
* specified, the Pub/Sub [service
1567+
* agent](https://cloud.google.com/iam/docs/service-agents),
1568+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
1569+
*
1570+
*
1571+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
1572+
*
1573+
* @return This builder for chaining.
1574+
*/
1575+
public Builder clearServiceAccountEmail() {
1576+
serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail();
1577+
bitField0_ = (bitField0_ & ~0x00000040);
1578+
onChanged();
1579+
return this;
1580+
}
1581+
/**
1582+
*
1583+
*
1584+
*
1585+
* Optional. The service account to use to write to BigQuery. The subscription
1586+
* creator or updater that specifies this field must have
1587+
* `iam.serviceAccounts.actAs` permission on the service account. If not
1588+
* specified, the Pub/Sub [service
1589+
* agent](https://cloud.google.com/iam/docs/service-agents),
1590+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
1591+
*
1592+
*
1593+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
1594+
*
1595+
* @param value The bytes for serviceAccountEmail to set.
1596+
* @return This builder for chaining.
1597+
*/
1598+
public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) {
1599+
if (value == null) {
1600+
throw new NullPointerException();
1601+
}
1602+
checkByteStringIsUtf8(value);
1603+
serviceAccountEmail_ = value;
1604+
bitField0_ |= 0x00000040;
1605+
onChanged();
1606+
return this;
1607+
}
1608+
13921609
@java.lang.Override
13931610
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
13941611
return super.setUnknownFields(unknownFields);

proto-google-cloud-pubsub-v1/src/main/java/com/google/pubsub/v1/BigQueryConfigOrBuilder.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,39 @@ public interface BigQueryConfigOrBuilder
145145
* @return The useTableSchema.
146146
*/
147147
boolean getUseTableSchema();
148+
149+
/**
150+
*
151+
*
152+
*
153+
* Optional. The service account to use to write to BigQuery. The subscription
154+
* creator or updater that specifies this field must have
155+
* `iam.serviceAccounts.actAs` permission on the service account. If not
156+
* specified, the Pub/Sub [service
157+
* agent](https://cloud.google.com/iam/docs/service-agents),
158+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
159+
*
160+
*
161+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
162+
*
163+
* @return The serviceAccountEmail.
164+
*/
165+
java.lang.String getServiceAccountEmail();
166+
/**
167+
*
168+
*
169+
*
170+
* Optional. The service account to use to write to BigQuery. The subscription
171+
* creator or updater that specifies this field must have
172+
* `iam.serviceAccounts.actAs` permission on the service account. If not
173+
* specified, the Pub/Sub [service
174+
* agent](https://cloud.google.com/iam/docs/service-agents),
175+
* service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com, is used.
176+
*
177+
*
178+
* string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];
179+
*
180+
* @return The bytes for serviceAccountEmail.
181+
*/
182+
com.google.protobuf.ByteString getServiceAccountEmailBytes();
148183
}

0 commit comments

Comments
 (0)