public virtual ApiFileClientRequestModel MapClientResponseToRequest(
            ApiFileClientResponseModel response)
        {
            var request = new ApiFileClientRequestModel();

            request.SetProperties(
                response.BucketId,
                response.DateCreated,
                response.Description,
                response.Expiration,
                response.Extension,
                response.ExternalId,
                response.FileSizeInByte,
                response.FileTypeId,
                response.Location,
                response.PrivateKey,
                response.PublicKey);
            return(request);
        }
示例#2
0
        public virtual async Task <UpdateResponse <ApiFileClientResponseModel> > FileUpdateAsync(int id, ApiFileClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Files/{id}", item, cancellationToken).ConfigureAwait(false);

            this.HandleResponseCode(httpResponse);
            return(JsonConvert.DeserializeObject <UpdateResponse <ApiFileClientResponseModel> >(httpResponse.Content.ContentToString()));
        }