示例#1
0
        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());
            }
        }
示例#2
0
        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;
        }
示例#3
0
        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();
        }
示例#4
0
        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);
        }
示例#5
0
 protected virtual AttachmentResponse ProcessAttachmentResponse(HttpResponseMessage response)
 {
     return(AttachmentResponseFactory.Create(response));
 }