/// <summary>
 /// Get files in a project
 /// </summary>
 /// <remarks>
 /// The project resource is a nested resource representing a stored migration
 /// project. This method returns a list of files owned by a project resource.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ProjectFile> > ListAsync(this IFilesOperations operations, string groupName, string serviceName, string projectName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(groupName, serviceName, projectName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Update a file
 /// </summary>
 /// <remarks>
 /// This method updates an existing file.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='parameters'>
 /// Information about the file
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 /// <param name='fileName'>
 /// Name of the File
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ProjectFile> UpdateAsync(this IFilesOperations operations, ProjectFile parameters, string groupName, string serviceName, string projectName, string fileName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(parameters, groupName, serviceName, projectName, fileName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get files in a project
 /// </summary>
 /// <remarks>
 /// The project resource is a nested resource representing a stored migration
 /// project. This method returns a list of files owned by a project resource.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <ProjectFile> > ListNextAsync(this IFilesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Request information for reading and writing file content.
 /// </summary>
 /// <remarks>
 /// This method is used for requesting information for reading and writing the
 /// file content.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 /// <param name='fileName'>
 /// Name of the File
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <FileStorageInfo> ReadWriteAsync(this IFilesOperations operations, string groupName, string serviceName, string projectName, string fileName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ReadWriteWithHttpMessagesAsync(groupName, serviceName, projectName, fileName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Instantiates new ExportContext instance (only for testing/integration)
 /// </summary>
 public ExportContext(Assembly[] sourceAssemblies, IFilesOperations fileOperationsServiceOverride = null)
 {
     FileOperations         = fileOperationsServiceOverride ?? new FilesOperations();
     FileOperations.Context = this;
     Global           = new GlobalParameters(sourceAssemblies);
     SourceAssemblies = sourceAssemblies;
     Location         = new Location(this);
     Project          = new ProjectBlueprint();
 }
Exemplo n.º 6
0
 /// <summary>
 /// Instantiates new ExportContext instance (only for testing/integration)
 /// </summary>
 public ExportContext(IFilesOperations fileOperationsServiceOverride = null)
 {
     Location        = new Location();
     Warnings        = new List <RtWarning>();
     _fileOperations = fileOperationsServiceOverride;
     if (_fileOperations == null)
     {
         _fileOperations = new FilesOperations();
     }
     _fileOperations.Context = this;
     Global = new GlobalParameters();
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     ResourceSkus   = new ResourceSkusOperations(this);
     Services       = new ServicesOperations(this);
     Tasks          = new TasksOperations(this);
     ServiceTasks   = new ServiceTasksOperations(this);
     Projects       = new ProjectsOperations(this);
     Usages         = new UsagesOperations(this);
     Operations     = new Operations(this);
     Files          = new FilesOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2018-07-15-preview";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <CommandProperties>("commandType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <CommandProperties>("commandType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateSsisTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateSsisTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ConnectionInfo>("type"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ConnectionInfo>("type"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MongoDbProgress>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MongoDbProgress>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateOracleAzureDbPostgreSqlSyncTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateOracleAzureDbPostgreSqlSyncTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateMySqlAzureDbForMySqlSyncTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateMySqlAzureDbForMySqlSyncTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateSqlServerSqlDbSyncTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateSqlServerSqlDbSyncTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateSqlServerSqlDbTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateSqlServerSqlDbTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateSqlServerSqlMISyncTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateSqlServerSqlMISyncTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateSqlServerSqlMITaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateSqlServerSqlMITaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ConnectToSourceSqlServerTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ConnectToSourceSqlServerTaskOutput>("resultType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ProjectTaskProperties>("taskType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ProjectTaskProperties>("taskType"));
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <MigrateSchemaSqlServerSqlDbTaskOutput>("resultType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <MigrateSchemaSqlServerSqlDbTaskOutput>("resultType"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new TransformationJsonConverter());
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// Get files in a project
 /// </summary>
 /// <remarks>
 /// The project resource is a nested resource representing a stored migration
 /// project. This method returns a list of files owned by a project resource.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='nextPageLink'>
 /// The NextLink from the previous successful call to List operation.
 /// </param>
 public static IPage <ProjectFile> ListNext(this IFilesOperations operations, string nextPageLink)
 {
     return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get files in a project
 /// </summary>
 /// <remarks>
 /// The project resource is a nested resource representing a stored migration
 /// project. This method returns a list of files owned by a project resource.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 public static IPage <ProjectFile> List(this IFilesOperations operations, string groupName, string serviceName, string projectName)
 {
     return(operations.ListAsync(groupName, serviceName, projectName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Request information for reading and writing file content.
 /// </summary>
 /// <remarks>
 /// This method is used for requesting information for reading and writing the
 /// file content.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 /// <param name='fileName'>
 /// Name of the File
 /// </param>
 public static FileStorageInfo ReadWrite(this IFilesOperations operations, string groupName, string serviceName, string projectName, string fileName)
 {
     return(operations.ReadWriteAsync(groupName, serviceName, projectName, fileName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Update a file
 /// </summary>
 /// <remarks>
 /// This method updates an existing file.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='parameters'>
 /// Information about the file
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 /// <param name='fileName'>
 /// Name of the File
 /// </param>
 public static ProjectFile Update(this IFilesOperations operations, ProjectFile parameters, string groupName, string serviceName, string projectName, string fileName)
 {
     return(operations.UpdateAsync(parameters, groupName, serviceName, projectName, fileName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete file
 /// </summary>
 /// <remarks>
 /// This method deletes a file.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 /// <param name='fileName'>
 /// Name of the File
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task DeleteAsync(this IFilesOperations operations, string groupName, string serviceName, string projectName, string fileName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.DeleteWithHttpMessagesAsync(groupName, serviceName, projectName, fileName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Delete file
 /// </summary>
 /// <remarks>
 /// This method deletes a file.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='groupName'>
 /// Name of the resource group
 /// </param>
 /// <param name='serviceName'>
 /// Name of the service
 /// </param>
 /// <param name='projectName'>
 /// Name of the project
 /// </param>
 /// <param name='fileName'>
 /// Name of the File
 /// </param>
 public static void Delete(this IFilesOperations operations, string groupName, string serviceName, string projectName, string fileName)
 {
     operations.DeleteAsync(groupName, serviceName, projectName, fileName).GetAwaiter().GetResult();
 }