public Builder mergeFrom(com.google.cloud.vision.v1.CreateProductRequest other) { if (other == com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance()) return this; if (!other.getParent().isEmpty()) { parent_ = other.parent_; onChanged(); } if (other.hasProduct()) { mergeProduct(other.getProduct()); } if (!other.getProductId().isEmpty()) { productId_ = other.productId_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.cloud.vision.v1.CreateProductRequest buildPartial() { com.google.cloud.vision.v1.CreateProductRequest result = new com.google.cloud.vision.v1.CreateProductRequest(this); result.parent_ = parent_; if (productBuilder_ == null) { result.product_ = product_; } else { result.product_ = productBuilder_.build(); } result.productId_ = productId_; onBuilt(); return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getParentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (product_ != null) { output.writeMessage(2, getProduct()); } if (!getProductIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productId_); } unknownFields.writeTo(output); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.CreateProductRequest)) { return super.equals(obj); } com.google.cloud.vision.v1.CreateProductRequest other = (com.google.cloud.vision.v1.CreateProductRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && (hasProduct() == other.hasProduct()); if (hasProduct()) { result = result && getProduct().equals(other.getProduct()); } result = result && getProductId().equals(other.getProductId()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * The project in which the Product should be created. * Format is * `projects/PROJECT_ID/locations/LOC_ID`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
CreateProductRequest actualRequest = (CreateProductRequest) actualRequests.get(0); Assert.assertEquals(formattedParent, actualRequest.getParent()); Assert.assertEquals(product, actualRequest.getProduct()); Assert.assertEquals(productId, actualRequest.getProductId()); Assert.assertTrue( channelProvider.isHeaderSent(
/** * * * <pre> * A user-supplied resource id for this Product. If set, the server will * attempt to use this value as the resource id. If it is already in use, an * error is returned with code ALREADY_EXISTS. Must be at most 128 characters * long. It cannot contain the character `/`. * </pre> * * <code>string product_id = 3;</code> */ public Builder clearProductId() { productId_ = getDefaultInstance().getProductId(); onChanged(); return this; } /**
@java.lang.Override public com.google.cloud.vision.v1.CreateProductRequest getDefaultInstanceForType() { return com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance(); }
/** * * * <pre> * The product to create. * </pre> * * <code>.google.cloud.vision.v1.Product product = 2;</code> */ public com.google.cloud.vision.v1.ProductOrBuilder getProductOrBuilder() { return getProduct(); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getParentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); } if (product_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getProduct()); } if (!getProductIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, productId_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * * * <pre> * The project in which the Product should be created. * Format is * `projects/PROJECT_ID/locations/LOC_ID`. * </pre> * * <code>string parent = 1;</code> */ public Builder clearParent() { parent_ = getDefaultInstance().getParent(); onChanged(); return this; } /**
/** * * * <pre> * A user-supplied resource id for this Product. If set, the server will * attempt to use this value as the resource id. If it is already in use, an * error is returned with code ALREADY_EXISTS. Must be at most 128 characters * long. It cannot contain the character `/`. * </pre> * * <code>string product_id = 3;</code> */ public Builder clearProductId() { productId_ = getDefaultInstance().getProductId(); onChanged(); return this; } /**
.setRequestMarshaller( io.grpc.protobuf.ProtoUtils.marshaller( com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * * * <pre> * The product to create. * </pre> * * <code>.google.cloud.vision.v1.Product product = 2;</code> */ public com.google.cloud.vision.v1.ProductOrBuilder getProductOrBuilder() { return getProduct(); }
@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 (hasProduct()) { hash = (37 * hash) + PRODUCT_FIELD_NUMBER; hash = (53 * hash) + getProduct().hashCode(); } hash = (37 * hash) + PRODUCT_ID_FIELD_NUMBER; hash = (53 * hash) + getProductId().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getParentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); } if (product_ != null) { output.writeMessage(2, getProduct()); } if (!getProductIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, productId_); } unknownFields.writeTo(output); }
LOCATION_PATH_TEMPLATE.validate(parent, "createProduct"); CreateProductRequest request = CreateProductRequest.newBuilder() .setParent(parent) .setProduct(product)
@java.lang.Override public com.google.cloud.vision.v1.CreateProductRequest getDefaultInstanceForType() { return com.google.cloud.vision.v1.CreateProductRequest.getDefaultInstance(); }
@java.lang.Override public com.google.cloud.vision.v1.CreateProductRequest buildPartial() { com.google.cloud.vision.v1.CreateProductRequest result = new com.google.cloud.vision.v1.CreateProductRequest(this); result.parent_ = parent_; if (productBuilder_ == null) { result.product_ = product_; } else { result.product_ = productBuilder_.build(); } result.productId_ = productId_; onBuilt(); return result; }