コード例 #1
0
 internal AseV3NetworkingConfiguration(ArmResource options, AseV3NetworkingConfigurationData resource) : base(options, resource.Id)
 {
     HasData            = true;
     _data              = resource;
     Parent             = options;
     _clientDiagnostics = new ClientDiagnostics(ClientOptions);
     _appServiceEnvironmentsRestClient = new AppServiceEnvironmentsRestOperations(_clientDiagnostics, Pipeline, ClientOptions, BaseUri);
 }
 internal AseV3NetworkingConfigurationResource(ArmClient client, AseV3NetworkingConfigurationData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }
        public virtual ArmOperation <AseV3NetworkingConfigurationResource> CreateOrUpdate(WaitUntil waitUntil, AseV3NetworkingConfigurationData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _aseV3NetworkingConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("AseV3NetworkingConfigurationResource.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _aseV3NetworkingConfigurationAppServiceEnvironmentsRestClient.UpdateAseNetworkingConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken);
                var operation = new AppServiceArmOperation <AseV3NetworkingConfigurationResource>(Response.FromValue(new AseV3NetworkingConfigurationResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
コード例 #4
0
 internal AseV3NetworkingConfiguration(ArmClient armClient, AseV3NetworkingConfigurationData data) : this(armClient, data.Id)
 {
     HasData = true;
     _data   = data;
 }
コード例 #5
0
        public virtual AseV3NetworkingConfigurationCreateOrUpdateOperation CreateOrUpdate(bool waitForCompletion, AseV3NetworkingConfigurationData aseNetworkingConfiguration, CancellationToken cancellationToken = default)
        {
            if (aseNetworkingConfiguration == null)
            {
                throw new ArgumentNullException(nameof(aseNetworkingConfiguration));
            }

            using var scope = _aseV3NetworkingConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("AseV3NetworkingConfiguration.CreateOrUpdate");
            scope.Start();
            try
            {
                var response  = _aseV3NetworkingConfigurationAppServiceEnvironmentsRestClient.UpdateAseNetworkingConfiguration(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aseNetworkingConfiguration, cancellationToken);
                var operation = new AseV3NetworkingConfigurationCreateOrUpdateOperation(ArmClient, response);
                if (waitForCompletion)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
コード例 #6
0
        public async virtual Task <AppServiceEnvironmentUpdateAseNetworkingConfigurationOperation> CreateOrUpdateAsync(AseV3NetworkingConfigurationData aseNetworkingConfiguration, bool waitForCompletion = true, CancellationToken cancellationToken = default)
        {
            if (aseNetworkingConfiguration == null)
            {
                throw new ArgumentNullException(nameof(aseNetworkingConfiguration));
            }

            using var scope = _clientDiagnostics.CreateScope("AseV3NetworkingConfiguration.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _appServiceEnvironmentsRestClient.UpdateAseNetworkingConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aseNetworkingConfiguration, cancellationToken).ConfigureAwait(false);

                var operation = new AppServiceEnvironmentUpdateAseNetworkingConfigurationOperation(this, response);
                if (waitForCompletion)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
コード例 #7
0
        public async virtual Task <ArmOperation <AseV3NetworkingConfiguration> > CreateOrUpdateAsync(bool waitForCompletion, AseV3NetworkingConfigurationData aseNetworkingConfiguration, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(aseNetworkingConfiguration, nameof(aseNetworkingConfiguration));

            using var scope = _aseV3NetworkingConfigurationAppServiceEnvironmentsClientDiagnostics.CreateScope("AseV3NetworkingConfiguration.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _aseV3NetworkingConfigurationAppServiceEnvironmentsRestClient.UpdateAseNetworkingConfigurationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aseNetworkingConfiguration, cancellationToken).ConfigureAwait(false);

                var operation = new AppServiceArmOperation <AseV3NetworkingConfiguration>(Response.FromValue(new AseV3NetworkingConfiguration(Client, response), response.GetRawResponse()));
                if (waitForCompletion)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }