Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add service_account_email for export subscriptions #2054

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-pubsub'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-pubsub:1.129.6'
implementation 'com.google.cloud:google-cloud-pubsub:1.129.7'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.129.6"
libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.129.7"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -411,7 +411,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-pubsub.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.129.6
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.129.7
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
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
Loading