Esempio n. 1
0
 internal DataVersionBaseResource(ArmClient client, DataVersionBaseData data) : this(client, data.Id)
 {
     HasData = true;
     _data   = data;
 }
Esempio n. 2
0
        public virtual async Task <ArmOperation <DataVersionBaseResource> > CreateOrUpdateAsync(WaitUntil waitUntil, string version, DataVersionBaseData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNullOrEmpty(version, nameof(version));
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _dataVersionBaseDataVersionsClientDiagnostics.CreateScope("DataVersionBaseCollection.CreateOrUpdate");
            scope.Start();
            try
            {
                var response = await _dataVersionBaseDataVersionsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, version, data, cancellationToken).ConfigureAwait(false);

                var operation = new MachineLearningArmOperation <DataVersionBaseResource>(Response.FromValue(new DataVersionBaseResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Esempio n. 3
0
        public virtual ArmOperation <DataVersionBaseResource> Update(WaitUntil waitUntil, DataVersionBaseData data, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(data, nameof(data));

            using var scope = _dataVersionBaseDataVersionsClientDiagnostics.CreateScope("DataVersionBaseResource.Update");
            scope.Start();
            try
            {
                var response  = _dataVersionBaseDataVersionsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken);
                var operation = new MachineLearningArmOperation <DataVersionBaseResource>(Response.FromValue(new DataVersionBaseResource(Client, response), response.GetRawResponse()));
                if (waitUntil == WaitUntil.Completed)
                {
                    operation.WaitForCompletion(cancellationToken);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }