Пример #1
0
        public virtual async Task <ArmOperation <ComponentVersionResource> > UpdateAsync(WaitUntil waitUntil, ComponentVersionData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _componentVersionClientDiagnostics.CreateScope("ComponentVersionResource.Update");
            scope.Start();
            try
            {
                var response = await _componentVersionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation <ComponentVersionResource>(Response.FromValue(new ComponentVersionResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }