Class TransferClient
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Syntax
[GeneratedCode("NSwag", "13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))")]
[Obsolete("These methods are deprecated and will be removed in future release. Please use Ingest methods for new projects and consider switching existing code to use Ingest methods as well.")]
public class TransferClient : ClientBase, ITransferClient
Constructors
TransferClient(IBusinessProcessClient, IPictureparkServiceSettings, HttpClient)
Declaration
public TransferClient(IBusinessProcessClient businessProcessClient, IPictureparkServiceSettings settings, HttpClient httpClient)
Parameters
IBusinessProcessClient businessProcessClient |
IPictureparkServiceSettings settings |
HttpClient httpClient |
TransferClient(IPictureparkServiceSettings, HttpClient)
Declaration
public TransferClient(IPictureparkServiceSettings configuration, HttpClient httpClient)
Parameters
IPictureparkServiceSettings configuration |
HttpClient httpClient |
Properties
JsonSerializerSettings
Declaration
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
JsonSerializerSettings |
ReadResponseAsString
Methods
CancelAsync(string, CancellationToken)
Cancel transfer
Declaration
[Obsolete]
public virtual Task CancelAsync(string id, CancellationToken cancellationToken = default)
Parameters
string
id
ID of transfer. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task
OK |
Implements
Remarks
Requests cancellation of transfer.
Note: Transfers can only be cancelled when state is UploadInProgress.
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
CancelTransferAsync(string, CancellationToken)
Cancel transfer
Declaration
public Task CancelTransferAsync(string id, CancellationToken cancellationToken = default)
Parameters
string
id
ID of transfer. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task
OK |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkException
Internal server error |
CreateAndWaitForCompletionAsync(CreateTransferRequest, TimeSpan?, CancellationToken)
Creates a transfer and waits for its completion.
Declaration
public Task<CreateTransferResult> CreateAndWaitForCompletionAsync(CreateTransferRequest request, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
CreateTransferRequest
request
The create request. |
TimeSpan?
timeout
The timeout to wait for completion. |
CancellationToken
cancellationToken
The cancellation token. |
Returns
Task<CreateTransferResult>
The transfer. |
Implements
CreateAndWaitForCompletionAsync(string, IEnumerable<FileLocations>, TimeSpan?, CancellationToken, UploadOptions)
Creates a transfer and waits for its completion.
Declaration
public Task<CreateTransferResult> CreateAndWaitForCompletionAsync(string transferName, IEnumerable<FileLocations> files, TimeSpan? timeout = null, CancellationToken cancellationToken = default, UploadOptions uploadOptions = null)
Parameters
string
transferName
The name of the transfer. |
IEnumerable<FileLocations>
files
The file names of the transfer. |
TimeSpan?
timeout
The timeout to wait for completion. |
CancellationToken
cancellationToken
The cancellation token. |
UploadOptions
uploadOptions
The upload options. |
Returns
Task<CreateTransferResult>
The transfer. |
Implements
CreateAsync(CreateTransferRequest, CancellationToken)
Create transfer
Declaration
[Obsolete]
public virtual Task<Transfer> CreateAsync(CreateTransferRequest request, CancellationToken cancellationToken = default)
Parameters
CreateTransferRequest
request
The create transfer request |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Transfer>
Transfer |
Implements
Remarks
For transfers of type FileUpload or FileUploadAutoImport, after creating the transfer, wait for the returned BusinessProcess to hit the "Created" state before attempting to upload files.
Exceptions
ApiException
A server side error occurred. |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
PictureparkValidationException
Validation exception |
MaximumTransferSizeException
A server side error occurred. |
DeleteAsync(string, CancellationToken)
Delete transfer
Declaration
[Obsolete]
public virtual Task DeleteAsync(string id, CancellationToken cancellationToken = default)
Parameters
string
id
ID of transfer. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task
OK |
Implements
Remarks
A transfer cannot be deleted if it's currently in the UploadInProgress or ImportInProgress state.
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
DeleteFilesAsync(FileTransferDeleteRequest, CancellationToken)
Delete files
Declaration
[Obsolete]
public virtual Task DeleteFilesAsync(FileTransferDeleteRequest request, CancellationToken cancellationToken = default)
Parameters
FileTransferDeleteRequest
request
The file transfer delete request |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
GetAsync(string, CancellationToken)
Get transfer details
Declaration
[Obsolete]
public virtual Task<TransferDetail> GetAsync(string id, CancellationToken cancellationToken = default)
Parameters
string
id
ID of transfer. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<TransferDetail>
TransferDetail |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
GetBlacklistAsync(CancellationToken)
Get blacklist
Declaration
[Obsolete]
public virtual Task<Blacklist> GetBlacklistAsync(CancellationToken cancellationToken = default)
Parameters
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Blacklist>
Blacklist |
Implements
Remarks
The blacklist is a list of patterns that a filename must not match.
A filename matching an item on the blacklist will be skipped during uploading.
The client is responsibly for matching uploaded files against the blacklist
when creating the transfer. Otherwise, during transfer creation some items might get skipped
causing issues when uploading later on.
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
GetFileAsync(string, CancellationToken)
Get file
Declaration
[Obsolete]
public virtual Task<FileTransferDetail> GetFileAsync(string id, CancellationToken cancellationToken = default)
Parameters
string
id
ID of file transfer. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<FileTransferDetail>
FileTransferDetail |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
ImportAndWaitForCompletionAsync(Transfer, ImportTransferRequest, TimeSpan?, CancellationToken)
Transfers the uploaded files and waits for its completions.
Declaration
public Task ImportAndWaitForCompletionAsync(Transfer transfer, ImportTransferRequest createRequest, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
Transfer
transfer
The transfer. |
ImportTransferRequest
createRequest
The create request. |
TimeSpan?
timeout
The timeout to wait for completion. |
CancellationToken
cancellationToken
The cancellation token. |
Returns
Task
The task. |
Implements
ImportAsync(string, ImportTransferRequest, CancellationToken)
Import transfer
Declaration
[Obsolete]
public virtual Task<Transfer> ImportAsync(string id, ImportTransferRequest request, CancellationToken cancellationToken = default)
Parameters
string
id
ID of transfer. |
ImportTransferRequest
request
The ImportTransfer request. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Transfer>
Transfer |
Implements
Remarks
This triggers the import of a Transfer, creating Contents. All items in the Transfer will be enqueued for rendering.
Wait for completion on the Business process ID that is returned to wait for import completion.
Note: Before attempting to import a Transfer, the transfer has to be in the TransferReady state.
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
ImportTransferAsync(string, ImportTransferRequest, CancellationToken)
Import transfer
Declaration
public Task<Transfer> ImportTransferAsync(string id, ImportTransferRequest request, CancellationToken cancellationToken = default)
Parameters
string
id
ID of transfer. |
ImportTransferRequest
request
The ImportTransfer request. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Transfer>
Transfer |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkException
Internal server error |
PartialImportAsync(string, ImportTransferPartialRequest, CancellationToken)
Import transfer partially
Declaration
[Obsolete]
public virtual Task<Transfer> PartialImportAsync(string id, ImportTransferPartialRequest request, CancellationToken cancellationToken = default)
Parameters
string
id
ID of transfer. |
ImportTransferPartialRequest
request
The ImportTransferPartial request. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<Transfer>
Transfer |
Implements
Remarks
This triggers the import of selected items in a Transfer, creating contents. All imported items will be enqueued for rendering.
Wait for completion on the Business process ID that is returned to wait for import completion.
Transfer will transition to state ImportDone if no files of the transfer remain for import.
Transfer will transition to state TransferReady if any files of the transfer remain for import.
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
Declaration
protected virtual Task<TransferClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
HttpResponseMessage response |
IReadOnlyDictionary<string, IEnumerable<string>> headers |
CancellationToken cancellationToken |
Returns
Task<TransferClient.ObjectResponseResult<T>> |
Type Parameters
T |
SearchAsync(TransferSearchRequest, CancellationToken)
Search
Declaration
[Obsolete]
public virtual Task<TransferSearchResult> SearchAsync(TransferSearchRequest request, CancellationToken cancellationToken = default)
Parameters
TransferSearchRequest
request
The transfer search request |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<TransferSearchResult>
TransferSearchResult |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
SearchFilesAsync(FileTransferSearchRequest, CancellationToken)
Search for files
Declaration
[Obsolete]
public virtual Task<FileTransferSearchResult> SearchFilesAsync(FileTransferSearchRequest request, CancellationToken cancellationToken = default)
Parameters
FileTransferSearchRequest
request
The file transfer search request |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task<FileTransferSearchResult>
FileTransferSearchResult |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
SearchFilesByTransferIdAsync(string, int?)
Searches files of a given transfer ID.
Declaration
public Task<IReadOnlyCollection<FileTransfer>> SearchFilesByTransferIdAsync(string transferId, int? limit = null)
Parameters
string
transferId
The transfer ID. |
int?
limit
The maximum number of search results. Use null to retrieve all files in a transfer. |
Returns
Task<IReadOnlyCollection<FileTransfer>>
The result. |
Implements
UploadFileAsync(FileParameter, long, long, long, long, string, string, CancellationToken)
Upload file
Declaration
public Task UploadFileAsync(FileParameter formFile, long chunkNumber, long currentChunkSize, long totalSize, long totalChunks, string transferId, string requestId, CancellationToken cancellationToken = default)
Parameters
FileParameter
formFile
Information about chunk. |
long
chunkNumber
Information about chunk. |
long
currentChunkSize
Information about chunk. |
long
totalSize
Information about chunk. |
long
totalChunks
Information about chunk. |
string
transferId
ID of transfer. |
string
requestId
Identifier of file. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task
OK |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkException
Internal server error |
UploadFileAsync(long, long, long, long, string, string, FileParameter, CancellationToken)
Upload file
Declaration
public Task UploadFileAsync(long chunkNumber, long currentChunkSize, long totalSize, long totalChunks, string transferId, string requestId, FileParameter formFile = null, CancellationToken cancellationToken = default)
Parameters
long
chunkNumber
Information about chunk. |
long
currentChunkSize
Information about chunk. |
long
totalSize
Information about chunk. |
long
totalChunks
Information about chunk. |
string
transferId
ID of transfer. |
string
requestId
Identifier of file. |
FileParameter
formFile
Information about chunk. |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task
OK |
Implements
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkException
Internal server error |
UploadFileAsync(long, long, long, long, string, string, Stream, CancellationToken)
Upload file
Declaration
[Obsolete]
public virtual Task UploadFileAsync(long chunkNumber, long currentChunkSize, long totalSize, long totalChunks, string transferId, string requestId, Stream body = null, CancellationToken cancellationToken = default)
Parameters
long
chunkNumber
Information about chunk. |
long
currentChunkSize
Information about chunk. |
long
totalSize
Information about chunk. |
long
totalChunks
Information about chunk. |
string
transferId
ID of transfer. |
string
requestId
Identifier of file. |
Stream
body
Body |
CancellationToken
cancellationToken
A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Task
OK |
Implements
Remarks
Uploads the specified chunk data.
Use Content-Type: application/octet-stream
for uploading chunked data.
The chunk data should be contained in the body of your request.
To upload a file, it is recommended to use a single chunk that has the same size as the file. This is only possible if you're using
the octet-stream upload method. If you choose to use formdata upload or multiple chunks per file, the file must be chunked into
1MB-100MB chunks. The last chunk may be smaller than 1MB.
Exceptions
ApiException
A server side error occurred. |
PictureparkValidationException
Validation exception |
PictureparkForbiddenException
Forbidden |
PictureparkNotFoundException
Entity not found |
PictureparkConflictException
Version conflict |
PictureparkTooManyRequestsException
Too many requests |
PictureparkException
Internal server error |
UploadFilesAsync(Transfer, IEnumerable<FileLocations>, UploadOptions, TimeSpan?, CancellationToken)
Uploads multiple files from the filesystem.
Declaration
public Task UploadFilesAsync(Transfer transfer, IEnumerable<FileLocations> files, UploadOptions uploadOptions, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
Transfer
transfer
The existing transfer object. |
IEnumerable<FileLocations>
files
The file paths on the filesystem with optional overrides. |
UploadOptions
uploadOptions
The file upload options. |
TimeSpan?
timeout
The timeout to wait for completion. |
CancellationToken
cancellationToken
The cancellation token. |
Returns
Task
The created transfer object. |
Implements
UploadFilesAsync(string, IEnumerable<FileLocations>, UploadOptions, TimeSpan?, CancellationToken)
Uploads multiple files from the filesystem.
Declaration
public Task<CreateTransferResult> UploadFilesAsync(string transferName, IEnumerable<FileLocations> files, UploadOptions uploadOptions, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
Parameters
string
transferName
The name of the created transfer. |
IEnumerable<FileLocations>
files
The file paths on the filesystem with optional overrides. |
UploadOptions
uploadOptions
The file upload options. |
TimeSpan?
timeout
The timeout to wait for completion. |
CancellationToken
cancellationToken
The cancellation token. |
Returns
Task<CreateTransferResult>
The created transfer object. |