< Summary

Class:Azure.ResourceManager.Resources.ApplicationDefinitionsOperations
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\ApplicationDefinitionsOperations.cs
Covered lines:0
Uncovered lines:170
Coverable lines:170
Total lines:432
Line coverage:0% (0 of 170)
Covered branches:0
Total branches:36
Branch coverage:0% (0 of 36)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
GetAsync()-0%100%
Get(...)-0%100%
GetByIdAsync()-0%100%
GetById(...)-0%100%
ListByResourceGroupAsync(...)-0%0%
<ListByResourceGroupAsync()-0%100%
<ListByResourceGroupAsync()-0%100%
ListByResourceGroup(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartDeleteByIdAsync()-0%0%
StartDeleteById(...)-0%0%
StartCreateOrUpdateByIdAsync()-0%0%
StartCreateOrUpdateById(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\ApplicationDefinitionsOperations.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.Resources.Models;
 15
 16namespace Azure.ResourceManager.Resources
 17{
 18    /// <summary> The ApplicationDefinitions service client. </summary>
 19    public partial class ApplicationDefinitionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal ApplicationDefinitionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of ApplicationDefinitionsOperations for mocking. </summary>
 025        protected ApplicationDefinitionsOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of ApplicationDefinitionsOperations. </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>
 033        internal ApplicationDefinitionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string sub
 34        {
 035            RestClient = new ApplicationDefinitionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint)
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> Gets the managed application definition. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 42        /// <param name="applicationDefinitionName"> The name of the managed application definition. </param>
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<ApplicationDefinition>> GetAsync(string resourceGroupName, string application
 45        {
 046            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.Get");
 047            scope.Start();
 48            try
 49            {
 050                return await RestClient.GetAsync(resourceGroupName, applicationDefinitionName, cancellationToken).Config
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 057        }
 58
 59        /// <summary> Gets the managed application definition. </summary>
 60        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 61        /// <param name="applicationDefinitionName"> The name of the managed application definition. </param>
 62        /// <param name="cancellationToken"> The cancellation token to use. </param>
 63        public virtual Response<ApplicationDefinition> Get(string resourceGroupName, string applicationDefinitionName, C
 64        {
 065            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.Get");
 066            scope.Start();
 67            try
 68            {
 069                return RestClient.Get(resourceGroupName, applicationDefinitionName, cancellationToken);
 70            }
 071            catch (Exception e)
 72            {
 073                scope.Failed(e);
 074                throw;
 75            }
 076        }
 77
 78        /// <summary> Gets the managed application definition. </summary>
 79        /// <param name="applicationDefinitionId"> The fully qualified ID of the managed application definition, includi
 80        /// <param name="cancellationToken"> The cancellation token to use. </param>
 81        public virtual async Task<Response<ApplicationDefinition>> GetByIdAsync(string applicationDefinitionId, Cancella
 82        {
 083            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.GetById");
 084            scope.Start();
 85            try
 86            {
 087                return await RestClient.GetByIdAsync(applicationDefinitionId, cancellationToken).ConfigureAwait(false);
 88            }
 089            catch (Exception e)
 90            {
 091                scope.Failed(e);
 092                throw;
 93            }
 094        }
 95
 96        /// <summary> Gets the managed application definition. </summary>
 97        /// <param name="applicationDefinitionId"> The fully qualified ID of the managed application definition, includi
 98        /// <param name="cancellationToken"> The cancellation token to use. </param>
 99        public virtual Response<ApplicationDefinition> GetById(string applicationDefinitionId, CancellationToken cancell
 100        {
 0101            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.GetById");
 0102            scope.Start();
 103            try
 104            {
 0105                return RestClient.GetById(applicationDefinitionId, cancellationToken);
 106            }
 0107            catch (Exception e)
 108            {
 0109                scope.Failed(e);
 0110                throw;
 111            }
 0112        }
 113
 114        /// <summary> Lists the managed application definitions in a resource group. </summary>
 115        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 116        /// <param name="cancellationToken"> The cancellation token to use. </param>
 117        public virtual AsyncPageable<ApplicationDefinition> ListByResourceGroupAsync(string resourceGroupName, Cancellat
 118        {
 0119            if (resourceGroupName == null)
 120            {
 0121                throw new ArgumentNullException(nameof(resourceGroupName));
 122            }
 123
 124            async Task<Page<ApplicationDefinition>> FirstPageFunc(int? pageSizeHint)
 125            {
 0126                using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.ListByResourceGroup")
 0127                scope.Start();
 128                try
 129                {
 0130                    var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).Confi
 0131                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 132                }
 0133                catch (Exception e)
 134                {
 0135                    scope.Failed(e);
 0136                    throw;
 137                }
 0138            }
 139            async Task<Page<ApplicationDefinition>> NextPageFunc(string nextLink, int? pageSizeHint)
 140            {
 0141                using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.ListByResourceGroup")
 0142                scope.Start();
 143                try
 144                {
 0145                    var response = await RestClient.ListByResourceGroupNextPageAsync(nextLink, resourceGroupName, cancel
 0146                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 147                }
 0148                catch (Exception e)
 149                {
 0150                    scope.Failed(e);
 0151                    throw;
 152                }
 0153            }
 0154            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 155        }
 156
 157        /// <summary> Lists the managed application definitions in a resource group. </summary>
 158        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 159        /// <param name="cancellationToken"> The cancellation token to use. </param>
 160        public virtual Pageable<ApplicationDefinition> ListByResourceGroup(string resourceGroupName, CancellationToken c
 161        {
 0162            if (resourceGroupName == null)
 163            {
 0164                throw new ArgumentNullException(nameof(resourceGroupName));
 165            }
 166
 167            Page<ApplicationDefinition> FirstPageFunc(int? pageSizeHint)
 168            {
 0169                using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.ListByResourceGroup")
 0170                scope.Start();
 171                try
 172                {
 0173                    var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken);
 0174                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 175                }
 0176                catch (Exception e)
 177                {
 0178                    scope.Failed(e);
 0179                    throw;
 180                }
 0181            }
 182            Page<ApplicationDefinition> NextPageFunc(string nextLink, int? pageSizeHint)
 183            {
 0184                using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.ListByResourceGroup")
 0185                scope.Start();
 186                try
 187                {
 0188                    var response = RestClient.ListByResourceGroupNextPage(nextLink, resourceGroupName, cancellationToken
 0189                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 190                }
 0191                catch (Exception e)
 192                {
 0193                    scope.Failed(e);
 0194                    throw;
 195                }
 0196            }
 0197            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 198        }
 199
 200        /// <summary> Deletes the managed application definition. </summary>
 201        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 202        /// <param name="applicationDefinitionName"> The name of the managed application definition to delete. </param>
 203        /// <param name="cancellationToken"> The cancellation token to use. </param>
 204        public virtual async Task<ApplicationDefinitionsDeleteOperation> StartDeleteAsync(string resourceGroupName, stri
 205        {
 0206            if (resourceGroupName == null)
 207            {
 0208                throw new ArgumentNullException(nameof(resourceGroupName));
 209            }
 0210            if (applicationDefinitionName == null)
 211            {
 0212                throw new ArgumentNullException(nameof(applicationDefinitionName));
 213            }
 214
 0215            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartDelete");
 0216            scope.Start();
 217            try
 218            {
 0219                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, applicationDefinitionName, cancel
 0220                return new ApplicationDefinitionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteR
 221            }
 0222            catch (Exception e)
 223            {
 0224                scope.Failed(e);
 0225                throw;
 226            }
 0227        }
 228
 229        /// <summary> Deletes the managed application definition. </summary>
 230        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 231        /// <param name="applicationDefinitionName"> The name of the managed application definition to delete. </param>
 232        /// <param name="cancellationToken"> The cancellation token to use. </param>
 233        public virtual ApplicationDefinitionsDeleteOperation StartDelete(string resourceGroupName, string applicationDef
 234        {
 0235            if (resourceGroupName == null)
 236            {
 0237                throw new ArgumentNullException(nameof(resourceGroupName));
 238            }
 0239            if (applicationDefinitionName == null)
 240            {
 0241                throw new ArgumentNullException(nameof(applicationDefinitionName));
 242            }
 243
 0244            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartDelete");
 0245            scope.Start();
 246            try
 247            {
 0248                var originalResponse = RestClient.Delete(resourceGroupName, applicationDefinitionName, cancellationToken
 0249                return new ApplicationDefinitionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteR
 250            }
 0251            catch (Exception e)
 252            {
 0253                scope.Failed(e);
 0254                throw;
 255            }
 0256        }
 257
 258        /// <summary> Creates a new managed application definition. </summary>
 259        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 260        /// <param name="applicationDefinitionName"> The name of the managed application definition. </param>
 261        /// <param name="parameters"> Parameters supplied to the create or update an managed application definition. </p
 262        /// <param name="cancellationToken"> The cancellation token to use. </param>
 263        public virtual async Task<ApplicationDefinitionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourc
 264        {
 0265            if (resourceGroupName == null)
 266            {
 0267                throw new ArgumentNullException(nameof(resourceGroupName));
 268            }
 0269            if (applicationDefinitionName == null)
 270            {
 0271                throw new ArgumentNullException(nameof(applicationDefinitionName));
 272            }
 0273            if (parameters == null)
 274            {
 0275                throw new ArgumentNullException(nameof(parameters));
 276            }
 277
 0278            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartCreateOrUpdate");
 0279            scope.Start();
 280            try
 281            {
 0282                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, applicationDefinitionName
 0283                return new ApplicationDefinitionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Creat
 284            }
 0285            catch (Exception e)
 286            {
 0287                scope.Failed(e);
 0288                throw;
 289            }
 0290        }
 291
 292        /// <summary> Creates a new managed application definition. </summary>
 293        /// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
 294        /// <param name="applicationDefinitionName"> The name of the managed application definition. </param>
 295        /// <param name="parameters"> Parameters supplied to the create or update an managed application definition. </p
 296        /// <param name="cancellationToken"> The cancellation token to use. </param>
 297        public virtual ApplicationDefinitionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, strin
 298        {
 0299            if (resourceGroupName == null)
 300            {
 0301                throw new ArgumentNullException(nameof(resourceGroupName));
 302            }
 0303            if (applicationDefinitionName == null)
 304            {
 0305                throw new ArgumentNullException(nameof(applicationDefinitionName));
 306            }
 0307            if (parameters == null)
 308            {
 0309                throw new ArgumentNullException(nameof(parameters));
 310            }
 311
 0312            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartCreateOrUpdate");
 0313            scope.Start();
 314            try
 315            {
 0316                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, applicationDefinitionName, parameter
 0317                return new ApplicationDefinitionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.Creat
 318            }
 0319            catch (Exception e)
 320            {
 0321                scope.Failed(e);
 0322                throw;
 323            }
 0324        }
 325
 326        /// <summary> Deletes the managed application definition. </summary>
 327        /// <param name="applicationDefinitionId"> The fully qualified ID of the managed application definition, includi
 328        /// <param name="cancellationToken"> The cancellation token to use. </param>
 329        public virtual async Task<ApplicationDefinitionsDeleteByIdOperation> StartDeleteByIdAsync(string applicationDefi
 330        {
 0331            if (applicationDefinitionId == null)
 332            {
 0333                throw new ArgumentNullException(nameof(applicationDefinitionId));
 334            }
 335
 0336            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartDeleteById");
 0337            scope.Start();
 338            try
 339            {
 0340                var originalResponse = await RestClient.DeleteByIdAsync(applicationDefinitionId, cancellationToken).Conf
 0341                return new ApplicationDefinitionsDeleteByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 342            }
 0343            catch (Exception e)
 344            {
 0345                scope.Failed(e);
 0346                throw;
 347            }
 0348        }
 349
 350        /// <summary> Deletes the managed application definition. </summary>
 351        /// <param name="applicationDefinitionId"> The fully qualified ID of the managed application definition, includi
 352        /// <param name="cancellationToken"> The cancellation token to use. </param>
 353        public virtual ApplicationDefinitionsDeleteByIdOperation StartDeleteById(string applicationDefinitionId, Cancell
 354        {
 0355            if (applicationDefinitionId == null)
 356            {
 0357                throw new ArgumentNullException(nameof(applicationDefinitionId));
 358            }
 359
 0360            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartDeleteById");
 0361            scope.Start();
 362            try
 363            {
 0364                var originalResponse = RestClient.DeleteById(applicationDefinitionId, cancellationToken);
 0365                return new ApplicationDefinitionsDeleteByIdOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 366            }
 0367            catch (Exception e)
 368            {
 0369                scope.Failed(e);
 0370                throw;
 371            }
 0372        }
 373
 374        /// <summary> Creates a new managed application definition. </summary>
 375        /// <param name="applicationDefinitionId"> The fully qualified ID of the managed application definition, includi
 376        /// <param name="parameters"> Parameters supplied to the create or update a managed application definition. </pa
 377        /// <param name="cancellationToken"> The cancellation token to use. </param>
 378        public virtual async Task<ApplicationDefinitionsCreateOrUpdateByIdOperation> StartCreateOrUpdateByIdAsync(string
 379        {
 0380            if (applicationDefinitionId == null)
 381            {
 0382                throw new ArgumentNullException(nameof(applicationDefinitionId));
 383            }
 0384            if (parameters == null)
 385            {
 0386                throw new ArgumentNullException(nameof(parameters));
 387            }
 388
 0389            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartCreateOrUpdateById")
 0390            scope.Start();
 391            try
 392            {
 0393                var originalResponse = await RestClient.CreateOrUpdateByIdAsync(applicationDefinitionId, parameters, can
 0394                return new ApplicationDefinitionsCreateOrUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.C
 395            }
 0396            catch (Exception e)
 397            {
 0398                scope.Failed(e);
 0399                throw;
 400            }
 0401        }
 402
 403        /// <summary> Creates a new managed application definition. </summary>
 404        /// <param name="applicationDefinitionId"> The fully qualified ID of the managed application definition, includi
 405        /// <param name="parameters"> Parameters supplied to the create or update a managed application definition. </pa
 406        /// <param name="cancellationToken"> The cancellation token to use. </param>
 407        public virtual ApplicationDefinitionsCreateOrUpdateByIdOperation StartCreateOrUpdateById(string applicationDefin
 408        {
 0409            if (applicationDefinitionId == null)
 410            {
 0411                throw new ArgumentNullException(nameof(applicationDefinitionId));
 412            }
 0413            if (parameters == null)
 414            {
 0415                throw new ArgumentNullException(nameof(parameters));
 416            }
 417
 0418            using var scope = _clientDiagnostics.CreateScope("ApplicationDefinitionsOperations.StartCreateOrUpdateById")
 0419            scope.Start();
 420            try
 421            {
 0422                var originalResponse = RestClient.CreateOrUpdateById(applicationDefinitionId, parameters, cancellationTo
 0423                return new ApplicationDefinitionsCreateOrUpdateByIdOperation(_clientDiagnostics, _pipeline, RestClient.C
 424            }
 0425            catch (Exception e)
 426            {
 0427                scope.Failed(e);
 0428                throw;
 429            }
 0430        }
 431    }
 432}