Class TableauApiEndpointBase
IMigrationEndpoint implementation that uses Tableau Server/Cloud APIs.
Namespace: Tableau.Migration.Engine.Endpoints
Assembly: Tableau.Migration.dll
Syntax
public abstract class TableauApiEndpointBase : IMigrationApiEndpoint, IMigrationEndpoint, IAsyncDisposable
Constructors
TableauApiEndpointBase(IServiceScopeFactory, ITableauApiEndpointConfiguration, IContentReferenceFinderFactory, IContentFileStore, ISharedResourcesLocalizer)
Creates a new TableauApiEndpointBase object.
Declaration
public TableauApiEndpointBase(IServiceScopeFactory serviceScopeFactory, ITableauApiEndpointConfiguration config, IContentReferenceFinderFactory finderFactory, IContentFileStore fileStore, ISharedResourcesLocalizer localizer)
Parameters
Type | Name | Description |
---|---|---|
IServiceScopeFactory | serviceScopeFactory | A service scope factory to define an API client scope with. |
ITableauApiEndpointConfiguration | config | The configuration options for connecting to the endpoint APIs. |
IContentReferenceFinderFactory | finderFactory | The content finder factory to supply to the API client. |
IContentFileStore | fileStore | The file store to use. |
ISharedResourcesLocalizer | localizer | A string localizer. |
Fields
EndpointScope
The per-endpoint dependency injection scope.
Declaration
protected readonly AsyncServiceScope EndpointScope
Field Value
Type | Description |
---|---|
AsyncServiceScope |
ServerApi
The server-level API client.
Declaration
protected readonly IApiClient ServerApi
Field Value
Type | Description |
---|---|
IApiClient |
Properties
SiteApi
Gets the site-level API client.
Declaration
public ISitesApiClient SiteApi { get; }
Property Value
Type | Description |
---|---|
ISitesApiClient |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | If the endpoint has not been initialized or site sign in failed. |
Methods
DisposeAsync()
Disposes the result's value.
Declaration
public ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
ValueTask |
GetContentClient<TContentClient, TContent>()
Gets a content client for the given content type.
Declaration
public TContentClient GetContentClient<TContentClient, TContent>() where TContentClient : IContentClient<TContent>
Returns
Type | Description |
---|---|
TContentClient | The content client. |
Type Parameters
Name | Description |
---|---|
TContentClient | The content client type. |
TContent | The content type. |
GetCurrentSiteAsync(CancellationToken)
Gets the current site information.
Declaration
public Task<IResult<ISite>> GetCurrentSiteAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IResult<ISite>> | An awaitable task with the site result. |
GetEndpointCache<TCache, TKey, TValue>()
Gets an migration cache that belongs to the endpoint scope.
Declaration
public TCache GetEndpointCache<TCache, TKey, TValue>() where TCache : IMigrationCache<TKey, TValue> where TKey : notnull where TValue : class
Returns
Type | Description |
---|---|
TCache | The cache. |
Type Parameters
Name | Description |
---|---|
TCache | The cache type. |
TKey | The cache key type. |
TValue | The cache value type. |
GetPager<TContent>(int)
Gets a pager to list all the content the user has access to.
Declaration
public IPager<TContent> GetPager<TContent>(int pageSize)
Parameters
Type | Name | Description |
---|---|---|
int | pageSize | The page size to use. |
Returns
Type | Description |
---|---|
IPager<TContent> | A pager to list content with. |
Type Parameters
Name | Description |
---|---|
TContent | The content type. |
GetPermissionsAsync(Type, IContentReference, CancellationToken)
Declaration
public Task<IResult<IPermissions>> GetPermissionsAsync(Type type, IContentReference contentItem, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
Type | type | |
IContentReference | contentItem | |
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<IResult<IPermissions>> |
GetPermissionsAsync<TContent>(IContentReference, CancellationToken)
Declaration
public Task<IResult<IPermissions>> GetPermissionsAsync<TContent>(IContentReference contentItem, CancellationToken cancel) where TContent : IPermissionsContent
Parameters
Type | Name | Description |
---|---|---|
IContentReference | contentItem | |
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<IResult<IPermissions>> |
Type Parameters
Name | Description |
---|---|
TContent |
GetSessionAsync(CancellationToken)
Gets the current server session information.
Declaration
public Task<IResult<IServerSession>> GetSessionAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IResult<IServerSession>> | An awaitable task with the server session result. |
InitializeAsync(CancellationToken)
Performs pre-migration initialization.
Declaration
public Task<IResult> InitializeAsync(CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IResult> | An awaitable task with the initialization result. |
ListConnectionsAsync<TContent>(Guid, CancellationToken)
Declaration
public Task<IResult<ImmutableList<IConnection>>> ListConnectionsAsync<TContent>(Guid contentItemId, CancellationToken cancel) where TContent : IWithConnections
Parameters
Type | Name | Description |
---|---|---|
Guid | contentItemId | |
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<IResult<ImmutableList<IConnection>>> |
Type Parameters
Name | Description |
---|---|
TContent |
RetrieveKeychainsAsync<TContent>(Guid, IDestinationSiteInfo, CancellationToken)
Declaration
public Task<IResult<IEmbeddedCredentialKeychainResult>> RetrieveKeychainsAsync<TContent>(Guid contentItemId, IDestinationSiteInfo destinationSiteInfo, CancellationToken cancel) where TContent : IWithEmbeddedCredentials
Parameters
Type | Name | Description |
---|---|---|
Guid | contentItemId | |
IDestinationSiteInfo | destinationSiteInfo | |
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<IResult<IEmbeddedCredentialKeychainResult>> |
Type Parameters
Name | Description |
---|---|
TContent |
RetrieveUserSavedCredentialsAsync(Guid, IDestinationSiteInfo, CancellationToken)
Declaration
public Task<IResult<IEmbeddedCredentialKeychainResult>> RetrieveUserSavedCredentialsAsync(Guid userId, IDestinationSiteInfo destinationSiteInfo, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
Guid | userId | |
IDestinationSiteInfo | destinationSiteInfo | |
CancellationToken | cancel |
Returns
Type | Description |
---|---|
Task<IResult<IEmbeddedCredentialKeychainResult>> |