Ejemplo n.º 1
0
        public async virtual Task <Response <DeploymentScript> > UpdateAsync(IDictionary <string, string> tags = null, CancellationToken cancellationToken = default)
        {
            using var scope = _deploymentScriptClientDiagnostics.CreateScope("DeploymentScript.Update");
            scope.Start();
            try
            {
                var response = await _deploymentScriptRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tags, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new DeploymentScript(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
        public virtual async Task <Response <ArmDeploymentScriptResource> > UpdateAsync(ArmDeploymentScriptPatch patch, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(patch, nameof(patch));

            using var scope = _armDeploymentScriptDeploymentScriptsClientDiagnostics.CreateScope("ArmDeploymentScriptResource.Update");
            scope.Start();
            try
            {
                var response = await _armDeploymentScriptDeploymentScriptsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new ArmDeploymentScriptResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Ejemplo n.º 3
0
        public virtual async Task <Response <DeploymentScript> > UpdateAsync(PatchableDeploymentScriptData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _deploymentScriptClientDiagnostics.CreateScope("DeploymentScript.Update");
            scope.Start();
            try
            {
                var response = await _deploymentScriptRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new DeploymentScript(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }