Skip to content

Commit

Permalink
feat: add use_topic_schema for Cloud Storage Subscriptions (googleapi…
Browse files Browse the repository at this point in the history
…s#2082)

* feat: add use_topic_schema for Cloud Storage Subscriptions

PiperOrigin-RevId: 643385701

Source-Link: googleapis/googleapis@f29a82a

Source-Link: https://github.com/googleapis/googleapis-gen/commit/f8f3f60ad2ab4e81fe024368ad0430900174e82b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjhmM2Y2MGFkMmFiNGU4MWZlMDI0MzY4YWQwNDMwOTAwMTc0ZTgyYiJ9

* 🦉 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] authored Jun 21, 2024
1 parent 73b097a commit 11d67d4
Show file tree
Hide file tree
Showing 5 changed files with 361 additions and 217 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,17 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum {
* <code>IN_TRANSIT_LOCATION_RESTRICTION = 4;</code>
*/
IN_TRANSIT_LOCATION_RESTRICTION(4),
/**
*
*
* <pre>
* Cannot write to the Cloud Storage bucket due to an incompatibility
* between the topic schema and subscription settings.
* </pre>
*
* <code>SCHEMA_MISMATCH = 5;</code>
*/
SCHEMA_MISMATCH(5),
UNRECOGNIZED(-1),
;

Expand Down Expand Up @@ -185,6 +196,17 @@ public enum State implements com.google.protobuf.ProtocolMessageEnum {
* <code>IN_TRANSIT_LOCATION_RESTRICTION = 4;</code>
*/
public static final int IN_TRANSIT_LOCATION_RESTRICTION_VALUE = 4;
/**
*
*
* <pre>
* Cannot write to the Cloud Storage bucket due to an incompatibility
* between the topic schema and subscription settings.
* </pre>
*
* <code>SCHEMA_MISMATCH = 5;</code>
*/
public static final int SCHEMA_MISMATCH_VALUE = 5;

public final int getNumber() {
if (this == UNRECOGNIZED) {
Expand Down Expand Up @@ -220,6 +242,8 @@ public static State forNumber(int value) {
return NOT_FOUND;
case 4:
return IN_TRANSIT_LOCATION_RESTRICTION;
case 5:
return SCHEMA_MISMATCH;
default:
return null;
}
Expand Down Expand Up @@ -721,6 +745,20 @@ public interface AvroConfigOrBuilder
* @return The writeMetadata.
*/
boolean getWriteMetadata();

/**
*
*
* <pre>
* Optional. When true, the output Cloud Storage file will be serialized
* using the topic schema, if it exists.
* </pre>
*
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
boolean getUseTopicSchema();
}
/**
*
Expand Down Expand Up @@ -788,6 +826,25 @@ public boolean getWriteMetadata() {
return writeMetadata_;
}

public static final int USE_TOPIC_SCHEMA_FIELD_NUMBER = 2;
private boolean useTopicSchema_ = false;
/**
*
*
* <pre>
* Optional. When true, the output Cloud Storage file will be serialized
* using the topic schema, if it exists.
* </pre>
*
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
@java.lang.Override
public boolean getUseTopicSchema() {
return useTopicSchema_;
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand All @@ -805,6 +862,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (writeMetadata_ != false) {
output.writeBool(1, writeMetadata_);
}
if (useTopicSchema_ != false) {
output.writeBool(2, useTopicSchema_);
}
getUnknownFields().writeTo(output);
}

Expand All @@ -817,6 +877,9 @@ public int getSerializedSize() {
if (writeMetadata_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, writeMetadata_);
}
if (useTopicSchema_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, useTopicSchema_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand All @@ -834,6 +897,7 @@ public boolean equals(final java.lang.Object obj) {
(com.google.pubsub.v1.CloudStorageConfig.AvroConfig) obj;

if (getWriteMetadata() != other.getWriteMetadata()) return false;
if (getUseTopicSchema() != other.getUseTopicSchema()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand All @@ -847,6 +911,8 @@ public int hashCode() {
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + WRITE_METADATA_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getWriteMetadata());
hash = (37 * hash) + USE_TOPIC_SCHEMA_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTopicSchema());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -990,6 +1056,7 @@ public Builder clear() {
super.clear();
bitField0_ = 0;
writeMetadata_ = false;
useTopicSchema_ = false;
return this;
}

Expand Down Expand Up @@ -1029,6 +1096,9 @@ private void buildPartial0(com.google.pubsub.v1.CloudStorageConfig.AvroConfig re
if (((from_bitField0_ & 0x00000001) != 0)) {
result.writeMetadata_ = writeMetadata_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.useTopicSchema_ = useTopicSchema_;
}
}

@java.lang.Override
Expand Down Expand Up @@ -1082,6 +1152,9 @@ public Builder mergeFrom(com.google.pubsub.v1.CloudStorageConfig.AvroConfig othe
if (other.getWriteMetadata() != false) {
setWriteMetadata(other.getWriteMetadata());
}
if (other.getUseTopicSchema() != false) {
setUseTopicSchema(other.getUseTopicSchema());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -1114,6 +1187,12 @@ public Builder mergeFrom(
bitField0_ |= 0x00000001;
break;
} // case 8
case 16:
{
useTopicSchema_ = input.readBool();
bitField0_ |= 0x00000002;
break;
} // case 16
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -1201,6 +1280,62 @@ public Builder clearWriteMetadata() {
return this;
}

private boolean useTopicSchema_;
/**
*
*
* <pre>
* Optional. When true, the output Cloud Storage file will be serialized
* using the topic schema, if it exists.
* </pre>
*
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return The useTopicSchema.
*/
@java.lang.Override
public boolean getUseTopicSchema() {
return useTopicSchema_;
}
/**
*
*
* <pre>
* Optional. When true, the output Cloud Storage file will be serialized
* using the topic schema, if it exists.
* </pre>
*
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @param value The useTopicSchema to set.
* @return This builder for chaining.
*/
public Builder setUseTopicSchema(boolean value) {

useTopicSchema_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
* <pre>
* Optional. When true, the output Cloud Storage file will be serialized
* using the topic schema, if it exists.
* </pre>
*
* <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
*
* @return This builder for chaining.
*/
public Builder clearUseTopicSchema() {
bitField0_ = (bitField0_ & ~0x00000002);
useTopicSchema_ = false;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
Expand Down
Loading

0 comments on commit 11d67d4

Please sign in to comment.