diff --git a/arangodb-net-standard.Test/DocumentApi/DocumentApiClientTest.cs b/arangodb-net-standard.Test/DocumentApi/DocumentApiClientTest.cs index 9e7fe3c3..d9a5a248 100644 --- a/arangodb-net-standard.Test/DocumentApi/DocumentApiClientTest.cs +++ b/arangodb-net-standard.Test/DocumentApi/DocumentApiClientTest.cs @@ -1057,7 +1057,7 @@ public async Task ReadDocumentHeaderAsync_ShouldReturnNotModified_WhenIfNoneMatc { Dictionary document = new Dictionary { ["key"] = "value" }; var docResponse = await _docClient.PostDocumentAsync(_testCollection, document); - var response = await _docClient.HeadDocumentAsync(_testCollection, docResponse._key, new HeadDocumentHeader + var response = await _docClient.HeadDocumentAsync(_testCollection, docResponse._key, new DocumentHeaderProperties { IfNoneMatch = docResponse._rev }); @@ -1078,7 +1078,7 @@ public async Task ReadDocumentHeaderAsync_ShouldReturnPreconditionFailed_WhenIfM ["key"] = "newValue" }); // check if revision has changed - var response = await _docClient.HeadDocumentAsync(_testCollection, docResponse._key, new HeadDocumentHeader + var response = await _docClient.HeadDocumentAsync(_testCollection, docResponse._key, new DocumentHeaderProperties { IfMatch = docResponse._rev }); @@ -1109,7 +1109,7 @@ public async Task ReadDocumentHeaderAsync_ShouldReturnOk_WhenTransactionIdIsGive var response = await _docClient.HeadDocumentAsync( _testCollection, docResponse._key, - new HeadDocumentHeader { TransactionId = beginTransaction.Result.Id }); + new DocumentHeaderProperties { TransactionId = beginTransaction.Result.Id }); // Check for the expected status. Assert.Equal(HttpStatusCode.OK, response.Code); @@ -1132,7 +1132,7 @@ public async Task ReadDocumentHeaderAsync_ShouldReturnNotFound_WhenTransctionIdI var response = await _docClient.HeadDocumentAsync( _testCollection, docResponse._key, - new HeadDocumentHeader { TransactionId = dummyTransactionId }); + new DocumentHeaderProperties { TransactionId = dummyTransactionId }); // Check for the expected status. Assert.Equal(HttpStatusCode.BadRequest, response.Code); diff --git a/arangodb-net-standard/DocumentApi/DocumentApiClient.cs b/arangodb-net-standard/DocumentApi/DocumentApiClient.cs index 8a72c24a..7acf6b4b 100644 --- a/arangodb-net-standard/DocumentApi/DocumentApiClient.cs +++ b/arangodb-net-standard/DocumentApi/DocumentApiClient.cs @@ -48,9 +48,9 @@ public DocumentApiClient(IApiClientTransport client, IApiClientSerialization ser /// /// Method to get the header collection. /// - /// The values. + /// The values. /// values. - protected virtual WebHeaderCollection GetHeaderCollection(HeadDocumentHeader headers) + protected virtual WebHeaderCollection GetHeaderCollection(DocumentHeaderProperties headers) { var headerCollection = headers == null ? new WebHeaderCollection() : headers.ToWebHeaderCollection(); return headerCollection; @@ -65,14 +65,14 @@ protected virtual WebHeaderCollection GetHeaderCollection(HeadDocumentHeader hea /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// public virtual Task> PostDocumentAsync( string collectionName, T document, PostDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { return PostDocumentAsync( collectionName, @@ -95,14 +95,14 @@ public virtual Task> PostDocumentAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// public virtual async Task> PostDocumentAsync( string collectionName, T document, PostDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { string uriString = _docApiPath + "/" + WebUtility.UrlEncode(collectionName); if (query != null) @@ -133,14 +133,14 @@ public virtual async Task> PostDocumentAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// public virtual async Task> PostDocumentsAsync( string collectionName, IList documents, PostDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { string uriString = _docApiPath + "/" + WebUtility.UrlEncode(collectionName); if (query != null) @@ -178,14 +178,14 @@ public virtual async Task> PostDocumentsAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// public virtual async Task> PutDocumentsAsync( string collectionName, IList documents, PutDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { string uri = _docApiPath + "/" + WebUtility.UrlEncode(collectionName); if (query != null) @@ -225,14 +225,14 @@ public virtual async Task> PutDocumentsAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// public virtual async Task> PutDocumentAsync( string documentId, T doc, PutDocumentQuery opts = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { ValidateDocumentId(documentId); string uri = _docApiPath + "/" + documentId; @@ -265,14 +265,14 @@ public virtual async Task> PutDocumentAsync( /// /// /// - /// The values. + /// The values. /// public virtual Task> PutDocumentAsync( string collectionName, string documentKey, T doc, PutDocumentQuery opts = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { return PutDocumentAsync( $"{WebUtility.UrlEncode(collectionName)}/{WebUtility.UrlEncode(documentKey)}", @@ -287,10 +287,10 @@ public virtual Task> PutDocumentAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task GetDocumentAsync( - string collectionName, string documentKey, HeadDocumentHeader headers = null) + string collectionName, string documentKey, DocumentHeaderProperties headers = null) { return await GetDocumentAsync( $"{WebUtility.UrlEncode(collectionName)}/{WebUtility.UrlEncode(documentKey)}", headers) @@ -302,9 +302,9 @@ public virtual async Task GetDocumentAsync( /// /// /// - /// The values. + /// The values. /// - public virtual async Task GetDocumentAsync(string documentId, HeadDocumentHeader headers = null) + public virtual async Task GetDocumentAsync(string documentId, DocumentHeaderProperties headers = null) { ValidateDocumentId(documentId); var headerCollection = GetHeaderCollection(headers); @@ -326,12 +326,12 @@ public virtual async Task GetDocumentAsync(string documentId, HeadDocument /// deserialized from the response. /// Collection name /// Document keys to fetch documents for - /// The values. + /// The values. /// public virtual async Task> GetDocumentsAsync( string collectionName, IList selectors, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { string uri = $"{_docApiPath}/{WebUtility.UrlEncode(collectionName)}?onlyget=true"; var content = GetContent(selectors, new ApiClientSerializationOptions(false, true)); @@ -361,13 +361,13 @@ public virtual async Task> GetDocumentsAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task> DeleteDocumentAsync( string collectionName, string documentKey, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { return await DeleteDocumentAsync( $"{WebUtility.UrlEncode(collectionName)}/{WebUtility.UrlEncode(documentKey)}", @@ -385,12 +385,12 @@ public virtual async Task> DeleteDocumentAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task> DeleteDocumentAsync( string documentId, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { return await DeleteDocumentAsync(documentId, query, headers).ConfigureAwait(false); } @@ -402,13 +402,13 @@ public virtual async Task> DeleteDocumentAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task> DeleteDocumentAsync( string collectionName, string documentKey, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { return await DeleteDocumentAsync( $"{WebUtility.UrlEncode(collectionName)}/{WebUtility.UrlEncode(documentKey)}", @@ -420,12 +420,12 @@ public virtual async Task> DeleteDocumentAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task> DeleteDocumentAsync( string documentId, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { ValidateDocumentId(documentId); string uri = _docApiPath + "/" + documentId; @@ -461,13 +461,13 @@ public virtual async Task> DeleteDocumentAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task> DeleteDocumentsAsync( string collectionName, IList selectors, DeleteDocumentsQuery query = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { return await DeleteDocumentsAsync(collectionName, selectors, query, headers).ConfigureAwait(false); } @@ -480,13 +480,13 @@ public virtual async Task> DeleteDocumentsAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task> DeleteDocumentsAsync( string collectionName, IList selectors, DeleteDocumentsQuery query = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { string uri = _docApiPath + "/" + WebUtility.UrlEncode(collectionName); if (query != null) @@ -538,14 +538,14 @@ public virtual async Task> DeleteDocumentsAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// public virtual async Task> PatchDocumentsAsync( string collectionName, IList patches, PatchDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { string uri = _docApiPath + "/" + WebUtility.UrlEncode(collectionName); if (query != null) @@ -591,14 +591,14 @@ public virtual async Task> PatchDocumentsAsync( /// /// /// - /// The values. + /// The values. /// public virtual async Task> PatchDocumentAsync( string collectionName, string documentKey, T body, PatchDocumentQuery query = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { string documentHandle = WebUtility.UrlEncode(collectionName) + "/" + WebUtility.UrlEncode(documentKey); @@ -624,14 +624,14 @@ public virtual async Task> PatchDocumentAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// public virtual async Task> PatchDocumentAsync( string documentId, T body, PatchDocumentQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { ValidateDocumentId(documentId); string uriString = _docApiPath + "/" + documentId; @@ -662,7 +662,7 @@ public virtual async Task> PatchDocumentAsync( /// /// /// - /// The values. + /// The values. /// /// 200: is returned if the document was found. /// 304: is returned if the “If-None-Match” header is given and the document has the same version. @@ -674,7 +674,7 @@ public virtual async Task> PatchDocumentAsync( public virtual async Task HeadDocumentAsync( string collectionName, string documentKey, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { return await HeadDocumentAsync( $"{WebUtility.UrlEncode(collectionName)}/{WebUtility.UrlEncode(documentKey)}", @@ -688,7 +688,7 @@ public virtual async Task HeadDocumentAsync( /// HEAD/_api/document/{document-handle} /// /// - /// The values. + /// The values. /// Document ID is invalid. /// /// 200: is returned if the document was found. @@ -700,7 +700,7 @@ public virtual async Task HeadDocumentAsync( /// public virtual async Task HeadDocumentAsync( string documentId, - HeadDocumentHeader headers = null) + DocumentHeaderProperties headers = null) { ValidateDocumentId(documentId); string uri = _docApiPath + "/" + documentId; diff --git a/arangodb-net-standard/DocumentApi/IDocumentApiClient.cs b/arangodb-net-standard/DocumentApi/IDocumentApiClient.cs index 03720dda..3bddccea 100644 --- a/arangodb-net-standard/DocumentApi/IDocumentApiClient.cs +++ b/arangodb-net-standard/DocumentApi/IDocumentApiClient.cs @@ -20,14 +20,14 @@ public interface IDocumentApiClient /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// Task> PostDocumentAsync( string collectionName, T document, PostDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Post a single document with the possibility to specify a different type @@ -42,14 +42,14 @@ Task> PostDocumentAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// Task> PostDocumentAsync( string collectionName, T document, PostDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Post multiple documents in a single request. @@ -60,14 +60,14 @@ Task> PostDocumentAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// Task> PostDocumentsAsync( string collectionName, IList documents, PostDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Replace multiple documents. @@ -78,14 +78,14 @@ Task> PostDocumentsAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// Task> PutDocumentsAsync( string collectionName, IList documents, PutDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Replaces the document with the provided document ID with the one in @@ -98,14 +98,14 @@ Task> PutDocumentsAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// Task> PutDocumentAsync( string documentId, T doc, PutDocumentQuery opts = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Replaces the document based on its Document ID with the one in @@ -117,14 +117,14 @@ Task> PutDocumentAsync( /// /// /// - /// The values. + /// The values. /// Task> PutDocumentAsync( string collectionName, string documentKey, T doc, PutDocumentQuery opts = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Get an existing document. @@ -132,18 +132,18 @@ Task> PutDocumentAsync( /// /// /// - /// The values. + /// The values. /// - Task GetDocumentAsync(string collectionName, string documentKey, HeadDocumentHeader headers = null); + Task GetDocumentAsync(string collectionName, string documentKey, DocumentHeaderProperties headers = null); /// /// Get an existing document based on its Document ID. /// /// /// - /// The values. + /// The values. /// - Task GetDocumentAsync(string documentId, HeadDocumentHeader headers = null); + Task GetDocumentAsync(string documentId, DocumentHeaderProperties headers = null); /// /// Get multiple documents. @@ -152,12 +152,12 @@ Task> PutDocumentAsync( /// deserialized from the response. /// Collection name /// Document keys to fetch documents for - /// The values. + /// The values. /// Task> GetDocumentsAsync( string collectionName, IList selectors, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Delete a document. @@ -171,13 +171,13 @@ Task> GetDocumentsAsync( /// /// /// - /// The values. + /// The values. /// Task> DeleteDocumentAsync( string collectionName, string documentKey, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Delete a document based on its document ID. @@ -190,12 +190,12 @@ Task> DeleteDocumentAsync( /// /// /// - /// The values. + /// The values. /// Task> DeleteDocumentAsync( string documentId, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Delete a document. @@ -204,25 +204,25 @@ Task> DeleteDocumentAsync( /// /// /// - /// The values. + /// The values. /// Task> DeleteDocumentAsync( string collectionName, string documentKey, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Delete a document based on its document ID. /// /// /// - /// The values. + /// The values. /// Task> DeleteDocumentAsync( string documentId, DeleteDocumentQuery query = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Delete multiple documents based on the passed document selectors. @@ -237,13 +237,13 @@ Task> DeleteDocumentAsync( /// /// /// - /// The values. + /// The values. /// Task> DeleteDocumentsAsync( string collectionName, IList selectors, DeleteDocumentsQuery query = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Delete multiple documents based on the passed document selectors. @@ -253,13 +253,13 @@ Task> DeleteDocumentsAsync( /// /// /// - /// The values. + /// The values. /// Task> DeleteDocumentsAsync( string collectionName, IList selectors, DeleteDocumentsQuery query = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Partially updates documents, the documents to update are specified @@ -286,14 +286,14 @@ Task> DeleteDocumentsAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// Task> PatchDocumentsAsync( string collectionName, IList patches, PatchDocumentsQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Partially updates the document identified by document-handle. @@ -312,14 +312,14 @@ Task> PatchDocumentsAsync( /// /// /// - /// The values. + /// The values. /// Task> PatchDocumentAsync( string collectionName, string documentKey, T body, PatchDocumentQuery query = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Partially updates the document identified by document-handle. @@ -339,14 +339,14 @@ Task> PatchDocumentAsync( /// /// The serialization options. When the value is null the /// the serialization options should be provided by the serializer, otherwise the given options should be used. - /// The values. + /// The values. /// Task> PatchDocumentAsync( string documentId, T body, PatchDocumentQuery query = null, ApiClientSerializationOptions serializationOptions = null, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Like GET, but only returns the header fields and not the body. You @@ -356,7 +356,7 @@ Task> PatchDocumentAsync( /// /// /// - /// The values. + /// The values. /// /// 200: is returned if the document was found. /// 304: is returned if the “If-None-Match” header is given and the document has the same version. @@ -368,7 +368,7 @@ Task> PatchDocumentAsync( Task HeadDocumentAsync( string collectionName, string documentKey, - HeadDocumentHeader headers = null); + DocumentHeaderProperties headers = null); /// /// Like GET, but only returns the header fields and not the body. You @@ -377,7 +377,7 @@ Task HeadDocumentAsync( /// HEAD/_api/document/{document-handle} /// /// - /// The values. + /// The values. /// Document ID is invalid. /// /// 200: is returned if the document was found. @@ -387,6 +387,6 @@ Task HeadDocumentAsync( /// 412: is returned if an “If-Match” header is given and the found document has a different version. The response will also contain the found document’s current revision in the Etag header. /// /// - Task HeadDocumentAsync(string documentId, HeadDocumentHeader headers = null); + Task HeadDocumentAsync(string documentId, DocumentHeaderProperties headers = null); } } diff --git a/arangodb-net-standard/DocumentApi/Models/HeadDocumentHeader.cs b/arangodb-net-standard/DocumentApi/Models/DocumentHeaderProperties.cs similarity index 95% rename from arangodb-net-standard/DocumentApi/Models/HeadDocumentHeader.cs rename to arangodb-net-standard/DocumentApi/Models/DocumentHeaderProperties.cs index dbb1d6d5..082ee8c8 100644 --- a/arangodb-net-standard/DocumentApi/Models/HeadDocumentHeader.cs +++ b/arangodb-net-standard/DocumentApi/Models/DocumentHeaderProperties.cs @@ -2,7 +2,7 @@ namespace ArangoDBNetStandard.DocumentApi.Models { - public class HeadDocumentHeader + public class DocumentHeaderProperties { public string IfMatch { get; set; }