public PSDataFactory UpdatePSDataFactory(UpdatePSDataFactoryParameters parameters)
        {
            var updateParams = new FactoryUpdateParameters(parameters.Tags?.ToDictionary());

            return(new PSDataFactory(
                       this.DataFactoryManagementClient.Factories.Update(
                           parameters.ResourceGroupName,
                           parameters.DataFactoryName,
                           updateParams),
                       parameters.ResourceGroupName));
        }
예제 #2
0
 /// <summary>
 /// Updates a factory.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='factoryName'>
 /// The factory name.
 /// </param>
 /// <param name='factoryUpdateParameters'>
 /// The parameters for updating a factory.
 /// </param>
 public static Factory Update(this IFactoriesOperations operations, string resourceGroupName, string factoryName, FactoryUpdateParameters factoryUpdateParameters)
 {
     return(operations.UpdateAsync(resourceGroupName, factoryName, factoryUpdateParameters).GetAwaiter().GetResult());
 }
예제 #3
0
 /// <summary>
 /// Updates a factory.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// The resource group name.
 /// </param>
 /// <param name='factoryName'>
 /// The factory name.
 /// </param>
 /// <param name='factoryUpdateParameters'>
 /// The parameters for updating a factory.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <Factory> UpdateAsync(this IFactoriesOperations operations, string resourceGroupName, string factoryName, FactoryUpdateParameters factoryUpdateParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, factoryName, factoryUpdateParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        internal static async Task Update(DataFactoryManagementClient client, string resourceGroupName, string dataFactoryName, Factory expectedFactory, FactoryUpdateParameters tags)
        {
            AzureOperationResponse <Factory> updateResponse = await client.Factories.UpdateWithHttpMessagesAsync(resourceGroupName, dataFactoryName, tags);

            ValidateFactory(updateResponse.Body, dataFactoryName);
            Assert.Equal(HttpStatusCode.OK, updateResponse.Response.StatusCode);

            AzureOperationResponse <Factory> getResponse = await client.Factories.GetWithHttpMessagesAsync(resourceGroupName, dataFactoryName);

            ValidateFactory(getResponse.Body, dataFactoryName);
            Assert.Equal(HttpStatusCode.OK, getResponse.Response.StatusCode);

            AzureOperationResponse <IPage <Factory> > listByResourceGroupResponse = await client.Factories.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName);

            ValidateFactory(listByResourceGroupResponse.Body.First(), dataFactoryName);
            Assert.Equal(HttpStatusCode.OK, listByResourceGroupResponse.Response.StatusCode);

            AzureOperationResponse <IPage <Factory> > listResponse = await client.Factories.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName);

            ValidateFactory(listResponse.Body.First(), dataFactoryName);
            Assert.Equal(HttpStatusCode.OK, listResponse.Response.StatusCode);
        }