Example #1
0
        public virtual async Task <Response <DatabaseAccountSqlDatabaseThroughputSettingResource> > GetAsync(CancellationToken cancellationToken = default)
        {
            using var scope = _databaseAccountSqlDatabaseThroughputSettingSqlResourcesClientDiagnostics.CreateScope("DatabaseAccountSqlDatabaseThroughputSettingResource.Get");
            scope.Start();
            try
            {
                var response = await _databaseAccountSqlDatabaseThroughputSettingSqlResourcesRestClient.GetSqlDatabaseThroughputAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false);

                if (response.Value == null)
                {
                    throw new RequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new DatabaseAccountSqlDatabaseThroughputSettingResource(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }