Skip to content

Commit

Permalink
feat: [cloudchannel] add deal_code field to message Offer (#8760)
Browse files Browse the repository at this point in the history
* feat: add deal_code field to message Offer

PiperOrigin-RevId: 487295068

Source-Link: googleapis/googleapis@cac4b1e

Source-Link: googleapis/googleapis-gen@e7d283d
Copy-Tag: eyJwIjoiamF2YS1jaGFubmVsLy5Pd2xCb3QueWFtbCIsImgiOiJlN2QyODNkMzgyN2U5MmMzNzRkODQ5NjVjYTI2MjJkZDU5NDM5YjNjIn0=

* 🦉 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 Nov 10, 2022
1 parent fd8bfdd commit 6a84b71
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 62 deletions.
Expand Up @@ -2795,6 +2795,7 @@ public void lookupOfferTest() throws Exception {
.setStartTime(Timestamp.newBuilder().build())
.setEndTime(Timestamp.newBuilder().build())
.addAllParameterDefinitions(new ArrayList<ParameterDefinition>())
.setDealCode("dealCode509806713")
.build();
mockService.addResponse(expectedResponse);

Expand Down
Expand Up @@ -2576,6 +2576,7 @@ public void lookupOfferTest() throws Exception {
.setStartTime(Timestamp.newBuilder().build())
.setEndTime(Timestamp.newBuilder().build())
.addAllParameterDefinitions(new ArrayList<ParameterDefinition>())
.setDealCode("dealCode509806713")
.build();
mockCloudChannelService.addResponse(expectedResponse);

Expand Down
Expand Up @@ -43,6 +43,7 @@ private Offer() {
name_ = "";
priceByResources_ = java.util.Collections.emptyList();
parameterDefinitions_ = java.util.Collections.emptyList();
dealCode_ = "";
}

@java.lang.Override
Expand Down Expand Up @@ -546,6 +547,55 @@ public com.google.cloud.channel.v1.ParameterDefinitionOrBuilder getParameterDefi
return parameterDefinitions_.get(index);
}

public static final int DEAL_CODE_FIELD_NUMBER = 12;
private volatile java.lang.Object dealCode_;
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @return The dealCode.
*/
@java.lang.Override
public java.lang.String getDealCode() {
java.lang.Object ref = dealCode_;
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();
dealCode_ = s;
return s;
}
}
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @return The bytes for dealCode.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDealCodeBytes() {
java.lang.Object ref = dealCode_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
dealCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}

private byte memoizedIsInitialized = -1;

@java.lang.Override
Expand Down Expand Up @@ -587,6 +637,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
for (int i = 0; i < parameterDefinitions_.size(); i++) {
output.writeMessage(9, parameterDefinitions_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dealCode_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 12, dealCode_);
}
getUnknownFields().writeTo(output);
}

Expand Down Expand Up @@ -624,6 +677,9 @@ public int getSerializedSize() {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(9, parameterDefinitions_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dealCode_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, dealCode_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
Expand Down Expand Up @@ -666,6 +722,7 @@ public boolean equals(final java.lang.Object obj) {
if (!getEndTime().equals(other.getEndTime())) return false;
}
if (!getParameterDefinitionsList().equals(other.getParameterDefinitionsList())) return false;
if (!getDealCode().equals(other.getDealCode())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
Expand Down Expand Up @@ -711,6 +768,8 @@ public int hashCode() {
hash = (37 * hash) + PARAMETER_DEFINITIONS_FIELD_NUMBER;
hash = (53 * hash) + getParameterDefinitionsList().hashCode();
}
hash = (37 * hash) + DEAL_CODE_FIELD_NUMBER;
hash = (53 * hash) + getDealCode().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
Expand Down Expand Up @@ -902,6 +961,8 @@ public Builder clear() {
parameterDefinitionsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
dealCode_ = "";

return this;
}

Expand Down Expand Up @@ -978,6 +1039,7 @@ public com.google.cloud.channel.v1.Offer buildPartial() {
} else {
result.parameterDefinitions_ = parameterDefinitionsBuilder_.build();
}
result.dealCode_ = dealCode_;
onBuilt();
return result;
}
Expand Down Expand Up @@ -1103,6 +1165,10 @@ public Builder mergeFrom(com.google.cloud.channel.v1.Offer other) {
}
}
}
if (!other.getDealCode().isEmpty()) {
dealCode_ = other.dealCode_;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
Expand Down Expand Up @@ -1198,6 +1264,12 @@ public Builder mergeFrom(
}
break;
} // case 74
case 98:
{
dealCode_ = input.readStringRequireUtf8();

break;
} // case 98
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
Expand Down Expand Up @@ -3144,6 +3216,112 @@ public com.google.cloud.channel.v1.ParameterDefinition.Builder addParameterDefin
return parameterDefinitionsBuilder_;
}

private java.lang.Object dealCode_ = "";
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @return The dealCode.
*/
public java.lang.String getDealCode() {
java.lang.Object ref = dealCode_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
dealCode_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @return The bytes for dealCode.
*/
public com.google.protobuf.ByteString getDealCodeBytes() {
java.lang.Object ref = dealCode_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
dealCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @param value The dealCode to set.
* @return This builder for chaining.
*/
public Builder setDealCode(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}

dealCode_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @return This builder for chaining.
*/
public Builder clearDealCode() {

dealCode_ = getDefaultInstance().getDealCode();
onChanged();
return this;
}
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @param value The bytes for dealCode to set.
* @return This builder for chaining.
*/
public Builder setDealCodeBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);

dealCode_ = value;
onChanged();
return this;
}

@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
Expand Down
Expand Up @@ -367,4 +367,29 @@ public interface OfferOrBuilder
*/
com.google.cloud.channel.v1.ParameterDefinitionOrBuilder getParameterDefinitionsOrBuilder(
int index);

/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @return The dealCode.
*/
java.lang.String getDealCode();
/**
*
*
* <pre>
* The deal code of the offer to get a special promotion or discount.
* </pre>
*
* <code>string deal_code = 12;</code>
*
* @return The bytes for dealCode.
*/
com.google.protobuf.ByteString getDealCodeBytes();
}

0 comments on commit 6a84b71

Please sign in to comment.