forked from ArangoDB-Community/arangodb-net-standard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align response of patch documents with other endpoints.
- Loading branch information
Showing
7 changed files
with
78 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
arangodb-net-standard/DocumentApi/Models/PatchDocumentsDocumentResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace ArangoDBNetStandard.DocumentApi.Models | ||
{ | ||
/// <summary> | ||
/// Represents the response for one document when updating multiple document. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the deserialized new/old document object when requested.</typeparam> | ||
public class PatchDocumentsDocumentResponse<T> : PatchDocumentResponse<T> | ||
{ | ||
/// <summary> | ||
/// Indicates whether an error occurred. | ||
/// </summary> | ||
public bool Error { get; set; } | ||
|
||
/// <summary> | ||
/// Error message. | ||
/// </summary> | ||
public string ErrorMessage { get; set; } | ||
|
||
/// <summary> | ||
/// ArangoDB error number. | ||
/// </summary> | ||
public int ErrorNum { get; set; } | ||
} | ||
} |
33 changes: 26 additions & 7 deletions
33
arangodb-net-standard/DocumentApi/Models/PatchDocumentsResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
namespace ArangoDBNetStandard.DocumentApi.Models | ||
using System.Collections.Generic; | ||
|
||
namespace ArangoDBNetStandard.DocumentApi.Models | ||
{ | ||
public class PatchDocumentsResponse<T> : PatchDocumentResponse<T> | ||
/// <summary> | ||
/// Represents the response for updating multiple documents. | ||
/// </summary> | ||
/// <typeparam name="T">The type of the deserialized new/old document object when requested.</typeparam> | ||
public class PatchDocumentsResponse<T> : List<PatchDocumentsDocumentResponse<T>> | ||
{ | ||
public bool Error { get; set; } | ||
|
||
/// <summary> | ||
/// Error message. | ||
/// Creates an instance of <see cref="PatchDocumentsResponse{T}"/>. | ||
/// </summary> | ||
public string ErrorMessage { get; set; } | ||
public PatchDocumentsResponse() | ||
{ | ||
} | ||
|
||
private PatchDocumentsResponse(int capacity) | ||
: base(capacity) | ||
{ | ||
} | ||
|
||
public int ErrorNum { get; set; } | ||
/// <summary> | ||
/// Creates an empty response. | ||
/// This is used when <see cref="PostDocumentsQuery.Silent"/> is true. | ||
/// </summary> | ||
/// <returns></returns> | ||
public static PatchDocumentsResponse<T> Empty() | ||
{ | ||
return new PatchDocumentsResponse<T>(0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters