Esempio n. 1
0
 /// <summary>
 /// Create or update a data factory.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.DataFactories.Core.IDataFactoryOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data factory.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update a data
 /// factory.
 /// </param>
 /// <returns>
 /// The create or update data factory operation response.
 /// </returns>
 public static Task <DataFactoryCreateOrUpdateResponse> BeginCreateOrUpdateAsync(
     this IDataFactoryOperations operations,
     string resourceGroupName,
     DataFactoryCreateOrUpdateParameters parameters)
 {
     return(operations.BeginCreateOrUpdateAsync(resourceGroupName, parameters, CancellationToken.None));
 }
Esempio n. 2
0
 public async Task <DataFactoryCreateOrUpdateResponse> CreateOrUpdateAsync(
     string resourceGroupName,
     DataFactoryCreateOrUpdateParameters parameters,
     CancellationToken cancellationToken)
 {
     return(await
            this.Client.InternalClient.DataFactories.CreateOrUpdateAsync(
                resourceGroupName,
                parameters,
                cancellationToken));
 }
Esempio n. 3
0
 /// <summary>
 /// Create or update a data factory.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.DataFactories.Core.IDataFactoryOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data factory.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update a data
 /// factory.
 /// </param>
 /// <returns>
 /// The create or update data factory operation response.
 /// </returns>
 public static DataFactoryCreateOrUpdateResponse CreateOrUpdate(
     this IDataFactoryOperations operations,
     string resourceGroupName,
     DataFactoryCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew(
                s => ((IDataFactoryOperations)s).CreateOrUpdateAsync(resourceGroupName, parameters),
                operations,
                CancellationToken.None,
                TaskCreationOptions.None,
                TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Esempio n. 4
0
        /// <summary>
        /// Serializes the given <see cref="DataFactory" /> into JSON, by mocking a create request to
        /// exercise the client's serialization logic.
        /// </summary>
        /// <param name="item">The object to serialize.</param>
        /// <returns></returns>
        internal static string SerializeDataFactoryToJson(DataFactory item)
        {
            var createParams = new DataFactoryCreateOrUpdateParameters()
            {
                DataFactory = item
            };

            var    handler           = new MockResourceProviderDelegatingHandler();
            var    client            = GetFakeClient(handler);
            string resourceGroupName = Guid.NewGuid().ToString("D");

            client.DataFactories.BeginCreateOrUpdate(resourceGroupName, createParams);
            return(handler.Json);
        }