/** * * * <pre> * The resource name of the Document to delete. In the format: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public com.google.firestore.v1beta1.DeleteDocumentRequest buildPartial() { com.google.firestore.v1beta1.DeleteDocumentRequest result = new com.google.firestore.v1beta1.DeleteDocumentRequest(this); result.name_ = name_; if (currentDocumentBuilder_ == null) { result.currentDocument_ = currentDocument_; } else { result.currentDocument_ = currentDocumentBuilder_.build(); } onBuilt(); return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); } if (currentDocument_ != null) { output.writeMessage(2, getCurrentDocument()); } unknownFields.writeTo(output); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.firestore.v1beta1.DeleteDocumentRequest)) { return super.equals(obj); } com.google.firestore.v1beta1.DeleteDocumentRequest other = (com.google.firestore.v1beta1.DeleteDocumentRequest) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && (hasCurrentDocument() == other.hasCurrentDocument()); if (hasCurrentDocument()) { result = result && getCurrentDocument().equals(other.getCurrentDocument()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); if (hasCurrentDocument()) { hash = (37 * hash) + CURRENT_DOCUMENT_FIELD_NUMBER; hash = (53 * hash) + getCurrentDocument().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.google.firestore.v1beta1.DeleteDocumentRequest other) { if (other == com.google.firestore.v1beta1.DeleteDocumentRequest.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (other.hasCurrentDocument()) { mergeCurrentDocument(other.getCurrentDocument()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public com.google.firestore.v1beta1.DeleteDocumentRequest getDefaultInstanceForType() { return com.google.firestore.v1beta1.DeleteDocumentRequest.getDefaultInstance(); }
if (!parseUnknownFieldProto3(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@Test @SuppressWarnings("all") public void deleteDocumentTest() { Empty expectedResponse = Empty.newBuilder().build(); mockFirestore.addResponse(expectedResponse); String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); client.deleteDocument(formattedName); List<GeneratedMessageV3> actualRequests = mockFirestore.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeleteDocumentRequest actualRequest = (DeleteDocumentRequest) actualRequests.get(0); Assert.assertEquals(formattedName, actualRequest.getName()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
/** * * * <pre> * An optional precondition on the document. * The request will fail if this is set and not met by the target document. * </pre> * * <code>.google.firestore.v1beta1.Precondition current_document = 2;</code> */ public com.google.firestore.v1beta1.PreconditionOrBuilder getCurrentDocumentOrBuilder() { return getCurrentDocument(); }
@java.lang.Override public com.google.firestore.v1beta1.DeleteDocumentRequest build() { com.google.firestore.v1beta1.DeleteDocumentRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getNameBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); } if (currentDocument_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCurrentDocument()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
io.grpc.protobuf.ProtoUtils.marshaller( com.google.firestore.v1beta1.DeleteDocumentRequest .getDefaultInstance())) .setResponseMarshaller( io.grpc.protobuf.ProtoUtils.marshaller(
/** * Deletes a document. * * <p>Sample code: * * <pre><code> * try (FirestoreClient firestoreClient = FirestoreClient.create()) { * String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); * firestoreClient.deleteDocument(formattedName); * } * </code></pre> * * @param name The resource name of the Document to delete. In the format: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteDocument(String name) { ANY_PATH_PATH_TEMPLATE.validate(name, "deleteDocument"); DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name).build(); deleteDocument(request); }
/** * Deletes a document. * * <p>Sample code: * * <pre><code> * try (FirestoreClient firestoreClient = FirestoreClient.create()) { * String formattedName = FirestoreClient.formatAnyPathName("[PROJECT]", "[DATABASE]", "[DOCUMENT]", "[ANY_PATH]"); * firestoreClient.deleteDocument(formattedName); * } * </code></pre> * * @param name The resource name of the Document to delete. In the format: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final void deleteDocument(String name) { ANY_PATH_PATH_TEMPLATE.validate(name, "deleteDocument"); DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder().setName(name).build(); deleteDocument(request); }