< Summary

Class:Azure.ResourceManager.Storage.TableOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\TableOperations.cs
Covered lines:0
Uncovered lines:106
Coverable lines:106
Total lines:297
Line coverage:0% (0 of 106)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
CreateAsync()-0%100%
Create(...)-0%100%
UpdateAsync()-0%100%
Update(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
DeleteAsync()-0%100%
Delete(...)-0%100%
ListAsync(...)-0%0%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\TableOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Storage.Models;
 15
 16namespace Azure.ResourceManager.Storage
 17{
 18    /// <summary> The Table service client. </summary>
 19    public partial class TableOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal TableRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of TableOperations for mocking. </summary>
 025        protected TableOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of TableOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> The ID of the target subscription. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33        /// <param name="apiVersion"> Api Version. </param>
 034        internal TableOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri 
 35        {
 036            RestClient = new TableRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVersion);
 037            _clientDiagnostics = clientDiagnostics;
 038            _pipeline = pipeline;
 039        }
 40
 41        /// <summary> Creates a new table with the specified table name, under the specified account. </summary>
 42        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 43        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 44        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<Table>> CreateAsync(string resourceGroupName, string accountName, string tabl
 47        {
 048            using var scope = _clientDiagnostics.CreateScope("TableOperations.Create");
 049            scope.Start();
 50            try
 51            {
 052                return await RestClient.CreateAsync(resourceGroupName, accountName, tableName, cancellationToken).Config
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 059        }
 60
 61        /// <summary> Creates a new table with the specified table name, under the specified account. </summary>
 62        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 63        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 64        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 65        /// <param name="cancellationToken"> The cancellation token to use. </param>
 66        public virtual Response<Table> Create(string resourceGroupName, string accountName, string tableName, Cancellati
 67        {
 068            using var scope = _clientDiagnostics.CreateScope("TableOperations.Create");
 069            scope.Start();
 70            try
 71            {
 072                return RestClient.Create(resourceGroupName, accountName, tableName, cancellationToken);
 73            }
 074            catch (Exception e)
 75            {
 076                scope.Failed(e);
 077                throw;
 78            }
 079        }
 80
 81        /// <summary> Creates a new table with the specified table name, under the specified account. </summary>
 82        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 83        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 84        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 85        /// <param name="cancellationToken"> The cancellation token to use. </param>
 86        public virtual async Task<Response<Table>> UpdateAsync(string resourceGroupName, string accountName, string tabl
 87        {
 088            using var scope = _clientDiagnostics.CreateScope("TableOperations.Update");
 089            scope.Start();
 90            try
 91            {
 092                return await RestClient.UpdateAsync(resourceGroupName, accountName, tableName, cancellationToken).Config
 93            }
 094            catch (Exception e)
 95            {
 096                scope.Failed(e);
 097                throw;
 98            }
 099        }
 100
 101        /// <summary> Creates a new table with the specified table name, under the specified account. </summary>
 102        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 103        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 104        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 105        /// <param name="cancellationToken"> The cancellation token to use. </param>
 106        public virtual Response<Table> Update(string resourceGroupName, string accountName, string tableName, Cancellati
 107        {
 0108            using var scope = _clientDiagnostics.CreateScope("TableOperations.Update");
 0109            scope.Start();
 110            try
 111            {
 0112                return RestClient.Update(resourceGroupName, accountName, tableName, cancellationToken);
 113            }
 0114            catch (Exception e)
 115            {
 0116                scope.Failed(e);
 0117                throw;
 118            }
 0119        }
 120
 121        /// <summary> Gets the table with the specified table name, under the specified account if it exists. </summary>
 122        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 123        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 124        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 125        /// <param name="cancellationToken"> The cancellation token to use. </param>
 126        public virtual async Task<Response<Table>> GetAsync(string resourceGroupName, string accountName, string tableNa
 127        {
 0128            using var scope = _clientDiagnostics.CreateScope("TableOperations.Get");
 0129            scope.Start();
 130            try
 131            {
 0132                return await RestClient.GetAsync(resourceGroupName, accountName, tableName, cancellationToken).Configure
 133            }
 0134            catch (Exception e)
 135            {
 0136                scope.Failed(e);
 0137                throw;
 138            }
 0139        }
 140
 141        /// <summary> Gets the table with the specified table name, under the specified account if it exists. </summary>
 142        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 143        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 144        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 145        /// <param name="cancellationToken"> The cancellation token to use. </param>
 146        public virtual Response<Table> Get(string resourceGroupName, string accountName, string tableName, CancellationT
 147        {
 0148            using var scope = _clientDiagnostics.CreateScope("TableOperations.Get");
 0149            scope.Start();
 150            try
 151            {
 0152                return RestClient.Get(resourceGroupName, accountName, tableName, cancellationToken);
 153            }
 0154            catch (Exception e)
 155            {
 0156                scope.Failed(e);
 0157                throw;
 158            }
 0159        }
 160
 161        /// <summary> Deletes the table with the specified table name, under the specified account if it exists. </summa
 162        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 163        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 164        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 165        /// <param name="cancellationToken"> The cancellation token to use. </param>
 166        public virtual async Task<Response> DeleteAsync(string resourceGroupName, string accountName, string tableName, 
 167        {
 0168            using var scope = _clientDiagnostics.CreateScope("TableOperations.Delete");
 0169            scope.Start();
 170            try
 171            {
 0172                return await RestClient.DeleteAsync(resourceGroupName, accountName, tableName, cancellationToken).Config
 173            }
 0174            catch (Exception e)
 175            {
 0176                scope.Failed(e);
 0177                throw;
 178            }
 0179        }
 180
 181        /// <summary> Deletes the table with the specified table name, under the specified account if it exists. </summa
 182        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 183        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 184        /// <param name="tableName"> A table name must be unique within a storage account and must be between 3 and 63 c
 185        /// <param name="cancellationToken"> The cancellation token to use. </param>
 186        public virtual Response Delete(string resourceGroupName, string accountName, string tableName, CancellationToken
 187        {
 0188            using var scope = _clientDiagnostics.CreateScope("TableOperations.Delete");
 0189            scope.Start();
 190            try
 191            {
 0192                return RestClient.Delete(resourceGroupName, accountName, tableName, cancellationToken);
 193            }
 0194            catch (Exception e)
 195            {
 0196                scope.Failed(e);
 0197                throw;
 198            }
 0199        }
 200
 201        /// <summary> Gets a list of all the tables under the specified storage account. </summary>
 202        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 203        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 204        /// <param name="cancellationToken"> The cancellation token to use. </param>
 205        public virtual AsyncPageable<Table> ListAsync(string resourceGroupName, string accountName, CancellationToken ca
 206        {
 0207            if (resourceGroupName == null)
 208            {
 0209                throw new ArgumentNullException(nameof(resourceGroupName));
 210            }
 0211            if (accountName == null)
 212            {
 0213                throw new ArgumentNullException(nameof(accountName));
 214            }
 215
 216            async Task<Page<Table>> FirstPageFunc(int? pageSizeHint)
 217            {
 0218                using var scope = _clientDiagnostics.CreateScope("TableOperations.List");
 0219                scope.Start();
 220                try
 221                {
 0222                    var response = await RestClient.ListAsync(resourceGroupName, accountName, cancellationToken).Configu
 0223                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 224                }
 0225                catch (Exception e)
 226                {
 0227                    scope.Failed(e);
 0228                    throw;
 229                }
 0230            }
 231            async Task<Page<Table>> NextPageFunc(string nextLink, int? pageSizeHint)
 232            {
 0233                using var scope = _clientDiagnostics.CreateScope("TableOperations.List");
 0234                scope.Start();
 235                try
 236                {
 0237                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, accountName, cancella
 0238                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 239                }
 0240                catch (Exception e)
 241                {
 0242                    scope.Failed(e);
 0243                    throw;
 244                }
 0245            }
 0246            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 247        }
 248
 249        /// <summary> Gets a list of all the tables under the specified storage account. </summary>
 250        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 251        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 252        /// <param name="cancellationToken"> The cancellation token to use. </param>
 253        public virtual Pageable<Table> List(string resourceGroupName, string accountName, CancellationToken cancellation
 254        {
 0255            if (resourceGroupName == null)
 256            {
 0257                throw new ArgumentNullException(nameof(resourceGroupName));
 258            }
 0259            if (accountName == null)
 260            {
 0261                throw new ArgumentNullException(nameof(accountName));
 262            }
 263
 264            Page<Table> FirstPageFunc(int? pageSizeHint)
 265            {
 0266                using var scope = _clientDiagnostics.CreateScope("TableOperations.List");
 0267                scope.Start();
 268                try
 269                {
 0270                    var response = RestClient.List(resourceGroupName, accountName, cancellationToken);
 0271                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 272                }
 0273                catch (Exception e)
 274                {
 0275                    scope.Failed(e);
 0276                    throw;
 277                }
 0278            }
 279            Page<Table> NextPageFunc(string nextLink, int? pageSizeHint)
 280            {
 0281                using var scope = _clientDiagnostics.CreateScope("TableOperations.List");
 0282                scope.Start();
 283                try
 284                {
 0285                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, accountName, cancellationToken);
 0286                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 287                }
 0288                catch (Exception e)
 289                {
 0290                    scope.Failed(e);
 0291                    throw;
 292                }
 0293            }
 0294            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 295        }
 296    }
 297}