Skip to content

Commit

Permalink
feat: add service_account_email for export subscriptions (#2054)
Browse files Browse the repository at this point in the history
* feat: add service_account_email for export subscriptions

PiperOrigin-RevId: 638641437

Source-Link: googleapis/googleapis@a3016a8

Source-Link: googleapis/googleapis-gen@2001c33
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 <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Jun 3, 2024
1 parent 3e5dfba commit 670db3e
Show file tree
Hide file tree
Showing 8 changed files with 755 additions and 231 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private BigQueryConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder
private BigQueryConfig() {
table_ = "";
state_ = 0;
serviceAccountEmail_ = "";
}

@java.lang.Override
Expand Down Expand Up @@ -477,6 +478,67 @@ public boolean getUseTableSchema() {
return useTableSchema_;
}

public static final int SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER = 7;

@SuppressWarnings("serial")
private volatile java.lang.Object serviceAccountEmail_ = "";
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The serviceAccountEmail.
*/
@java.lang.Override
public java.lang.String getServiceAccountEmail() {
java.lang.Object ref = serviceAccountEmail_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
serviceAccountEmail_ = s;
return s;
}
}
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The bytes for serviceAccountEmail.
*/
@java.lang.Override
public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
java.lang.Object ref = serviceAccountEmail_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
serviceAccountEmail_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -509,6 +571,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (useTableSchema_ != false) {
output.writeBool(6, useTableSchema_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, serviceAccountEmail_);
}
getUnknownFields().writeTo(output);
}

Expand Down Expand Up @@ -536,6 +601,9 @@ public int getSerializedSize() {
if (useTableSchema_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(6, useTableSchema_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAccountEmail_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, serviceAccountEmail_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -557,6 +625,7 @@ public boolean equals(final java.lang.Object obj) {
if (getDropUnknownFields() != other.getDropUnknownFields()) return false;
if (state_ != other.state_) return false;
if (getUseTableSchema() != other.getUseTableSchema()) return false;
if (!getServiceAccountEmail().equals(other.getServiceAccountEmail())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -580,6 +649,8 @@ public int hashCode() {
hash = (53 * hash) + state_;
hash = (37 * hash) + USE_TABLE_SCHEMA_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTableSchema());
hash = (37 * hash) + SERVICE_ACCOUNT_EMAIL_FIELD_NUMBER;
hash = (53 * hash) + getServiceAccountEmail().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -724,6 +795,7 @@ public Builder clear() {
dropUnknownFields_ = false;
state_ = 0;
useTableSchema_ = false;
serviceAccountEmail_ = "";
return this;
}

Expand Down Expand Up @@ -777,6 +849,9 @@ private void buildPartial0(com.google.pubsub.v1.BigQueryConfig result) {
if (((from_bitField0_ & 0x00000020) != 0)) {
result.useTableSchema_ = useTableSchema_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.serviceAccountEmail_ = serviceAccountEmail_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -844,6 +919,11 @@ public Builder mergeFrom(com.google.pubsub.v1.BigQueryConfig other) {
if (other.getUseTableSchema() != false) {
setUseTableSchema(other.getUseTableSchema());
}
if (!other.getServiceAccountEmail().isEmpty()) {
serviceAccountEmail_ = other.serviceAccountEmail_;
bitField0_ |= 0x00000040;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -906,6 +986,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000020;
break;
} // case 48
case 58:
{
serviceAccountEmail_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000040;
break;
} // case 58
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -1389,6 +1475,137 @@ public Builder clearUseTableSchema() {
return this;
}

private java.lang.Object serviceAccountEmail_ = "";
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The serviceAccountEmail.
*/
public java.lang.String getServiceAccountEmail() {
java.lang.Object ref = serviceAccountEmail_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
serviceAccountEmail_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The bytes for serviceAccountEmail.
*/
public com.google.protobuf.ByteString getServiceAccountEmailBytes() {
java.lang.Object ref = serviceAccountEmail_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
serviceAccountEmail_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The serviceAccountEmail to set.
* @return This builder for chaining.
*/
public Builder setServiceAccountEmail(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
serviceAccountEmail_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearServiceAccountEmail() {
serviceAccountEmail_ = getDefaultInstance().getServiceAccountEmail();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The bytes for serviceAccountEmail to set.
* @return This builder for chaining.
*/
public Builder setServiceAccountEmailBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
serviceAccountEmail_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,39 @@ public interface BigQueryConfigOrBuilder
* @return The useTableSchema.
*/
boolean getUseTableSchema();

/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The serviceAccountEmail.
*/
java.lang.String getServiceAccountEmail();
/**
*
*
* <pre>
* Optional. The service account to use to write to BigQuery. The subscription
* creator or updater that specifies this field must have
* `iam.serviceAccounts.actAs` permission on the service account. If not
* specified, the Pub/Sub [service
* agent](https://cloud.google.com/iam/docs/service-agents),
* service-{project_number}&#64;gcp-sa-pubsub.iam.gserviceaccount.com, is used.
* </pre>
*
* <code>string service_account_email = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The bytes for serviceAccountEmail.
*/
com.google.protobuf.ByteString getServiceAccountEmailBytes();
}
Loading

0 comments on commit 670db3e

Please sign in to comment.