diff --git a/arangodb-net-standard/ApiHeaderProperties.cs b/arangodb-net-standard/ApiHeaderProperties.cs new file mode 100644 index 00000000..f1774e62 --- /dev/null +++ b/arangodb-net-standard/ApiHeaderProperties.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Text; + +namespace ArangoDBNetStandard +{ + public class ApiHeaderProperties + { + /// + /// Gets or sets the Id of a stream transaction. + /// + public string TransactionId { get; set; } + + /// + /// Any other headers you wish to add based on + /// the specifications of the API operation. + /// + public Dictionary OtherHeaders { get; set; } + + public WebHeaderCollection ToWebHeaderCollection() + { + WebHeaderCollection collection = new WebHeaderCollection(); + if (TransactionId != null) + { + collection.Add(CustomHttpHeaders.StreamTransactionHeader, TransactionId); + } + if (OtherHeaders != null && OtherHeaders.Count > 0) + { + foreach (string key in OtherHeaders.Keys) + { + collection.Add(key, OtherHeaders[key]); + } + } + return collection; + } + } +} diff --git a/arangodb-net-standard/CollectionApi/CollectionApiClient.cs b/arangodb-net-standard/CollectionApi/CollectionApiClient.cs index 9e17203d..4f1a0a71 100644 --- a/arangodb-net-standard/CollectionApi/CollectionApiClient.cs +++ b/arangodb-net-standard/CollectionApi/CollectionApiClient.cs @@ -85,13 +85,15 @@ public virtual async Task DeleteCollectionAsync(string /// Truncates a collection, i.e. removes all documents in the collection. /// PUT/_api/collection/{collection-name}/truncate /// - /// + /// Name of the collection + /// Headers (such as transaction id) to use for this operation. /// - public virtual async Task TruncateCollectionAsync(string collectionName) + public virtual async Task TruncateCollectionAsync(string collectionName, CollectionHeaderProperties headers = null) { using (var response = await _transport.PutAsync( _collectionApiPath + "/" + WebUtility.UrlEncode(collectionName) + "/truncate", - new byte[0]).ConfigureAwait(false)) + new byte[0], + headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -106,11 +108,14 @@ public virtual async Task TruncateCollectionAsync(st /// Gets count of documents in a collection. /// GET/_api/collection/{collection-name}/count /// - /// + /// Name of the collection + /// Headers (such as transaction id) to use for this operation. /// - public virtual async Task GetCollectionCountAsync(string collectionName) + public virtual async Task GetCollectionCountAsync(string collectionName, CollectionHeaderProperties headers = null) { - using (var response = await _transport.GetAsync(_collectionApiPath + "/" + WebUtility.UrlEncode(collectionName) + "/count").ConfigureAwait(false)) + using (var response = await _transport.GetAsync( + _collectionApiPath + "/" + WebUtility.UrlEncode(collectionName) + "/count", + headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { diff --git a/arangodb-net-standard/CollectionApi/ICollectionApiClient.cs b/arangodb-net-standard/CollectionApi/ICollectionApiClient.cs index 151315d5..e3114597 100644 --- a/arangodb-net-standard/CollectionApi/ICollectionApiClient.cs +++ b/arangodb-net-standard/CollectionApi/ICollectionApiClient.cs @@ -20,17 +20,19 @@ Task PostCollectionAsync( /// Truncates a collection, i.e. removes all documents in the collection. /// PUT/_api/collection/{collection-name}/truncate /// - /// + /// Name of the collection + /// Headers (such as transaction id) to use for this operation. /// - Task TruncateCollectionAsync(string collectionName); + Task TruncateCollectionAsync(string collectionName, CollectionHeaderProperties headers = null); /// /// Gets count of documents in a collection. /// GET/_api/collection/{collection-name}/count /// - /// + /// Name of the collection + /// Headers (such as transaction id) to use for this operation. /// - Task GetCollectionCountAsync(string collectionName); + Task GetCollectionCountAsync(string collectionName, CollectionHeaderProperties headers = null); /// /// Get all collections. diff --git a/arangodb-net-standard/CollectionApi/Models/CollectionHeaderProperties.cs b/arangodb-net-standard/CollectionApi/Models/CollectionHeaderProperties.cs new file mode 100644 index 00000000..d279d0e3 --- /dev/null +++ b/arangodb-net-standard/CollectionApi/Models/CollectionHeaderProperties.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ArangoDBNetStandard.CollectionApi.Models +{ + /// + /// Provides functionality for collection-specific headers + /// + public class CollectionHeaderProperties : ApiHeaderProperties + { + + } +} diff --git a/arangodb-net-standard/CursorApi/Models/CursorHeaderProperties.cs b/arangodb-net-standard/CursorApi/Models/CursorHeaderProperties.cs index 0822e041..f9b5c900 100644 --- a/arangodb-net-standard/CursorApi/Models/CursorHeaderProperties.cs +++ b/arangodb-net-standard/CursorApi/Models/CursorHeaderProperties.cs @@ -3,11 +3,8 @@ /// /// Class representing the additional header properties for Cursor Api. /// - public class CursorHeaderProperties + public class CursorHeaderProperties : ApiHeaderProperties { - /// - /// Gets or sets the stream transaction Id. - /// - public string TransactionId { get; set; } + } } diff --git a/arangodb-net-standard/DocumentApi/Models/DocumentHeaderProperties.cs b/arangodb-net-standard/DocumentApi/Models/DocumentHeaderProperties.cs index 082ee8c8..e295608c 100644 --- a/arangodb-net-standard/DocumentApi/Models/DocumentHeaderProperties.cs +++ b/arangodb-net-standard/DocumentApi/Models/DocumentHeaderProperties.cs @@ -2,20 +2,16 @@ namespace ArangoDBNetStandard.DocumentApi.Models { - public class DocumentHeaderProperties + public class DocumentHeaderProperties:ApiHeaderProperties { public string IfMatch { get; set; } public string IfNoneMatch { get; set; } - /// - /// Gets or sets the Id of a stream transaction. - /// - public string TransactionId { get; set; } - - public WebHeaderCollection ToWebHeaderCollection() + public new WebHeaderCollection ToWebHeaderCollection() { - WebHeaderCollection collection = new WebHeaderCollection(); + WebHeaderCollection collection = base.ToWebHeaderCollection(); + if (IfMatch != null) { collection.Add(HttpRequestHeader.IfMatch, $"\"{IfMatch}\""); @@ -26,12 +22,7 @@ public WebHeaderCollection ToWebHeaderCollection() collection.Add(HttpRequestHeader.IfNoneMatch, $"\"{IfNoneMatch}\""); } - if (TransactionId != null) - { - collection.Add(CustomHttpHeaders.StreamTransactionHeader, TransactionId); - } - return collection; } } -} +} \ No newline at end of file diff --git a/arangodb-net-standard/GraphApi/GraphApiClient.cs b/arangodb-net-standard/GraphApi/GraphApiClient.cs index 1468456c..7112e827 100644 --- a/arangodb-net-standard/GraphApi/GraphApiClient.cs +++ b/arangodb-net-standard/GraphApi/GraphApiClient.cs @@ -260,13 +260,15 @@ public virtual async Task PostVertexCollectionAsyn /// /// 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. + /// Headers to use for this operation. /// public virtual async Task> PostVertexAsync( string graphName, string collectionName, T vertex, PostVertexQuery query = null, - ApiClientSerializationOptions serializationOptions = null) + ApiClientSerializationOptions serializationOptions = null, + GraphHeaderProperties headers = null) { string uri = _graphApiPath + '/' + WebUtility.UrlEncode(graphName) + "/vertex/" + WebUtility.UrlEncode(collectionName); @@ -275,7 +277,7 @@ public virtual async Task> PostVertexAsync( uri += "?" + query.ToQueryString(); } var content = GetContent(vertex, serializationOptions); - using (var response = await _transport.PostAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PostAsync(uri, content,headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -367,13 +369,15 @@ public virtual async Task DeleteVertexCollection /// Optional query parameters of the request. /// 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. + /// Headers to use for this operation. /// public virtual async Task> PostEdgeAsync( string graphName, string collectionName, T edge, PostEdgeQuery query = null, - ApiClientSerializationOptions serializationOptions = null) + ApiClientSerializationOptions serializationOptions = null, + GraphHeaderProperties headers = null) { var content = GetContent(edge, serializationOptions); @@ -385,7 +389,7 @@ public virtual async Task> PostEdgeAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.PostAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PostAsync(uri, content, headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -404,17 +408,20 @@ public virtual async Task> PostEdgeAsync( /// The name of the edge collection the edge belongs to. /// The _key attribute of the edge. /// + /// Headers to use for this operation. /// public virtual Task> GetEdgeAsync( string graphName, string collectionName, string edgeKey, - GetEdgeQuery query = null) + GetEdgeQuery query = null, + GraphHeaderProperties headers = null) { return GetEdgeAsync( graphName, WebUtility.UrlEncode(collectionName) + '/' + WebUtility.UrlEncode(edgeKey), - query); + query, + headers); } /// @@ -425,11 +432,13 @@ public virtual Task> GetEdgeAsync( /// The name of the graph. /// The document-handle of the edge document. /// + /// Headers to use for this operation. /// public virtual async Task> GetEdgeAsync( string graphName, string edgeHandle, - GetEdgeQuery query = null) + GetEdgeQuery query = null, + GraphHeaderProperties headers = null) { string uri = _graphApiPath + "/" + WebUtility.UrlEncode(graphName) + "/edge/" + edgeHandle; @@ -439,7 +448,7 @@ public virtual async Task> GetEdgeAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri,headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -460,17 +469,20 @@ public virtual async Task> GetEdgeAsync( /// The name of the edge collection the edge belongs to. /// The _key attribute of the edge. /// + /// Headers to use for this operation. /// public virtual Task> DeleteEdgeAsync( string graphName, string collectionName, string edgeKey, - DeleteEdgeQuery query = null) + DeleteEdgeQuery query = null, + GraphHeaderProperties headers = null) { return DeleteEdgeAsync( graphName, WebUtility.UrlEncode(collectionName) + "/" + WebUtility.UrlEncode(edgeKey), - query); + query, + headers); } @@ -483,11 +495,13 @@ public virtual Task> DeleteEdgeAsync( /// The name of the graph. /// The document ID of the edge to delete. /// + /// Headers to use for this operation. /// public virtual async Task> DeleteEdgeAsync( string graphName, string documentId, - DeleteEdgeQuery query = null) + DeleteEdgeQuery query = null, + GraphHeaderProperties headers = null) { ValidateDocumentId(documentId); @@ -498,7 +512,7 @@ public virtual async Task> DeleteEdgeAsync( { uri += "?" + query.ToQueryString(); } - using (var response = await _transport.DeleteAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.DeleteAsync(uri,headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -517,12 +531,14 @@ public virtual async Task> DeleteEdgeAsync( /// /// /// + /// Headers to use for this operation. /// public virtual Task> GetVertexAsync( string graphName, string collectionName, string vertexKey, - GetVertexQuery query = null) + GetVertexQuery query = null, + GraphHeaderProperties headers = null) { return GetVertexAsync( graphName, @@ -537,11 +553,13 @@ public virtual Task> GetVertexAsync( /// The name of the graph to get the vertex from. /// The document ID of the vertex to retrieve. /// + /// Headers to use for this operation. /// public virtual async Task> GetVertexAsync( string graphName, string documentId, - GetVertexQuery query = null) + GetVertexQuery query = null, + GraphHeaderProperties headers = null) { ValidateDocumentId(documentId); @@ -552,7 +570,7 @@ public virtual async Task> GetVertexAsync( { uri += "?" + query.ToQueryString(); } - using (var response = await _transport.GetAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.GetAsync(uri,headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -571,17 +589,20 @@ public virtual async Task> GetVertexAsync( /// /// /// + /// Headers to use for this operation. /// public virtual Task> DeleteVertexAsync( string graphName, string collectionName, string vertexKey, - DeleteVertexQuery query = null) + DeleteVertexQuery query = null, + GraphHeaderProperties headers = null) { return DeleteVertexAsync( graphName, WebUtility.UrlEncode(collectionName) + "/" + WebUtility.UrlEncode(vertexKey), - query); + query, + headers); } /// @@ -591,11 +612,13 @@ public virtual Task> DeleteVertexAsync( /// The name of the graph to delete the vertex from. /// The document ID of the vertex to delete. /// + /// Headers to use for this operation. /// public virtual async Task> DeleteVertexAsync( string graphName, string documentId, - DeleteVertexQuery query = null) + DeleteVertexQuery query = null, + GraphHeaderProperties headers = null) { ValidateDocumentId(documentId); @@ -607,7 +630,7 @@ public virtual async Task> DeleteVertexAsync( uri += "?" + query.ToQueryString(); } - using (var response = await _transport.DeleteAsync(uri).ConfigureAwait(false)) + using (var response = await _transport.DeleteAsync(uri,headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -631,19 +654,22 @@ public virtual async Task> DeleteVertexAsync( /// /// /// + /// Headers to use for this operation. /// public virtual Task> PatchVertexAsync( string graphName, string collectionName, string vertexKey, T body, - PatchVertexQuery query = null) + PatchVertexQuery query = null, + GraphHeaderProperties headers = null) { return PatchVertexAsync( graphName, WebUtility.UrlEncode(collectionName) + "/" + WebUtility.UrlEncode(vertexKey), body, - query); + query, + headers); } /// @@ -658,12 +684,14 @@ public virtual Task> PatchVertexAsync( /// The document ID of the vertex to update. /// /// + /// Headers to use for this operation. /// public virtual async Task> PatchVertexAsync( string graphName, string documentId, T body, - PatchVertexQuery query = null) + PatchVertexQuery query = null, + GraphHeaderProperties headers = null) { ValidateDocumentId(documentId); @@ -676,7 +704,7 @@ public virtual async Task> PatchVertexAsync( } var content = GetContent(body, new ApiClientSerializationOptions(false, false)); - using (var response = await _transport.PatchAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PatchAsync(uri, content,headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -697,19 +725,22 @@ public virtual async Task> PatchVertexAsync( /// /// /// + /// Headers to use for this operation. /// public virtual Task> PutEdgeAsync( string graphName, string collectionName, string edgeKey, T edge, - PutEdgeQuery query = null) + PutEdgeQuery query = null, + GraphHeaderProperties headers = null) { return PutEdgeAsync( graphName, WebUtility.UrlEncode(collectionName) + "/" + WebUtility.UrlEncode(edgeKey), edge, - query); + query, + headers); } /// @@ -721,12 +752,14 @@ public virtual Task> PutEdgeAsync( /// The document ID of the edge to replace. /// /// + /// Headers to use for this operation. /// public virtual async Task> PutEdgeAsync( string graphName, string documentId, T edge, - PutEdgeQuery query = null) + PutEdgeQuery query = null, + GraphHeaderProperties headers = null) { ValidateDocumentId(documentId); @@ -739,7 +772,7 @@ public virtual async Task> PutEdgeAsync( } var content = GetContent(edge, new ApiClientSerializationOptions(false, false)); - using (var response = await _transport.PutAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PutAsync(uri, content, headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -798,19 +831,22 @@ public virtual async Task PutEdgeDefinitionAsync( /// The document key of the edge to update. /// /// + /// Headers to use for this operation. /// public virtual Task> PatchEdgeAsync( string graphName, string collectionName, string edgeKey, T edge, - PatchEdgeQuery query = null) + PatchEdgeQuery query = null, + GraphHeaderProperties headers = null) { return PatchEdgeAsync( graphName, WebUtility.UrlEncode(collectionName) + "/" + WebUtility.UrlEncode(edgeKey), edge, - query); + query, + headers); } /// @@ -823,12 +859,14 @@ public virtual Task> PatchEdgeAsync( /// The document ID of the edge to update. /// /// + /// Headers to use for this operation. /// public virtual async Task> PatchEdgeAsync( string graphName, string documentId, T edge, - PatchEdgeQuery query = null) + PatchEdgeQuery query = null, + GraphHeaderProperties headers = null) { ValidateDocumentId(documentId); @@ -841,7 +879,7 @@ public virtual async Task> PatchEdgeAsync( } var content = GetContent(edge, new ApiClientSerializationOptions(true, true)); - using (var response = await _transport.PatchAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PatchAsync(uri, content, headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { @@ -862,19 +900,22 @@ public virtual async Task> PatchEdgeAsync( /// /// /// + /// Headers to use for this operation. /// public virtual Task> PutVertexAsync( string graphName, string collectionName, string key, T vertex, - PutVertexQuery query = null) + PutVertexQuery query = null, + GraphHeaderProperties headers = null) { return PutVertexAsync( graphName, WebUtility.UrlEncode(collectionName) + "/" + WebUtility.UrlEncode(key), vertex, - query); + query, + headers); } /// @@ -885,12 +926,14 @@ public virtual Task> PutVertexAsync( /// The document ID of the vertex to replace. /// /// + /// Headers to use for this operation. /// public virtual async Task> PutVertexAsync( string graphName, string documentId, T vertex, - PutVertexQuery query = null) + PutVertexQuery query = null, + GraphHeaderProperties headers = null) { ValidateDocumentId(documentId); @@ -903,7 +946,7 @@ public virtual async Task> PutVertexAsync( } var content = GetContent(vertex, new ApiClientSerializationOptions(true, true)); - using (var response = await _transport.PutAsync(uri, content).ConfigureAwait(false)) + using (var response = await _transport.PutAsync(uri, content, headers?.ToWebHeaderCollection()).ConfigureAwait(false)) { if (response.IsSuccessStatusCode) { diff --git a/arangodb-net-standard/GraphApi/IGraphApiClient.cs b/arangodb-net-standard/GraphApi/IGraphApiClient.cs index 060105c6..61cdcd71 100644 --- a/arangodb-net-standard/GraphApi/IGraphApiClient.cs +++ b/arangodb-net-standard/GraphApi/IGraphApiClient.cs @@ -109,13 +109,15 @@ Task PostVertexCollectionAsync( /// /// 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. + /// Headers to use for this operation. /// Task> PostVertexAsync( string graphName, string collectionName, T vertex, PostVertexQuery query = null, - ApiClientSerializationOptions serializationOptions = null); + ApiClientSerializationOptions serializationOptions = null, + GraphHeaderProperties headers=null); /// /// Remove one edge definition from the graph. This will only remove the @@ -163,14 +165,16 @@ Task DeleteVertexCollectionAsync( /// The edge to create. /// /// 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 serialization options should be provided by the serializer, otherwise the given options should be used. + /// Headers to use for this operation. /// Task> PostEdgeAsync( string graphName, string collectionName, T edge, PostEdgeQuery query = null, - ApiClientSerializationOptions serializationOptions = null); + ApiClientSerializationOptions serializationOptions = null, + GraphHeaderProperties headers = null); /// /// Gets an edge from the given graph using the edge collection and _key attribute. @@ -179,13 +183,15 @@ Task> PostEdgeAsync( /// The name of the graph. /// The name of the edge collection the edge belongs to. /// The _key attribute of the edge. - /// + /// + /// Headers to use for this operation. /// Task> GetEdgeAsync( string graphName, string collectionName, string edgeKey, - GetEdgeQuery query = null); + GetEdgeQuery query = null, + GraphHeaderProperties headers = null); /// /// Gets an edge from the given graph using the edge's document-handle. @@ -195,11 +201,13 @@ Task> GetEdgeAsync( /// The name of the graph. /// The document-handle of the edge document. /// + /// Headers to use for this operation. /// Task> GetEdgeAsync( string graphName, string edgeHandle, - GetEdgeQuery query = null); + GetEdgeQuery query = null, + GraphHeaderProperties headers = null); /// /// Removes an edge from the collection. @@ -211,12 +219,14 @@ Task> GetEdgeAsync( /// The name of the edge collection the edge belongs to. /// The _key attribute of the edge. /// + /// Headers to use for this operation. /// Task> DeleteEdgeAsync( string graphName, string collectionName, string edgeKey, - DeleteEdgeQuery query = null); + DeleteEdgeQuery query = null, + GraphHeaderProperties headers = null); /// /// Removes an edge based on its document ID. @@ -226,11 +236,13 @@ Task> DeleteEdgeAsync( /// The name of the graph. /// The document ID of the edge to delete. /// + /// Headers to use for this operation. /// Task> DeleteEdgeAsync( string graphName, string documentId, - DeleteEdgeQuery query = null); + DeleteEdgeQuery query = null, + GraphHeaderProperties headers = null); /// /// Gets a vertex from the given collection. @@ -240,12 +252,14 @@ Task> DeleteEdgeAsync( /// /// /// + /// Headers to use for this operation. /// Task> GetVertexAsync( string graphName, string collectionName, string vertexKey, - GetVertexQuery query = null); + GetVertexQuery query = null, + GraphHeaderProperties headers = null); /// /// Gets a vertex based on its document ID. @@ -253,11 +267,13 @@ Task> GetVertexAsync( /// The name of the graph to get the vertex from. /// The document ID of the vertex to retrieve. /// + /// Headers to use for this operation. /// Task> GetVertexAsync( string graphName, string documentId, - GetVertexQuery query = null); + GetVertexQuery query = null, + GraphHeaderProperties headers = null); /// /// Removes a vertex from the collection. @@ -267,12 +283,14 @@ Task> GetVertexAsync( /// /// /// + /// Headers to use for this operation. /// Task> DeleteVertexAsync( string graphName, string collectionName, string vertexKey, - DeleteVertexQuery query = null); + DeleteVertexQuery query = null, + GraphHeaderProperties headers = null); /// /// Removes a vertex based on its document ID. @@ -280,11 +298,13 @@ Task> DeleteVertexAsync( /// The name of the graph to delete the vertex from. /// The document ID of the vertex to delete. /// + /// Headers to use for this operation. /// Task> DeleteVertexAsync( string graphName, string documentId, - DeleteVertexQuery query = null); + DeleteVertexQuery query = null, + GraphHeaderProperties headers = null); /// /// Updates the data of the specific vertex in the collection. @@ -299,13 +319,15 @@ Task> DeleteVertexAsync( /// /// /// + /// Headers to use for this operation. /// Task> PatchVertexAsync( string graphName, string collectionName, string vertexKey, T body, - PatchVertexQuery query = null); + PatchVertexQuery query = null, + GraphHeaderProperties headers = null); /// /// Updates the data of the specific vertex based on its document ID. @@ -318,12 +340,14 @@ Task> PatchVertexAsync( /// The document ID of the vertex to update. /// /// + /// Headers to use for this operation. /// Task> PatchVertexAsync( string graphName, string documentId, T body, - PatchVertexQuery query = null); + PatchVertexQuery query = null, + GraphHeaderProperties headers = null); /// /// Replaces the data of an edge in the collection. @@ -335,13 +359,15 @@ Task> PatchVertexAsync( /// /// /// + /// Headers to use for this operation. /// Task> PutEdgeAsync( string graphName, string collectionName, string edgeKey, T edge, - PutEdgeQuery query = null); + PutEdgeQuery query = null, + GraphHeaderProperties headers=null); /// /// Replaces the data of an edge based on its document ID. @@ -351,12 +377,14 @@ Task> PutEdgeAsync( /// The document ID of the edge to replace. /// /// + /// Headers to use for this operation. /// Task> PutEdgeAsync( string graphName, string documentId, T edge, - PutEdgeQuery query = null); + PutEdgeQuery query = null, + GraphHeaderProperties headers = null); /// /// Change one specific edge definition. @@ -386,13 +414,15 @@ Task PutEdgeDefinitionAsync( /// The document key of the edge to update. /// /// + /// Headers to use for this operation. /// Task> PatchEdgeAsync( string graphName, string collectionName, string edgeKey, T edge, - PatchEdgeQuery query = null); + PatchEdgeQuery query = null, + GraphHeaderProperties headers = null); /// /// Updates the data of the specific edge based on its document ID. @@ -404,12 +434,14 @@ Task> PatchEdgeAsync( /// The document ID of the edge to update. /// /// + /// Headers to use for this operation. /// Task> PatchEdgeAsync( string graphName, string documentId, T edge, - PatchEdgeQuery query = null); + PatchEdgeQuery query = null, + GraphHeaderProperties headers = null); /// /// Replaces the data of a vertex in the collection. @@ -421,13 +453,15 @@ Task> PatchEdgeAsync( /// /// /// + /// Headers to use for this operation. /// Task> PutVertexAsync( string graphName, string collectionName, string key, T vertex, - PutVertexQuery query = null); + PutVertexQuery query = null, + GraphHeaderProperties headers = null); /// /// Replaces the data of a vertex based on its document ID. @@ -437,11 +471,13 @@ Task> PutVertexAsync( /// The document ID of the vertex to replace. /// /// + /// Headers to use for this operation. /// Task> PutVertexAsync( string graphName, string documentId, T vertex, - PutVertexQuery query = null); + PutVertexQuery query = null, + GraphHeaderProperties headers = null); } } diff --git a/arangodb-net-standard/GraphApi/Models/GraphHeaderProperties.cs b/arangodb-net-standard/GraphApi/Models/GraphHeaderProperties.cs new file mode 100644 index 00000000..2d092a19 --- /dev/null +++ b/arangodb-net-standard/GraphApi/Models/GraphHeaderProperties.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ArangoDBNetStandard.GraphApi.Models +{ + /// + /// Provides functionality for graph-specific headers + /// + public class GraphHeaderProperties : ApiHeaderProperties + { + + } +}