1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/retail/v2/catalog.proto 18 19 package com.google.cloud.retail.v2; 20 21 /** 22 * 23 * 24 * <pre> 25 * Configures what level the product should be uploaded with regards to 26 * how users will be send events and how predictions will be made. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.retail.v2.ProductLevelConfig} 30 */ 31 public final class ProductLevelConfig extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.retail.v2.ProductLevelConfig) 34 ProductLevelConfigOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use ProductLevelConfig.newBuilder() to construct. ProductLevelConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private ProductLevelConfig(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 ProductLevelConfig()41 private ProductLevelConfig() { 42 ingestionProductType_ = ""; 43 merchantCenterProductIdField_ = ""; 44 } 45 46 @java.lang.Override 47 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)48 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 49 return new ProductLevelConfig(); 50 } 51 52 @java.lang.Override getUnknownFields()53 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 54 return this.unknownFields; 55 } 56 getDescriptor()57 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 58 return com.google.cloud.retail.v2.CatalogProto 59 .internal_static_google_cloud_retail_v2_ProductLevelConfig_descriptor; 60 } 61 62 @java.lang.Override 63 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()64 internalGetFieldAccessorTable() { 65 return com.google.cloud.retail.v2.CatalogProto 66 .internal_static_google_cloud_retail_v2_ProductLevelConfig_fieldAccessorTable 67 .ensureFieldAccessorsInitialized( 68 com.google.cloud.retail.v2.ProductLevelConfig.class, 69 com.google.cloud.retail.v2.ProductLevelConfig.Builder.class); 70 } 71 72 public static final int INGESTION_PRODUCT_TYPE_FIELD_NUMBER = 1; 73 74 @SuppressWarnings("serial") 75 private volatile java.lang.Object ingestionProductType_ = ""; 76 /** 77 * 78 * 79 * <pre> 80 * The type of [Product][google.cloud.retail.v2.Product]s allowed to be 81 * ingested into the catalog. Acceptable values are: 82 * * `primary` (default): You can ingest 83 * [Product][google.cloud.retail.v2.Product]s of all types. When 84 * ingesting a [Product][google.cloud.retail.v2.Product], its type will 85 * default to 86 * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if 87 * unset. 88 * * `variant` (incompatible with Retail Search): You can only 89 * ingest 90 * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] 91 * [Product][google.cloud.retail.v2.Product]s. This means 92 * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] 93 * cannot be empty. 94 * If this field is set to an invalid value other than these, an 95 * INVALID_ARGUMENT error is returned. 96 * If this field is `variant` and 97 * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] 98 * is `itemGroupId`, an INVALID_ARGUMENT error is returned. 99 * See [Product 100 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 101 * for more details. 102 * </pre> 103 * 104 * <code>string ingestion_product_type = 1;</code> 105 * 106 * @return The ingestionProductType. 107 */ 108 @java.lang.Override getIngestionProductType()109 public java.lang.String getIngestionProductType() { 110 java.lang.Object ref = ingestionProductType_; 111 if (ref instanceof java.lang.String) { 112 return (java.lang.String) ref; 113 } else { 114 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 115 java.lang.String s = bs.toStringUtf8(); 116 ingestionProductType_ = s; 117 return s; 118 } 119 } 120 /** 121 * 122 * 123 * <pre> 124 * The type of [Product][google.cloud.retail.v2.Product]s allowed to be 125 * ingested into the catalog. Acceptable values are: 126 * * `primary` (default): You can ingest 127 * [Product][google.cloud.retail.v2.Product]s of all types. When 128 * ingesting a [Product][google.cloud.retail.v2.Product], its type will 129 * default to 130 * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if 131 * unset. 132 * * `variant` (incompatible with Retail Search): You can only 133 * ingest 134 * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] 135 * [Product][google.cloud.retail.v2.Product]s. This means 136 * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] 137 * cannot be empty. 138 * If this field is set to an invalid value other than these, an 139 * INVALID_ARGUMENT error is returned. 140 * If this field is `variant` and 141 * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] 142 * is `itemGroupId`, an INVALID_ARGUMENT error is returned. 143 * See [Product 144 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 145 * for more details. 146 * </pre> 147 * 148 * <code>string ingestion_product_type = 1;</code> 149 * 150 * @return The bytes for ingestionProductType. 151 */ 152 @java.lang.Override getIngestionProductTypeBytes()153 public com.google.protobuf.ByteString getIngestionProductTypeBytes() { 154 java.lang.Object ref = ingestionProductType_; 155 if (ref instanceof java.lang.String) { 156 com.google.protobuf.ByteString b = 157 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 158 ingestionProductType_ = b; 159 return b; 160 } else { 161 return (com.google.protobuf.ByteString) ref; 162 } 163 } 164 165 public static final int MERCHANT_CENTER_PRODUCT_ID_FIELD_FIELD_NUMBER = 2; 166 167 @SuppressWarnings("serial") 168 private volatile java.lang.Object merchantCenterProductIdField_ = ""; 169 /** 170 * 171 * 172 * <pre> 173 * Which field of [Merchant Center 174 * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be 175 * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable 176 * values are: 177 * * `offerId` (default): Import `offerId` as the product ID. 178 * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail 179 * API will choose one item from the ones with the same `itemGroupId`, and 180 * use it to represent the item group. 181 * If this field is set to an invalid value other than these, an 182 * INVALID_ARGUMENT error is returned. 183 * If this field is `itemGroupId` and 184 * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] 185 * is `variant`, an INVALID_ARGUMENT error is returned. 186 * See [Product 187 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 188 * for more details. 189 * </pre> 190 * 191 * <code>string merchant_center_product_id_field = 2;</code> 192 * 193 * @return The merchantCenterProductIdField. 194 */ 195 @java.lang.Override getMerchantCenterProductIdField()196 public java.lang.String getMerchantCenterProductIdField() { 197 java.lang.Object ref = merchantCenterProductIdField_; 198 if (ref instanceof java.lang.String) { 199 return (java.lang.String) ref; 200 } else { 201 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 202 java.lang.String s = bs.toStringUtf8(); 203 merchantCenterProductIdField_ = s; 204 return s; 205 } 206 } 207 /** 208 * 209 * 210 * <pre> 211 * Which field of [Merchant Center 212 * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be 213 * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable 214 * values are: 215 * * `offerId` (default): Import `offerId` as the product ID. 216 * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail 217 * API will choose one item from the ones with the same `itemGroupId`, and 218 * use it to represent the item group. 219 * If this field is set to an invalid value other than these, an 220 * INVALID_ARGUMENT error is returned. 221 * If this field is `itemGroupId` and 222 * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] 223 * is `variant`, an INVALID_ARGUMENT error is returned. 224 * See [Product 225 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 226 * for more details. 227 * </pre> 228 * 229 * <code>string merchant_center_product_id_field = 2;</code> 230 * 231 * @return The bytes for merchantCenterProductIdField. 232 */ 233 @java.lang.Override getMerchantCenterProductIdFieldBytes()234 public com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes() { 235 java.lang.Object ref = merchantCenterProductIdField_; 236 if (ref instanceof java.lang.String) { 237 com.google.protobuf.ByteString b = 238 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 239 merchantCenterProductIdField_ = b; 240 return b; 241 } else { 242 return (com.google.protobuf.ByteString) ref; 243 } 244 } 245 246 private byte memoizedIsInitialized = -1; 247 248 @java.lang.Override isInitialized()249 public final boolean isInitialized() { 250 byte isInitialized = memoizedIsInitialized; 251 if (isInitialized == 1) return true; 252 if (isInitialized == 0) return false; 253 254 memoizedIsInitialized = 1; 255 return true; 256 } 257 258 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)259 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 260 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ingestionProductType_)) { 261 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ingestionProductType_); 262 } 263 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(merchantCenterProductIdField_)) { 264 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, merchantCenterProductIdField_); 265 } 266 getUnknownFields().writeTo(output); 267 } 268 269 @java.lang.Override getSerializedSize()270 public int getSerializedSize() { 271 int size = memoizedSize; 272 if (size != -1) return size; 273 274 size = 0; 275 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ingestionProductType_)) { 276 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ingestionProductType_); 277 } 278 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(merchantCenterProductIdField_)) { 279 size += 280 com.google.protobuf.GeneratedMessageV3.computeStringSize( 281 2, merchantCenterProductIdField_); 282 } 283 size += getUnknownFields().getSerializedSize(); 284 memoizedSize = size; 285 return size; 286 } 287 288 @java.lang.Override equals(final java.lang.Object obj)289 public boolean equals(final java.lang.Object obj) { 290 if (obj == this) { 291 return true; 292 } 293 if (!(obj instanceof com.google.cloud.retail.v2.ProductLevelConfig)) { 294 return super.equals(obj); 295 } 296 com.google.cloud.retail.v2.ProductLevelConfig other = 297 (com.google.cloud.retail.v2.ProductLevelConfig) obj; 298 299 if (!getIngestionProductType().equals(other.getIngestionProductType())) return false; 300 if (!getMerchantCenterProductIdField().equals(other.getMerchantCenterProductIdField())) 301 return false; 302 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 303 return true; 304 } 305 306 @java.lang.Override hashCode()307 public int hashCode() { 308 if (memoizedHashCode != 0) { 309 return memoizedHashCode; 310 } 311 int hash = 41; 312 hash = (19 * hash) + getDescriptor().hashCode(); 313 hash = (37 * hash) + INGESTION_PRODUCT_TYPE_FIELD_NUMBER; 314 hash = (53 * hash) + getIngestionProductType().hashCode(); 315 hash = (37 * hash) + MERCHANT_CENTER_PRODUCT_ID_FIELD_FIELD_NUMBER; 316 hash = (53 * hash) + getMerchantCenterProductIdField().hashCode(); 317 hash = (29 * hash) + getUnknownFields().hashCode(); 318 memoizedHashCode = hash; 319 return hash; 320 } 321 parseFrom(java.nio.ByteBuffer data)322 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom(java.nio.ByteBuffer data) 323 throws com.google.protobuf.InvalidProtocolBufferException { 324 return PARSER.parseFrom(data); 325 } 326 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)327 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom( 328 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 329 throws com.google.protobuf.InvalidProtocolBufferException { 330 return PARSER.parseFrom(data, extensionRegistry); 331 } 332 parseFrom( com.google.protobuf.ByteString data)333 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom( 334 com.google.protobuf.ByteString data) 335 throws com.google.protobuf.InvalidProtocolBufferException { 336 return PARSER.parseFrom(data); 337 } 338 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)339 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom( 340 com.google.protobuf.ByteString data, 341 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 342 throws com.google.protobuf.InvalidProtocolBufferException { 343 return PARSER.parseFrom(data, extensionRegistry); 344 } 345 parseFrom(byte[] data)346 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom(byte[] data) 347 throws com.google.protobuf.InvalidProtocolBufferException { 348 return PARSER.parseFrom(data); 349 } 350 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)351 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom( 352 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 353 throws com.google.protobuf.InvalidProtocolBufferException { 354 return PARSER.parseFrom(data, extensionRegistry); 355 } 356 parseFrom(java.io.InputStream input)357 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom(java.io.InputStream input) 358 throws java.io.IOException { 359 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 360 } 361 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)362 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom( 363 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 364 throws java.io.IOException { 365 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 366 PARSER, input, extensionRegistry); 367 } 368 parseDelimitedFrom( java.io.InputStream input)369 public static com.google.cloud.retail.v2.ProductLevelConfig parseDelimitedFrom( 370 java.io.InputStream input) throws java.io.IOException { 371 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 372 } 373 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)374 public static com.google.cloud.retail.v2.ProductLevelConfig parseDelimitedFrom( 375 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 376 throws java.io.IOException { 377 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 378 PARSER, input, extensionRegistry); 379 } 380 parseFrom( com.google.protobuf.CodedInputStream input)381 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom( 382 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 383 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 384 } 385 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)386 public static com.google.cloud.retail.v2.ProductLevelConfig parseFrom( 387 com.google.protobuf.CodedInputStream input, 388 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 389 throws java.io.IOException { 390 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 391 PARSER, input, extensionRegistry); 392 } 393 394 @java.lang.Override newBuilderForType()395 public Builder newBuilderForType() { 396 return newBuilder(); 397 } 398 newBuilder()399 public static Builder newBuilder() { 400 return DEFAULT_INSTANCE.toBuilder(); 401 } 402 newBuilder(com.google.cloud.retail.v2.ProductLevelConfig prototype)403 public static Builder newBuilder(com.google.cloud.retail.v2.ProductLevelConfig prototype) { 404 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 405 } 406 407 @java.lang.Override toBuilder()408 public Builder toBuilder() { 409 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 410 } 411 412 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)413 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 414 Builder builder = new Builder(parent); 415 return builder; 416 } 417 /** 418 * 419 * 420 * <pre> 421 * Configures what level the product should be uploaded with regards to 422 * how users will be send events and how predictions will be made. 423 * </pre> 424 * 425 * Protobuf type {@code google.cloud.retail.v2.ProductLevelConfig} 426 */ 427 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 428 implements 429 // @@protoc_insertion_point(builder_implements:google.cloud.retail.v2.ProductLevelConfig) 430 com.google.cloud.retail.v2.ProductLevelConfigOrBuilder { getDescriptor()431 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 432 return com.google.cloud.retail.v2.CatalogProto 433 .internal_static_google_cloud_retail_v2_ProductLevelConfig_descriptor; 434 } 435 436 @java.lang.Override 437 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()438 internalGetFieldAccessorTable() { 439 return com.google.cloud.retail.v2.CatalogProto 440 .internal_static_google_cloud_retail_v2_ProductLevelConfig_fieldAccessorTable 441 .ensureFieldAccessorsInitialized( 442 com.google.cloud.retail.v2.ProductLevelConfig.class, 443 com.google.cloud.retail.v2.ProductLevelConfig.Builder.class); 444 } 445 446 // Construct using com.google.cloud.retail.v2.ProductLevelConfig.newBuilder() Builder()447 private Builder() {} 448 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)449 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 450 super(parent); 451 } 452 453 @java.lang.Override clear()454 public Builder clear() { 455 super.clear(); 456 bitField0_ = 0; 457 ingestionProductType_ = ""; 458 merchantCenterProductIdField_ = ""; 459 return this; 460 } 461 462 @java.lang.Override getDescriptorForType()463 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 464 return com.google.cloud.retail.v2.CatalogProto 465 .internal_static_google_cloud_retail_v2_ProductLevelConfig_descriptor; 466 } 467 468 @java.lang.Override getDefaultInstanceForType()469 public com.google.cloud.retail.v2.ProductLevelConfig getDefaultInstanceForType() { 470 return com.google.cloud.retail.v2.ProductLevelConfig.getDefaultInstance(); 471 } 472 473 @java.lang.Override build()474 public com.google.cloud.retail.v2.ProductLevelConfig build() { 475 com.google.cloud.retail.v2.ProductLevelConfig result = buildPartial(); 476 if (!result.isInitialized()) { 477 throw newUninitializedMessageException(result); 478 } 479 return result; 480 } 481 482 @java.lang.Override buildPartial()483 public com.google.cloud.retail.v2.ProductLevelConfig buildPartial() { 484 com.google.cloud.retail.v2.ProductLevelConfig result = 485 new com.google.cloud.retail.v2.ProductLevelConfig(this); 486 if (bitField0_ != 0) { 487 buildPartial0(result); 488 } 489 onBuilt(); 490 return result; 491 } 492 buildPartial0(com.google.cloud.retail.v2.ProductLevelConfig result)493 private void buildPartial0(com.google.cloud.retail.v2.ProductLevelConfig result) { 494 int from_bitField0_ = bitField0_; 495 if (((from_bitField0_ & 0x00000001) != 0)) { 496 result.ingestionProductType_ = ingestionProductType_; 497 } 498 if (((from_bitField0_ & 0x00000002) != 0)) { 499 result.merchantCenterProductIdField_ = merchantCenterProductIdField_; 500 } 501 } 502 503 @java.lang.Override clone()504 public Builder clone() { 505 return super.clone(); 506 } 507 508 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)509 public Builder setField( 510 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 511 return super.setField(field, value); 512 } 513 514 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)515 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 516 return super.clearField(field); 517 } 518 519 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)520 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 521 return super.clearOneof(oneof); 522 } 523 524 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)525 public Builder setRepeatedField( 526 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 527 return super.setRepeatedField(field, index, value); 528 } 529 530 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)531 public Builder addRepeatedField( 532 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 533 return super.addRepeatedField(field, value); 534 } 535 536 @java.lang.Override mergeFrom(com.google.protobuf.Message other)537 public Builder mergeFrom(com.google.protobuf.Message other) { 538 if (other instanceof com.google.cloud.retail.v2.ProductLevelConfig) { 539 return mergeFrom((com.google.cloud.retail.v2.ProductLevelConfig) other); 540 } else { 541 super.mergeFrom(other); 542 return this; 543 } 544 } 545 mergeFrom(com.google.cloud.retail.v2.ProductLevelConfig other)546 public Builder mergeFrom(com.google.cloud.retail.v2.ProductLevelConfig other) { 547 if (other == com.google.cloud.retail.v2.ProductLevelConfig.getDefaultInstance()) return this; 548 if (!other.getIngestionProductType().isEmpty()) { 549 ingestionProductType_ = other.ingestionProductType_; 550 bitField0_ |= 0x00000001; 551 onChanged(); 552 } 553 if (!other.getMerchantCenterProductIdField().isEmpty()) { 554 merchantCenterProductIdField_ = other.merchantCenterProductIdField_; 555 bitField0_ |= 0x00000002; 556 onChanged(); 557 } 558 this.mergeUnknownFields(other.getUnknownFields()); 559 onChanged(); 560 return this; 561 } 562 563 @java.lang.Override isInitialized()564 public final boolean isInitialized() { 565 return true; 566 } 567 568 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)569 public Builder mergeFrom( 570 com.google.protobuf.CodedInputStream input, 571 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 572 throws java.io.IOException { 573 if (extensionRegistry == null) { 574 throw new java.lang.NullPointerException(); 575 } 576 try { 577 boolean done = false; 578 while (!done) { 579 int tag = input.readTag(); 580 switch (tag) { 581 case 0: 582 done = true; 583 break; 584 case 10: 585 { 586 ingestionProductType_ = input.readStringRequireUtf8(); 587 bitField0_ |= 0x00000001; 588 break; 589 } // case 10 590 case 18: 591 { 592 merchantCenterProductIdField_ = input.readStringRequireUtf8(); 593 bitField0_ |= 0x00000002; 594 break; 595 } // case 18 596 default: 597 { 598 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 599 done = true; // was an endgroup tag 600 } 601 break; 602 } // default: 603 } // switch (tag) 604 } // while (!done) 605 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 606 throw e.unwrapIOException(); 607 } finally { 608 onChanged(); 609 } // finally 610 return this; 611 } 612 613 private int bitField0_; 614 615 private java.lang.Object ingestionProductType_ = ""; 616 /** 617 * 618 * 619 * <pre> 620 * The type of [Product][google.cloud.retail.v2.Product]s allowed to be 621 * ingested into the catalog. Acceptable values are: 622 * * `primary` (default): You can ingest 623 * [Product][google.cloud.retail.v2.Product]s of all types. When 624 * ingesting a [Product][google.cloud.retail.v2.Product], its type will 625 * default to 626 * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if 627 * unset. 628 * * `variant` (incompatible with Retail Search): You can only 629 * ingest 630 * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] 631 * [Product][google.cloud.retail.v2.Product]s. This means 632 * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] 633 * cannot be empty. 634 * If this field is set to an invalid value other than these, an 635 * INVALID_ARGUMENT error is returned. 636 * If this field is `variant` and 637 * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] 638 * is `itemGroupId`, an INVALID_ARGUMENT error is returned. 639 * See [Product 640 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 641 * for more details. 642 * </pre> 643 * 644 * <code>string ingestion_product_type = 1;</code> 645 * 646 * @return The ingestionProductType. 647 */ getIngestionProductType()648 public java.lang.String getIngestionProductType() { 649 java.lang.Object ref = ingestionProductType_; 650 if (!(ref instanceof java.lang.String)) { 651 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 652 java.lang.String s = bs.toStringUtf8(); 653 ingestionProductType_ = s; 654 return s; 655 } else { 656 return (java.lang.String) ref; 657 } 658 } 659 /** 660 * 661 * 662 * <pre> 663 * The type of [Product][google.cloud.retail.v2.Product]s allowed to be 664 * ingested into the catalog. Acceptable values are: 665 * * `primary` (default): You can ingest 666 * [Product][google.cloud.retail.v2.Product]s of all types. When 667 * ingesting a [Product][google.cloud.retail.v2.Product], its type will 668 * default to 669 * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if 670 * unset. 671 * * `variant` (incompatible with Retail Search): You can only 672 * ingest 673 * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] 674 * [Product][google.cloud.retail.v2.Product]s. This means 675 * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] 676 * cannot be empty. 677 * If this field is set to an invalid value other than these, an 678 * INVALID_ARGUMENT error is returned. 679 * If this field is `variant` and 680 * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] 681 * is `itemGroupId`, an INVALID_ARGUMENT error is returned. 682 * See [Product 683 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 684 * for more details. 685 * </pre> 686 * 687 * <code>string ingestion_product_type = 1;</code> 688 * 689 * @return The bytes for ingestionProductType. 690 */ getIngestionProductTypeBytes()691 public com.google.protobuf.ByteString getIngestionProductTypeBytes() { 692 java.lang.Object ref = ingestionProductType_; 693 if (ref instanceof String) { 694 com.google.protobuf.ByteString b = 695 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 696 ingestionProductType_ = b; 697 return b; 698 } else { 699 return (com.google.protobuf.ByteString) ref; 700 } 701 } 702 /** 703 * 704 * 705 * <pre> 706 * The type of [Product][google.cloud.retail.v2.Product]s allowed to be 707 * ingested into the catalog. Acceptable values are: 708 * * `primary` (default): You can ingest 709 * [Product][google.cloud.retail.v2.Product]s of all types. When 710 * ingesting a [Product][google.cloud.retail.v2.Product], its type will 711 * default to 712 * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if 713 * unset. 714 * * `variant` (incompatible with Retail Search): You can only 715 * ingest 716 * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] 717 * [Product][google.cloud.retail.v2.Product]s. This means 718 * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] 719 * cannot be empty. 720 * If this field is set to an invalid value other than these, an 721 * INVALID_ARGUMENT error is returned. 722 * If this field is `variant` and 723 * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] 724 * is `itemGroupId`, an INVALID_ARGUMENT error is returned. 725 * See [Product 726 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 727 * for more details. 728 * </pre> 729 * 730 * <code>string ingestion_product_type = 1;</code> 731 * 732 * @param value The ingestionProductType to set. 733 * @return This builder for chaining. 734 */ setIngestionProductType(java.lang.String value)735 public Builder setIngestionProductType(java.lang.String value) { 736 if (value == null) { 737 throw new NullPointerException(); 738 } 739 ingestionProductType_ = value; 740 bitField0_ |= 0x00000001; 741 onChanged(); 742 return this; 743 } 744 /** 745 * 746 * 747 * <pre> 748 * The type of [Product][google.cloud.retail.v2.Product]s allowed to be 749 * ingested into the catalog. Acceptable values are: 750 * * `primary` (default): You can ingest 751 * [Product][google.cloud.retail.v2.Product]s of all types. When 752 * ingesting a [Product][google.cloud.retail.v2.Product], its type will 753 * default to 754 * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if 755 * unset. 756 * * `variant` (incompatible with Retail Search): You can only 757 * ingest 758 * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] 759 * [Product][google.cloud.retail.v2.Product]s. This means 760 * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] 761 * cannot be empty. 762 * If this field is set to an invalid value other than these, an 763 * INVALID_ARGUMENT error is returned. 764 * If this field is `variant` and 765 * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] 766 * is `itemGroupId`, an INVALID_ARGUMENT error is returned. 767 * See [Product 768 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 769 * for more details. 770 * </pre> 771 * 772 * <code>string ingestion_product_type = 1;</code> 773 * 774 * @return This builder for chaining. 775 */ clearIngestionProductType()776 public Builder clearIngestionProductType() { 777 ingestionProductType_ = getDefaultInstance().getIngestionProductType(); 778 bitField0_ = (bitField0_ & ~0x00000001); 779 onChanged(); 780 return this; 781 } 782 /** 783 * 784 * 785 * <pre> 786 * The type of [Product][google.cloud.retail.v2.Product]s allowed to be 787 * ingested into the catalog. Acceptable values are: 788 * * `primary` (default): You can ingest 789 * [Product][google.cloud.retail.v2.Product]s of all types. When 790 * ingesting a [Product][google.cloud.retail.v2.Product], its type will 791 * default to 792 * [Product.Type.PRIMARY][google.cloud.retail.v2.Product.Type.PRIMARY] if 793 * unset. 794 * * `variant` (incompatible with Retail Search): You can only 795 * ingest 796 * [Product.Type.VARIANT][google.cloud.retail.v2.Product.Type.VARIANT] 797 * [Product][google.cloud.retail.v2.Product]s. This means 798 * [Product.primary_product_id][google.cloud.retail.v2.Product.primary_product_id] 799 * cannot be empty. 800 * If this field is set to an invalid value other than these, an 801 * INVALID_ARGUMENT error is returned. 802 * If this field is `variant` and 803 * [merchant_center_product_id_field][google.cloud.retail.v2.ProductLevelConfig.merchant_center_product_id_field] 804 * is `itemGroupId`, an INVALID_ARGUMENT error is returned. 805 * See [Product 806 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 807 * for more details. 808 * </pre> 809 * 810 * <code>string ingestion_product_type = 1;</code> 811 * 812 * @param value The bytes for ingestionProductType to set. 813 * @return This builder for chaining. 814 */ setIngestionProductTypeBytes(com.google.protobuf.ByteString value)815 public Builder setIngestionProductTypeBytes(com.google.protobuf.ByteString value) { 816 if (value == null) { 817 throw new NullPointerException(); 818 } 819 checkByteStringIsUtf8(value); 820 ingestionProductType_ = value; 821 bitField0_ |= 0x00000001; 822 onChanged(); 823 return this; 824 } 825 826 private java.lang.Object merchantCenterProductIdField_ = ""; 827 /** 828 * 829 * 830 * <pre> 831 * Which field of [Merchant Center 832 * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be 833 * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable 834 * values are: 835 * * `offerId` (default): Import `offerId` as the product ID. 836 * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail 837 * API will choose one item from the ones with the same `itemGroupId`, and 838 * use it to represent the item group. 839 * If this field is set to an invalid value other than these, an 840 * INVALID_ARGUMENT error is returned. 841 * If this field is `itemGroupId` and 842 * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] 843 * is `variant`, an INVALID_ARGUMENT error is returned. 844 * See [Product 845 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 846 * for more details. 847 * </pre> 848 * 849 * <code>string merchant_center_product_id_field = 2;</code> 850 * 851 * @return The merchantCenterProductIdField. 852 */ getMerchantCenterProductIdField()853 public java.lang.String getMerchantCenterProductIdField() { 854 java.lang.Object ref = merchantCenterProductIdField_; 855 if (!(ref instanceof java.lang.String)) { 856 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 857 java.lang.String s = bs.toStringUtf8(); 858 merchantCenterProductIdField_ = s; 859 return s; 860 } else { 861 return (java.lang.String) ref; 862 } 863 } 864 /** 865 * 866 * 867 * <pre> 868 * Which field of [Merchant Center 869 * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be 870 * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable 871 * values are: 872 * * `offerId` (default): Import `offerId` as the product ID. 873 * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail 874 * API will choose one item from the ones with the same `itemGroupId`, and 875 * use it to represent the item group. 876 * If this field is set to an invalid value other than these, an 877 * INVALID_ARGUMENT error is returned. 878 * If this field is `itemGroupId` and 879 * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] 880 * is `variant`, an INVALID_ARGUMENT error is returned. 881 * See [Product 882 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 883 * for more details. 884 * </pre> 885 * 886 * <code>string merchant_center_product_id_field = 2;</code> 887 * 888 * @return The bytes for merchantCenterProductIdField. 889 */ getMerchantCenterProductIdFieldBytes()890 public com.google.protobuf.ByteString getMerchantCenterProductIdFieldBytes() { 891 java.lang.Object ref = merchantCenterProductIdField_; 892 if (ref instanceof String) { 893 com.google.protobuf.ByteString b = 894 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 895 merchantCenterProductIdField_ = b; 896 return b; 897 } else { 898 return (com.google.protobuf.ByteString) ref; 899 } 900 } 901 /** 902 * 903 * 904 * <pre> 905 * Which field of [Merchant Center 906 * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be 907 * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable 908 * values are: 909 * * `offerId` (default): Import `offerId` as the product ID. 910 * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail 911 * API will choose one item from the ones with the same `itemGroupId`, and 912 * use it to represent the item group. 913 * If this field is set to an invalid value other than these, an 914 * INVALID_ARGUMENT error is returned. 915 * If this field is `itemGroupId` and 916 * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] 917 * is `variant`, an INVALID_ARGUMENT error is returned. 918 * See [Product 919 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 920 * for more details. 921 * </pre> 922 * 923 * <code>string merchant_center_product_id_field = 2;</code> 924 * 925 * @param value The merchantCenterProductIdField to set. 926 * @return This builder for chaining. 927 */ setMerchantCenterProductIdField(java.lang.String value)928 public Builder setMerchantCenterProductIdField(java.lang.String value) { 929 if (value == null) { 930 throw new NullPointerException(); 931 } 932 merchantCenterProductIdField_ = value; 933 bitField0_ |= 0x00000002; 934 onChanged(); 935 return this; 936 } 937 /** 938 * 939 * 940 * <pre> 941 * Which field of [Merchant Center 942 * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be 943 * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable 944 * values are: 945 * * `offerId` (default): Import `offerId` as the product ID. 946 * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail 947 * API will choose one item from the ones with the same `itemGroupId`, and 948 * use it to represent the item group. 949 * If this field is set to an invalid value other than these, an 950 * INVALID_ARGUMENT error is returned. 951 * If this field is `itemGroupId` and 952 * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] 953 * is `variant`, an INVALID_ARGUMENT error is returned. 954 * See [Product 955 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 956 * for more details. 957 * </pre> 958 * 959 * <code>string merchant_center_product_id_field = 2;</code> 960 * 961 * @return This builder for chaining. 962 */ clearMerchantCenterProductIdField()963 public Builder clearMerchantCenterProductIdField() { 964 merchantCenterProductIdField_ = getDefaultInstance().getMerchantCenterProductIdField(); 965 bitField0_ = (bitField0_ & ~0x00000002); 966 onChanged(); 967 return this; 968 } 969 /** 970 * 971 * 972 * <pre> 973 * Which field of [Merchant Center 974 * Product](/bigquery-transfer/docs/merchant-center-products-schema) should be 975 * imported as [Product.id][google.cloud.retail.v2.Product.id]. Acceptable 976 * values are: 977 * * `offerId` (default): Import `offerId` as the product ID. 978 * * `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail 979 * API will choose one item from the ones with the same `itemGroupId`, and 980 * use it to represent the item group. 981 * If this field is set to an invalid value other than these, an 982 * INVALID_ARGUMENT error is returned. 983 * If this field is `itemGroupId` and 984 * [ingestion_product_type][google.cloud.retail.v2.ProductLevelConfig.ingestion_product_type] 985 * is `variant`, an INVALID_ARGUMENT error is returned. 986 * See [Product 987 * levels](https://cloud.google.com/retail/docs/catalog#product-levels) 988 * for more details. 989 * </pre> 990 * 991 * <code>string merchant_center_product_id_field = 2;</code> 992 * 993 * @param value The bytes for merchantCenterProductIdField to set. 994 * @return This builder for chaining. 995 */ setMerchantCenterProductIdFieldBytes(com.google.protobuf.ByteString value)996 public Builder setMerchantCenterProductIdFieldBytes(com.google.protobuf.ByteString value) { 997 if (value == null) { 998 throw new NullPointerException(); 999 } 1000 checkByteStringIsUtf8(value); 1001 merchantCenterProductIdField_ = value; 1002 bitField0_ |= 0x00000002; 1003 onChanged(); 1004 return this; 1005 } 1006 1007 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1008 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1009 return super.setUnknownFields(unknownFields); 1010 } 1011 1012 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1013 public final Builder mergeUnknownFields( 1014 final com.google.protobuf.UnknownFieldSet unknownFields) { 1015 return super.mergeUnknownFields(unknownFields); 1016 } 1017 1018 // @@protoc_insertion_point(builder_scope:google.cloud.retail.v2.ProductLevelConfig) 1019 } 1020 1021 // @@protoc_insertion_point(class_scope:google.cloud.retail.v2.ProductLevelConfig) 1022 private static final com.google.cloud.retail.v2.ProductLevelConfig DEFAULT_INSTANCE; 1023 1024 static { 1025 DEFAULT_INSTANCE = new com.google.cloud.retail.v2.ProductLevelConfig(); 1026 } 1027 getDefaultInstance()1028 public static com.google.cloud.retail.v2.ProductLevelConfig getDefaultInstance() { 1029 return DEFAULT_INSTANCE; 1030 } 1031 1032 private static final com.google.protobuf.Parser<ProductLevelConfig> PARSER = 1033 new com.google.protobuf.AbstractParser<ProductLevelConfig>() { 1034 @java.lang.Override 1035 public ProductLevelConfig parsePartialFrom( 1036 com.google.protobuf.CodedInputStream input, 1037 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1038 throws com.google.protobuf.InvalidProtocolBufferException { 1039 Builder builder = newBuilder(); 1040 try { 1041 builder.mergeFrom(input, extensionRegistry); 1042 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1043 throw e.setUnfinishedMessage(builder.buildPartial()); 1044 } catch (com.google.protobuf.UninitializedMessageException e) { 1045 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1046 } catch (java.io.IOException e) { 1047 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1048 .setUnfinishedMessage(builder.buildPartial()); 1049 } 1050 return builder.buildPartial(); 1051 } 1052 }; 1053 parser()1054 public static com.google.protobuf.Parser<ProductLevelConfig> parser() { 1055 return PARSER; 1056 } 1057 1058 @java.lang.Override getParserForType()1059 public com.google.protobuf.Parser<ProductLevelConfig> getParserForType() { 1060 return PARSER; 1061 } 1062 1063 @java.lang.Override getDefaultInstanceForType()1064 public com.google.cloud.retail.v2.ProductLevelConfig getDefaultInstanceForType() { 1065 return DEFAULT_INSTANCE; 1066 } 1067 } 1068