/** * * * <pre> * The [FieldMask][google.protobuf.FieldMask] that specifies which fields * to update. * If update_mask isn't specified, all mutable fields are to be updated. * Valid mask paths include `product_labels`, `display_name`, and * `description`. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (product_ != null) { output.writeMessage(1, getProduct()); } if (updateMask_ != null) { output.writeMessage(2, getUpdateMask()); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (product_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProduct()); } if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasProduct()) { hash = (37 * hash) + PRODUCT_FIELD_NUMBER; hash = (53 * hash) + getProduct().hashCode(); } if (hasUpdateMask()) { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.UpdateProductRequest)) { return super.equals(obj); } com.google.cloud.vision.v1.UpdateProductRequest other = (com.google.cloud.vision.v1.UpdateProductRequest) obj; boolean result = true; result = result && (hasProduct() == other.hasProduct()); if (hasProduct()) { result = result && getProduct().equals(other.getProduct()); } result = result && (hasUpdateMask() == other.hasUpdateMask()); if (hasUpdateMask()) { result = result && getUpdateMask().equals(other.getUpdateMask()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.cloud.vision.v1.UpdateProductRequest other) { if (other == com.google.cloud.vision.v1.UpdateProductRequest.getDefaultInstance()) return this; if (other.hasProduct()) { mergeProduct(other.getProduct()); } if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@Test @SuppressWarnings("all") public void updateProductTest() { String name = "name3373707"; String displayName = "displayName1615086568"; String description = "description-1724546052"; String productCategory = "productCategory-1607451058"; Product expectedResponse = Product.newBuilder() .setName(name) .setDisplayName(displayName) .setDescription(description) .setProductCategory(productCategory) .build(); mockProductSearch.addResponse(expectedResponse); Product product = Product.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Product actualResponse = client.updateProduct(product, updateMask); Assert.assertEquals(expectedResponse, actualResponse); List<GeneratedMessageV3> actualRequests = mockProductSearch.getRequests(); Assert.assertEquals(1, actualRequests.size()); UpdateProductRequest actualRequest = (UpdateProductRequest) actualRequests.get(0); Assert.assertEquals(product, actualRequest.getProduct()); Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * The [FieldMask][google.protobuf.FieldMask] that specifies which fields * to update. * If update_mask isn't specified, all mutable fields are to be updated. * Valid mask paths include `product_labels`, `display_name`, and * `description`. * </pre> * * <code>.google.protobuf.FieldMask update_mask = 2;</code> */ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { return getUpdateMask(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (product_ != null) { output.writeMessage(1, getProduct()); } if (updateMask_ != null) { output.writeMessage(2, getUpdateMask()); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (product_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getProduct()); } if (updateMask_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasProduct()) { hash = (37 * hash) + PRODUCT_FIELD_NUMBER; hash = (53 * hash) + getProduct().hashCode(); } if (hasUpdateMask()) { hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; hash = (53 * hash) + getUpdateMask().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.UpdateProductRequest)) { return super.equals(obj); } com.google.cloud.vision.v1.UpdateProductRequest other = (com.google.cloud.vision.v1.UpdateProductRequest) obj; boolean result = true; result = result && (hasProduct() == other.hasProduct()); if (hasProduct()) { result = result && getProduct().equals(other.getProduct()); } result = result && (hasUpdateMask() == other.hasUpdateMask()); if (hasUpdateMask()) { result = result && getUpdateMask().equals(other.getUpdateMask()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.cloud.vision.v1.UpdateProductRequest other) { if (other == com.google.cloud.vision.v1.UpdateProductRequest.getDefaultInstance()) return this; if (other.hasProduct()) { mergeProduct(other.getProduct()); } if (other.hasUpdateMask()) { mergeUpdateMask(other.getUpdateMask()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }