Class MigrationManifestSerializer
Provides functionality to serialize and deserialize migration manifests in JSON format.
Namespace: Tableau.Migration.Engine.Manifest
Assembly: Tableau.Migration.dll
Syntax
public class MigrationManifestSerializer
Constructors
MigrationManifestSerializer(IFileSystem)
Initializes a new instance of the MigrationManifestSerializer class.
Declaration
public MigrationManifestSerializer(IFileSystem fileSystem)
Parameters
Type | Name | Description |
---|---|---|
IFileSystem | fileSystem |
Fields
SupportedManifestVersion
This is the current MigrationManifest.ManifestVersion that this serializer supports.
Declaration
public const uint SupportedManifestVersion = 4
Field Value
Type | Description |
---|---|
uint |
Methods
LoadAsync(Stream, CancellationToken, JsonSerializerOptions?)
Loads a manifest from JSON format.
Declaration
public Task<MigrationManifest?> LoadAsync(Stream stream, CancellationToken cancel, JsonSerializerOptions? jsonOptions = null)
Parameters
Type | Name | Description |
---|---|---|
Stream | stream | The stream to load the manifest from. |
CancellationToken | cancel | The cancellation token to obey. |
JsonSerializerOptions | jsonOptions | Optional JSON options to use. |
Returns
Type | Description |
---|---|
Task<MigrationManifest> | The loaded MigrationManifest, or null if the manifest could not be loaded. |
LoadAsync(string, CancellationToken, JsonSerializerOptions?)
Loads a manifest from JSON format.
Declaration
public Task<MigrationManifest?> LoadAsync(string path, CancellationToken cancel, JsonSerializerOptions? jsonOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | path | The file path to load the manifest from. |
CancellationToken | cancel | The cancellation token to obey. |
JsonSerializerOptions | jsonOptions | Optional JSON options to use. |
Returns
Type | Description |
---|---|
Task<MigrationManifest> | The loaded MigrationManifest, or null if the manifest could not be loaded. |
SaveAsync(IMigrationManifest, Stream, CancellationToken, JsonSerializerOptions?)
Saves a manifest in JSON format.
Declaration
public Task SaveAsync(IMigrationManifest manifest, Stream stream, CancellationToken cancel, JsonSerializerOptions? jsonOptions = null)
Parameters
Type | Name | Description |
---|---|---|
IMigrationManifest | manifest | The manifest to save. |
Stream | stream | The stream to save the manifest to. |
CancellationToken | cancel | The cancellation token to obey. |
JsonSerializerOptions | jsonOptions | Optional JSON options to use. |
Returns
Type | Description |
---|---|
Task |
Remarks
This async function does not take a cancellation token. This is because the saving should happen, no matter what the status of the cancellation token is. Otherwise the manifest is not saved if the migration is cancelled.
SaveAsync(IMigrationManifest, string, JsonSerializerOptions?)
Saves a manifest in JSON format.
Declaration
public Task SaveAsync(IMigrationManifest manifest, string path, JsonSerializerOptions? jsonOptions = null)
Parameters
Type | Name | Description |
---|---|---|
IMigrationManifest | manifest | The manifest to save. |
string | path | The file path to save the manifest to. |
JsonSerializerOptions | jsonOptions | Optional JSON options to use. |
Returns
Type | Description |
---|---|
Task |
Remarks
This async function does not take a cancellation token. This is because the saving should happen, no matter what the status of the cancellation token is. Otherwise the manifest is not saved if the migration is cancelled.
SaveAsync(IMigrationManifest, string, CancellationToken, JsonSerializerOptions?)
Saves a manifest in JSON format.
Declaration
public Task SaveAsync(IMigrationManifest manifest, string path, CancellationToken cancel, JsonSerializerOptions? jsonOptions = null)
Parameters
Type | Name | Description |
---|---|---|
IMigrationManifest | manifest | The manifest to save. |
string | path | The file path to save the manifest to. |
CancellationToken | cancel | The cancellation token to obey. |
JsonSerializerOptions | jsonOptions | Optional JSON options to use. |
Returns
Type | Description |
---|---|
Task |
Remarks
This async function does not take a cancellation token. This is because the saving should happen, no matter what the status of the cancellation token is. Otherwise the manifest is not saved if the migration is cancelled.