Class DeliveryRepositoriesClient
public class DeliveryRepositoriesClient
- Inheritance
-
DeliveryRepositoriesClient
- Inherited Members
Constructors
DeliveryRepositoriesClient(string, HttpClient)
public DeliveryRepositoriesClient(string baseUrl, HttpClient httpClient)
Parameters
baseUrlstringhttpClientHttpClient
Properties
BaseUrl
public string BaseUrl { get; set; }
Property Value
JsonSerializerSettings
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
- JsonSerializerSettings
ReadResponseAsString
public bool ReadResponseAsString { get; set; }
Property Value
Methods
DeleteAsync(long, CancellationToken)
Deletes the repository with the supplied id.
public virtual Task DeleteAsync(long repositoryId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongcancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
The delete Repository request was accepted.
Exceptions
- NfieldSdkException
A server side error occurred.
GetActivityLogsAsync(long, CancellationToken)
Gets repository activity logs.
Returns first 100. This list can be filtered, sorted and supports paging using standard OData syntax.
public virtual Task<ICollection<RepositoryActivityLogModel>> GetActivityLogsAsync(long repositoryId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<RepositoryActivityLogModel>>
Returns the activity logs
Exceptions
- NfieldSdkException
A server side error occurred.
GetAllAsync(CancellationToken)
Gets a list of repositories for the domain.
public virtual Task<ICollection<RepositoryModel>> GetAllAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<RepositoryModel>>
Returns the list of repositories
Exceptions
- NfieldSdkException
A server side error occurred.
GetAsync(long, CancellationToken)
Gets a repository for the domain by specified id.
public virtual Task<RepositoryModel> GetAsync(long repositoryId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<RepositoryModel>
Returns the repository
Exceptions
- NfieldSdkException
A server side error occurred.
GetCredentialsAsync(long, CancellationToken)
Returns the credentials (including server information) to connect to a repository database.
public virtual Task<RepositoryConnectionInfo> GetCredentialsAsync(long repositoryId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<RepositoryConnectionInfo>
Returns the repository credentials
Exceptions
- NfieldSdkException
A server side error occurred.
GetMetricsAsync(long, int, CancellationToken)
Gets repository metrics.
public virtual Task<RepositoryMetricsModel> GetMetricsAsync(long repositoryId, int interval, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
intervalintThe time interval type.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<RepositoryMetricsModel>
Returns the repository metrics
Exceptions
- NfieldSdkException
A server side error occurred.
GetSubscriptionsLogsAsync(long, CancellationToken)
Gets repository subscription logs.
Returns first 100. This list can be filtered, sorted and supports paging using standard OData syntax.
public virtual Task<ICollection<RepositorySubscriptionLogModel>> GetSubscriptionsLogsAsync(long repositoryId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task<ICollection<RepositorySubscriptionLogModel>>
Returns the repository subscription logs
Exceptions
- NfieldSdkException
A server side error occurred.
PostAsync(CreateRepositoryModel, CancellationToken)
Creates a new data repository based on the given data.
public virtual Task PostAsync(CreateRepositoryModel model, CancellationToken cancellationToken = default)
Parameters
modelCreateRepositoryModelThe repository info which will be used in the creation process
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
Returns a repository id
Exceptions
- NfieldSdkException
A server side error occurred.
PostRepositorySubscriptionAsync(long, CreateRepositorySubscriptionModel, CancellationToken)
Changes the subscription plan of a repository.
public virtual Task PostRepositorySubscriptionAsync(long repositoryId, CreateRepositorySubscriptionModel model, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository Id.
modelCreateRepositorySubscriptionModelThe details for the new Subscription.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
The selected subscription change has been accepted.
Exceptions
- NfieldSdkException
A server side error occurred.
PostSyncAsync(long, CancellationToken)
Triggers a repository sync.
public virtual Task PostSyncAsync(long repositoryId, CancellationToken cancellationToken = default)
Parameters
repositoryIdlongThe repository id.
cancellationTokenCancellationTokenA cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
The sync Repository request was triggered
Exceptions
- NfieldSdkException
A server side error occurred.
ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)
protected virtual Task<DeliveryRepositoriesClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)
Parameters
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T