public virtual async Task <AttachmentResponse> GetAsync(GetAttachmentRequest request, CancellationToken cancellationToken = default) { var httpRequest = GetAttachmentHttpRequestFactory.Create(request); using (var res = await SendAsync(httpRequest, cancellationToken).ForAwait()) { return(await AttachmentResponseFactory.CreateAsync(res).ForAwait()); } }
public Attachments(IConnection connection, AttachmentResponseFactory attachmentResponseFactory, DocumentHeaderResponseFactory documentHeaderResponseFactory) { Ensure.That(connection, "connection").IsNotNull(); Ensure.That(attachmentResponseFactory, "attachmentResponseFactory").IsNotNull(); Ensure.That(documentHeaderResponseFactory, "documentHeaderResponseFactory").IsNotNull(); Connection = connection; AttachmentResponseFactory = attachmentResponseFactory; DocumentHeaderResponseFactory = documentHeaderResponseFactory; }
public Attachments(IDbConnection connection, ISerializer serializer) : base(connection) { Ensure.Any.IsNotNull(serializer, nameof(serializer)); AttachmentResponseFactory = new AttachmentResponseFactory(serializer); DocumentHeaderResponseFactory = new DocumentHeaderResponseFactory(serializer); GetAttachmentHttpRequestFactory = new GetAttachmentHttpRequestFactory(); PutAttachmentHttpRequestFactory = new PutAttachmentHttpRequestFactory(); DeleteAttachmentHttpRequestFactory = new DeleteAttachmentHttpRequestFactory(); }
public Attachments(IConnection connection, ISerializer serializer) : base(connection) { Ensure.That(serializer, "serializer").IsNotNull(); AttachmentResponseFactory = new AttachmentResponseFactory(serializer); DocumentHeaderResponseFactory = new DocumentHeaderResponseFactory(serializer); GetAttachmentHttpRequestFactory = new GetAttachmentHttpRequestFactory(Connection); PutAttachmentHttpRequestFactory = new PutAttachmentHttpRequestFactory(Connection); DeleteAttachmentHttpRequestFactory = new DeleteAttachmentHttpRequestFactory(Connection); }
protected virtual AttachmentResponse ProcessAttachmentResponse(HttpResponseMessage response) { return(AttachmentResponseFactory.Create(response)); }