|
| 1 | +/*** |
| 2 | + * Lockstep Platform SDK for C# |
| 3 | + * |
| 4 | + * (c) 2021-2025 Lockstep, Inc. |
| 5 | + * |
| 6 | + * For the full copyright and license information, please view the LICENSE |
| 7 | + * file that was distributed with this source code. |
| 8 | + * |
| 9 | + * @author Lockstep Network <[email protected]> |
| 10 | + * @copyright 2021-2025 Lockstep, Inc. |
| 11 | + * @link https://github.com/Lockstep-Network/lockstep-sdk-csharp |
| 12 | + */ |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | +using System; |
| 17 | +using System.Collections.Generic; |
| 18 | +using System.Net.Http; |
| 19 | +using System.Threading.Tasks; |
| 20 | +using LockstepSDK.Models; |
| 21 | + |
| 22 | + |
| 23 | +namespace LockstepSDK.Clients |
| 24 | +{ |
| 25 | + /// <summary> |
| 26 | + /// API methods related to AttachmentLinks |
| 27 | + /// </summary> |
| 28 | + public class AttachmentLinksClient |
| 29 | + { |
| 30 | + private readonly LockstepApi _client; |
| 31 | + |
| 32 | + /// <summary> |
| 33 | + /// Constructor |
| 34 | + /// </summary> |
| 35 | + public AttachmentLinksClient(LockstepApi client) |
| 36 | + { |
| 37 | + _client = client; |
| 38 | + } |
| 39 | + |
| 40 | + /// <summary> |
| 41 | + /// Retrieves the Attachment Link with the provided Attachment Link identifier. |
| 42 | + /// |
| 43 | + /// An Attachment Link is a link that associates one Attachment with one object within ADS Platform. |
| 44 | + /// |
| 45 | + /// This route has been deprecated, use /Attachments |
| 46 | + /// |
| 47 | + /// See [Extensibility](https://developer.lockstep.io/docs/extensibility) for more information. |
| 48 | + /// |
| 49 | + /// </summary> |
| 50 | + /// <param name="attachmentId"></param> |
| 51 | + /// <param name="objectKey"></param> |
| 52 | + /// <param name="tableName"></param> |
| 53 | + [Obsolete("This endpoint is deprecated.")] |
| 54 | + public async Task<LockstepResponse<AttachmentLinkModel>> RetrieveAttachmentLink(Guid attachmentId, Guid objectKey, string tableName) |
| 55 | + { |
| 56 | + var url = $"/api/v1/AttachmentLinks"; |
| 57 | + var options = new Dictionary<string, object>(); |
| 58 | + options["attachmentId"] = attachmentId; |
| 59 | + options["objectKey"] = objectKey; |
| 60 | + options["tableName"] = tableName; |
| 61 | + return await _client.Request<AttachmentLinkModel>(HttpMethod.Get, url, options, null, null); |
| 62 | + } |
| 63 | + |
| 64 | + /// <summary> |
| 65 | + /// Creates one Attachment Link from the provided arguments. |
| 66 | + /// |
| 67 | + /// An Attachment Link is a link that associates one Attachment with one object within ADS Platform. |
| 68 | + /// |
| 69 | + /// This route has been deprecated, use /Attachments |
| 70 | + /// |
| 71 | + /// See [Extensibility](https://developer.lockstep.io/docs/extensibility) for more information. |
| 72 | + /// |
| 73 | + /// </summary> |
| 74 | + /// <param name="body"></param> |
| 75 | + [Obsolete("This endpoint is deprecated.")] |
| 76 | + public async Task<LockstepResponse<AttachmentLinkModel[]>> UploadAttachment(AttachmentLinkModel[] body) |
| 77 | + { |
| 78 | + var url = $"/api/v1/AttachmentLinks"; |
| 79 | + return await _client.Request<AttachmentLinkModel[]>(HttpMethod.Post, url, null, body, null); |
| 80 | + } |
| 81 | + |
| 82 | + /// <summary> |
| 83 | + /// Delete the specified link between an object and its attachment. |
| 84 | + /// |
| 85 | + /// An Attachment Link is a link that associates one Attachment with one object within ADS Platform. |
| 86 | + /// |
| 87 | + /// This route has been deprecated, use /Attachments |
| 88 | + /// |
| 89 | + /// See [Extensibility](https://developer.lockstep.io/docs/extensibility) for more information. |
| 90 | + /// |
| 91 | + /// </summary> |
| 92 | + /// <param name="attachmentId"></param> |
| 93 | + /// <param name="objectKey"></param> |
| 94 | + /// <param name="tableName"></param> |
| 95 | + [Obsolete("This endpoint is deprecated.")] |
| 96 | + public async Task<LockstepResponse<DeleteResult>> DeleteAttachmentLink(Guid? attachmentId = null, Guid? objectKey = null, string tableName = null) |
| 97 | + { |
| 98 | + var url = $"/api/v1/AttachmentLinks"; |
| 99 | + var options = new Dictionary<string, object>(); |
| 100 | + if (attachmentId != null) { options["attachmentId"] = attachmentId; } |
| 101 | + if (objectKey != null) { options["objectKey"] = objectKey; } |
| 102 | + if (tableName != null) { options["tableName"] = tableName; } |
| 103 | + return await _client.Request<DeleteResult>(HttpMethod.Delete, url, options, null, null); |
| 104 | + } |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// Queries Attachment Links for this account using the specified filtering, sorting, nested fetch, and pagination rules requested. |
| 108 | + /// |
| 109 | + /// More information on querying can be found on the [Searchlight Query Language](https://developer.lockstep.io/docs/querying-with-searchlight) page on the ADS Platform Developer website. |
| 110 | + /// |
| 111 | + /// An Attachment Link is a link that associates one Attachment with one object within ADS Platform. |
| 112 | + /// |
| 113 | + /// This route has been deprecated, use /Attachments |
| 114 | + /// |
| 115 | + /// See [Extensibility](https://developer.lockstep.io/docs/extensibility) for more information. |
| 116 | + /// |
| 117 | + /// </summary> |
| 118 | + /// <param name="filter">The filter to use to select from the list of available Attachments, in the [Searchlight query syntax](https://github.com/tspence/csharp-searchlight).</param> |
| 119 | + /// <param name="include">To fetch additional data on this object, specify the list of elements to retrieve. No collections are currently available for querying but may be available in the future.</param> |
| 120 | + /// <param name="order">The sort order for the results, in the [Searchlight order syntax](https://github.com/tspence/csharp-searchlight).</param> |
| 121 | + /// <param name="pageSize">The page size for results (default 250, maximum of 500)</param> |
| 122 | + /// <param name="pageNumber">The page number for results (default 0)</param> |
| 123 | + [Obsolete("This endpoint is deprecated.")] |
| 124 | + public async Task<LockstepResponse<FetchResult<AttachmentLinkModel>>> QueryAttachmentLinks(string filter = null, string include = null, string order = null, int? pageSize = null, int? pageNumber = null) |
| 125 | + { |
| 126 | + var url = $"/api/v1/AttachmentLinks/query"; |
| 127 | + var options = new Dictionary<string, object>(); |
| 128 | + if (filter != null) { options["filter"] = filter; } |
| 129 | + if (include != null) { options["include"] = include; } |
| 130 | + if (order != null) { options["order"] = order; } |
| 131 | + if (pageSize != null) { options["pageSize"] = pageSize; } |
| 132 | + if (pageNumber != null) { options["pageNumber"] = pageNumber; } |
| 133 | + return await _client.Request<FetchResult<AttachmentLinkModel>>(HttpMethod.Get, url, options, null, null); |
| 134 | + } |
| 135 | + } |
| 136 | +} |
0 commit comments