/** * * * <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 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; }
@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())); }