com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-shopping-merchant-promotions-v1beta Show documentation
Show all versions of proto-google-shopping-merchant-promotions-v1beta Show documentation
Proto library for google-shopping-merchant-promotions
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/shopping/merchant/promotions/v1beta/promotions.proto
// Protobuf Java Version: 3.25.4
package com.google.shopping.merchant.promotions.v1beta;
/**
*
*
*
* Request message for the `InsertPromotion` method.
*
*
* Protobuf type {@code google.shopping.merchant.promotions.v1beta.InsertPromotionRequest}
*/
public final class InsertPromotionRequest extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.shopping.merchant.promotions.v1beta.InsertPromotionRequest)
InsertPromotionRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use InsertPromotionRequest.newBuilder() to construct.
private InsertPromotionRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private InsertPromotionRequest() {
parent_ = "";
dataSource_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new InsertPromotionRequest();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_InsertPromotionRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_InsertPromotionRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest.class,
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest.Builder.class);
}
private int bitField0_;
public static final int PARENT_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object parent_ = "";
/**
*
*
*
* Required. The account where the promotion will be inserted.
* Format: accounts/{account}
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @return The parent.
*/
@java.lang.Override
public java.lang.String getParent() {
java.lang.Object ref = parent_;
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();
parent_ = s;
return s;
}
}
/**
*
*
*
* Required. The account where the promotion will be inserted.
* Format: accounts/{account}
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for parent.
*/
@java.lang.Override
public com.google.protobuf.ByteString getParentBytes() {
java.lang.Object ref = parent_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
parent_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PROMOTION_FIELD_NUMBER = 2;
private com.google.shopping.merchant.promotions.v1beta.Promotion promotion_;
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return Whether the promotion field is set.
*/
@java.lang.Override
public boolean hasPromotion() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The promotion.
*/
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.Promotion getPromotion() {
return promotion_ == null
? com.google.shopping.merchant.promotions.v1beta.Promotion.getDefaultInstance()
: promotion_;
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.PromotionOrBuilder getPromotionOrBuilder() {
return promotion_ == null
? com.google.shopping.merchant.promotions.v1beta.Promotion.getDefaultInstance()
: promotion_;
}
public static final int DATA_SOURCE_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object dataSource_ = "";
/**
*
*
*
* Required. The data source of the
* [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC)
* Format:
* `accounts/{account}/dataSources/{datasource}`.
*
*
* string data_source = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The dataSource.
*/
@java.lang.Override
public java.lang.String getDataSource() {
java.lang.Object ref = dataSource_;
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();
dataSource_ = s;
return s;
}
}
/**
*
*
*
* Required. The data source of the
* [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC)
* Format:
* `accounts/{account}/dataSources/{datasource}`.
*
*
* string data_source = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for dataSource.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDataSourceBytes() {
java.lang.Object ref = dataSource_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
dataSource_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getPromotion());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSource_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, dataSource_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPromotion());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(dataSource_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, dataSource_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest)) {
return super.equals(obj);
}
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest other =
(com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest) obj;
if (!getParent().equals(other.getParent())) return false;
if (hasPromotion() != other.hasPromotion()) return false;
if (hasPromotion()) {
if (!getPromotion().equals(other.getPromotion())) return false;
}
if (!getDataSource().equals(other.getDataSource())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + PARENT_FIELD_NUMBER;
hash = (53 * hash) + getParent().hashCode();
if (hasPromotion()) {
hash = (37 * hash) + PROMOTION_FIELD_NUMBER;
hash = (53 * hash) + getPromotion().hashCode();
}
hash = (37 * hash) + DATA_SOURCE_FIELD_NUMBER;
hash = (53 * hash) + getDataSource().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* Request message for the `InsertPromotion` method.
*
*
* Protobuf type {@code google.shopping.merchant.promotions.v1beta.InsertPromotionRequest}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.shopping.merchant.promotions.v1beta.InsertPromotionRequest)
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_InsertPromotionRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_InsertPromotionRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest.class,
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest.Builder.class);
}
// Construct using
// com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getPromotionFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
parent_ = "";
promotion_ = null;
if (promotionBuilder_ != null) {
promotionBuilder_.dispose();
promotionBuilder_ = null;
}
dataSource_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.shopping.merchant.promotions.v1beta.PromotionsProto
.internal_static_google_shopping_merchant_promotions_v1beta_InsertPromotionRequest_descriptor;
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
getDefaultInstanceForType() {
return com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
.getDefaultInstance();
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest build() {
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest buildPartial() {
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest result =
new com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.parent_ = parent_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.promotion_ = promotionBuilder_ == null ? promotion_ : promotionBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.dataSource_ = dataSource_;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest) {
return mergeFrom(
(com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest other) {
if (other
== com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
.getDefaultInstance()) return this;
if (!other.getParent().isEmpty()) {
parent_ = other.parent_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.hasPromotion()) {
mergePromotion(other.getPromotion());
}
if (!other.getDataSource().isEmpty()) {
dataSource_ = other.dataSource_;
bitField0_ |= 0x00000004;
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
parent_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
input.readMessage(getPromotionFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
dataSource_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object parent_ = "";
/**
*
*
*
* Required. The account where the promotion will be inserted.
* Format: accounts/{account}
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @return The parent.
*/
public java.lang.String getParent() {
java.lang.Object ref = parent_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
parent_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The account where the promotion will be inserted.
* Format: accounts/{account}
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for parent.
*/
public com.google.protobuf.ByteString getParentBytes() {
java.lang.Object ref = parent_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
parent_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The account where the promotion will be inserted.
* Format: accounts/{account}
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The parent to set.
* @return This builder for chaining.
*/
public Builder setParent(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
parent_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Required. The account where the promotion will be inserted.
* Format: accounts/{account}
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearParent() {
parent_ = getDefaultInstance().getParent();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Required. The account where the promotion will be inserted.
* Format: accounts/{account}
*
*
* string parent = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for parent to set.
* @return This builder for chaining.
*/
public Builder setParentBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
parent_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private com.google.shopping.merchant.promotions.v1beta.Promotion promotion_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.Promotion,
com.google.shopping.merchant.promotions.v1beta.Promotion.Builder,
com.google.shopping.merchant.promotions.v1beta.PromotionOrBuilder>
promotionBuilder_;
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return Whether the promotion field is set.
*/
public boolean hasPromotion() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*
* @return The promotion.
*/
public com.google.shopping.merchant.promotions.v1beta.Promotion getPromotion() {
if (promotionBuilder_ == null) {
return promotion_ == null
? com.google.shopping.merchant.promotions.v1beta.Promotion.getDefaultInstance()
: promotion_;
} else {
return promotionBuilder_.getMessage();
}
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setPromotion(com.google.shopping.merchant.promotions.v1beta.Promotion value) {
if (promotionBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
promotion_ = value;
} else {
promotionBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder setPromotion(
com.google.shopping.merchant.promotions.v1beta.Promotion.Builder builderForValue) {
if (promotionBuilder_ == null) {
promotion_ = builderForValue.build();
} else {
promotionBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder mergePromotion(com.google.shopping.merchant.promotions.v1beta.Promotion value) {
if (promotionBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)
&& promotion_ != null
&& promotion_
!= com.google.shopping.merchant.promotions.v1beta.Promotion.getDefaultInstance()) {
getPromotionBuilder().mergeFrom(value);
} else {
promotion_ = value;
}
} else {
promotionBuilder_.mergeFrom(value);
}
if (promotion_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public Builder clearPromotion() {
bitField0_ = (bitField0_ & ~0x00000002);
promotion_ = null;
if (promotionBuilder_ != null) {
promotionBuilder_.dispose();
promotionBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.shopping.merchant.promotions.v1beta.Promotion.Builder getPromotionBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getPromotionFieldBuilder().getBuilder();
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
public com.google.shopping.merchant.promotions.v1beta.PromotionOrBuilder
getPromotionOrBuilder() {
if (promotionBuilder_ != null) {
return promotionBuilder_.getMessageOrBuilder();
} else {
return promotion_ == null
? com.google.shopping.merchant.promotions.v1beta.Promotion.getDefaultInstance()
: promotion_;
}
}
/**
*
*
*
* Required. The promotion to insert.
*
*
*
* .google.shopping.merchant.promotions.v1beta.Promotion promotion = 2 [(.google.api.field_behavior) = REQUIRED];
*
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.Promotion,
com.google.shopping.merchant.promotions.v1beta.Promotion.Builder,
com.google.shopping.merchant.promotions.v1beta.PromotionOrBuilder>
getPromotionFieldBuilder() {
if (promotionBuilder_ == null) {
promotionBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.shopping.merchant.promotions.v1beta.Promotion,
com.google.shopping.merchant.promotions.v1beta.Promotion.Builder,
com.google.shopping.merchant.promotions.v1beta.PromotionOrBuilder>(
getPromotion(), getParentForChildren(), isClean());
promotion_ = null;
}
return promotionBuilder_;
}
private java.lang.Object dataSource_ = "";
/**
*
*
*
* Required. The data source of the
* [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC)
* Format:
* `accounts/{account}/dataSources/{datasource}`.
*
*
* string data_source = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The dataSource.
*/
public java.lang.String getDataSource() {
java.lang.Object ref = dataSource_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
dataSource_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The data source of the
* [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC)
* Format:
* `accounts/{account}/dataSources/{datasource}`.
*
*
* string data_source = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for dataSource.
*/
public com.google.protobuf.ByteString getDataSourceBytes() {
java.lang.Object ref = dataSource_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
dataSource_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The data source of the
* [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC)
* Format:
* `accounts/{account}/dataSources/{datasource}`.
*
*
* string data_source = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The dataSource to set.
* @return This builder for chaining.
*/
public Builder setDataSource(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
dataSource_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Required. The data source of the
* [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC)
* Format:
* `accounts/{account}/dataSources/{datasource}`.
*
*
* string data_source = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearDataSource() {
dataSource_ = getDefaultInstance().getDataSource();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
*
*
* Required. The data source of the
* [promotion](https://support.google.com/merchants/answer/6396268?sjid=5155774230887277618-NC)
* Format:
* `accounts/{account}/dataSources/{datasource}`.
*
*
* string data_source = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for dataSource to set.
* @return This builder for chaining.
*/
public Builder setDataSourceBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
dataSource_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.shopping.merchant.promotions.v1beta.InsertPromotionRequest)
}
// @@protoc_insertion_point(class_scope:google.shopping.merchant.promotions.v1beta.InsertPromotionRequest)
private static final com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest();
}
public static com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public InsertPromotionRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.shopping.merchant.promotions.v1beta.InsertPromotionRequest
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}