< Summary

Class:Microsoft.Azure.Search.SkillsetsOperationsExtensions
Assembly:Microsoft.Azure.Search.Service
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Customizations\Skillsets\SkillsetsOperationsExtensions.Customization.cs
C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\SkillsetsOperationsExtensions.cs
Covered lines:16
Uncovered lines:12
Coverable lines:28
Total lines:352
Line coverage:57.1% (16 of 28)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
CreateOrUpdate(...)-0%100%
CreateOrUpdateAsync()-0%100%
Exists(...)-100%100%
ExistsAsync()-100%100%
CreateOrUpdate(...)-0%100%
CreateOrUpdateAsync()-0%100%
Delete(...)-100%100%
DeleteAsync()-100%100%
Get(...)-100%100%
GetAsync()-100%100%
List(...)-0%100%
ListAsync()-0%100%
Create(...)-100%100%
CreateAsync()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Customizations\Skillsets\SkillsetsOperationsExtensions.Customization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5namespace Microsoft.Azure.Search
 6{
 7    using System.Threading;
 8    using System.Threading.Tasks;
 9    using Microsoft.Azure.Search.Models;
 10    using Microsoft.Rest.Azure;
 11
 12    /// <summary>
 13    /// Operations for managing skillsets.
 14    /// </summary>
 15    public static partial class SkillsetsOperationsExtensions
 16    {
 17        /// <summary>
 18        /// Creates a new skillset or updates a skillset if it
 19        /// already exists.
 20        /// </summary>
 21        /// <param name='operations'>
 22        /// The operations group for this extension method.
 23        /// </param>
 24        /// <param name='skillset'>
 25        /// The definition of the skillset to create or update.
 26        /// </param>
 27        /// <param name='searchRequestOptions'>
 28        /// Additional parameters for the operation
 29        /// </param>
 30        /// <param name='accessCondition'>
 31        /// Additional parameters for the operation
 32        /// </param>
 33        public static Skillset CreateOrUpdate(this ISkillsetsOperations operations, Skillset skillset, SearchRequestOpti
 34        {
 035            return operations.CreateOrUpdateAsync(skillset, searchRequestOptions, accessCondition).GetAwaiter().GetResul
 36        }
 37
 38        /// <summary>
 39        /// Creates a new skillset or updates a skillset if it
 40        /// already exists.
 41        /// </summary>
 42        /// <param name='operations'>
 43        /// The operations group for this extension method.
 44        /// </param>
 45        /// <param name='skillset'>
 46        /// The definition of the skillset to create or update.
 47        /// </param>
 48        /// <param name='searchRequestOptions'>
 49        /// Additional parameters for the operation
 50        /// </param>
 51        /// <param name='accessCondition'>
 52        /// Additional parameters for the operation
 53        /// </param>
 54        /// <param name='cancellationToken'>
 55        /// The cancellation token.
 56        /// </param>
 57        public static async Task<Skillset> CreateOrUpdateAsync(this ISkillsetsOperations operations, Skillset skillset, 
 58        {
 059            using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(skillset, searchRequestOptions, ac
 60            {
 061                return _result.Body;
 62            }
 063        }
 64
 65        /// <summary>
 66        /// Determines whether or not the given skillset exists in the search service.
 67        /// </summary>
 68        /// <param name='operations'>
 69        /// The operations group for this extension method.
 70        /// </param>
 71        /// <param name="skillsetName">
 72        /// The name of the skillset.
 73        /// </param>
 74        /// <param name='searchRequestOptions'>
 75        /// Additional parameters for the operation
 76        /// </param>
 77        /// <returns>
 78        /// <c>true</c> if the skillset exists; <c>false</c> otherwise.
 79        /// </returns>
 80        public static bool Exists(
 81            this ISkillsetsOperations operations,
 82            string skillsetName,
 83            SearchRequestOptions searchRequestOptions = default(SearchRequestOptions))
 84        {
 485            return operations.ExistsAsync(skillsetName, searchRequestOptions).GetAwaiter().GetResult();
 86        }
 87
 88        /// <summary>
 89        /// Determines whether or not the given skillset exists in the search service.
 90        /// </summary>
 91        /// <param name='operations'>
 92        /// The operations group for this extension method.
 93        /// </param>
 94        /// <param name="skillsetName">
 95        /// The name of the skillset.
 96        /// </param>
 97        /// <param name='searchRequestOptions'>
 98        /// Additional parameters for the operation
 99        /// </param>
 100        /// <param name='cancellationToken'>
 101        /// The cancellation token.
 102        /// </param>
 103        /// <returns>
 104        /// <c>true</c> if the skillset exists; <c>false</c> otherwise.
 105        /// </returns>
 106        public static async Task<bool> ExistsAsync(
 107            this ISkillsetsOperations operations,
 108            string skillsetName,
 109            SearchRequestOptions searchRequestOptions = default(SearchRequestOptions),
 110            CancellationToken cancellationToken = default(CancellationToken))
 111        {
 4112            AzureOperationResponse<bool> result = await operations.ExistsWithHttpMessagesAsync(skillsetName, searchReque
 4113            return result.Body;
 4114        }
 115    }
 116}

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Search.Service\src\Generated\SkillsetsOperationsExtensions.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Search
 12{
 13    using Microsoft.Rest;
 14    using Microsoft.Rest.Azure;
 15    using Models;
 16    using System.Threading;
 17    using System.Threading.Tasks;
 18
 19    /// <summary>
 20    /// Extension methods for SkillsetsOperations.
 21    /// </summary>
 22    public static partial class SkillsetsOperationsExtensions
 23    {
 24            /// <summary>
 25            /// Creates a new skillset in a search service or updates the skillset if it
 26            /// already exists.
 27            /// <see href="https://docs.microsoft.com/rest/api/searchservice/update-skillset" />
 28            /// </summary>
 29            /// <param name='operations'>
 30            /// The operations group for this extension method.
 31            /// </param>
 32            /// <param name='skillsetName'>
 33            /// The name of the skillset to create or update.
 34            /// </param>
 35            /// <param name='skillset'>
 36            /// The skillset containing one or more skills to create or update in a search
 37            /// service.
 38            /// </param>
 39            /// <param name='searchRequestOptions'>
 40            /// Additional parameters for the operation
 41            /// </param>
 42            public static Skillset CreateOrUpdate(this ISkillsetsOperations operations, string skillsetName, Skillset sk
 43            {
 044                return operations.CreateOrUpdateAsync(skillsetName, skillset, searchRequestOptions).GetAwaiter().GetResu
 45            }
 46
 47            /// <summary>
 48            /// Creates a new skillset in a search service or updates the skillset if it
 49            /// already exists.
 50            /// <see href="https://docs.microsoft.com/rest/api/searchservice/update-skillset" />
 51            /// </summary>
 52            /// <param name='operations'>
 53            /// The operations group for this extension method.
 54            /// </param>
 55            /// <param name='skillsetName'>
 56            /// The name of the skillset to create or update.
 57            /// </param>
 58            /// <param name='skillset'>
 59            /// The skillset containing one or more skills to create or update in a search
 60            /// service.
 61            /// </param>
 62            /// <param name='searchRequestOptions'>
 63            /// Additional parameters for the operation
 64            /// </param>
 65            /// <param name='cancellationToken'>
 66            /// The cancellation token.
 67            /// </param>
 68            public static async Task<Skillset> CreateOrUpdateAsync(this ISkillsetsOperations operations, string skillset
 69            {
 070                using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(skillsetName, skillset, search
 71                {
 072                    return _result.Body;
 73                }
 074            }
 75
 76            /// <summary>
 77            /// Deletes a skillset in a search service.
 78            /// <see href="https://docs.microsoft.com/rest/api/searchservice/delete-skillset" />
 79            /// </summary>
 80            /// <param name='operations'>
 81            /// The operations group for this extension method.
 82            /// </param>
 83            /// <param name='skillsetName'>
 84            /// The name of the skillset to delete.
 85            /// </param>
 86            /// <param name='searchRequestOptions'>
 87            /// Additional parameters for the operation
 88            /// </param>
 89            public static void Delete(this ISkillsetsOperations operations, string skillsetName, SearchRequestOptions se
 90            {
 7091                operations.DeleteAsync(skillsetName, searchRequestOptions).GetAwaiter().GetResult();
 7092            }
 93
 94            /// <summary>
 95            /// Deletes a skillset in a search service.
 96            /// <see href="https://docs.microsoft.com/rest/api/searchservice/delete-skillset" />
 97            /// </summary>
 98            /// <param name='operations'>
 99            /// The operations group for this extension method.
 100            /// </param>
 101            /// <param name='skillsetName'>
 102            /// The name of the skillset to delete.
 103            /// </param>
 104            /// <param name='searchRequestOptions'>
 105            /// Additional parameters for the operation
 106            /// </param>
 107            /// <param name='cancellationToken'>
 108            /// The cancellation token.
 109            /// </param>
 110            public static async Task DeleteAsync(this ISkillsetsOperations operations, string skillsetName, SearchReques
 111            {
 70112                (await operations.DeleteWithHttpMessagesAsync(skillsetName, searchRequestOptions, null, cancellationToke
 70113            }
 114
 115            /// <summary>
 116            /// Retrieves a skillset in a search service.
 117            /// <see href="https://docs.microsoft.com/rest/api/searchservice/get-skillset" />
 118            /// </summary>
 119            /// <param name='operations'>
 120            /// The operations group for this extension method.
 121            /// </param>
 122            /// <param name='skillsetName'>
 123            /// The name of the skillset to retrieve.
 124            /// </param>
 125            /// <param name='searchRequestOptions'>
 126            /// Additional parameters for the operation
 127            /// </param>
 128            public static Skillset Get(this ISkillsetsOperations operations, string skillsetName, SearchRequestOptions s
 129            {
 6130                return operations.GetAsync(skillsetName, searchRequestOptions).GetAwaiter().GetResult();
 131            }
 132
 133            /// <summary>
 134            /// Retrieves a skillset in a search service.
 135            /// <see href="https://docs.microsoft.com/rest/api/searchservice/get-skillset" />
 136            /// </summary>
 137            /// <param name='operations'>
 138            /// The operations group for this extension method.
 139            /// </param>
 140            /// <param name='skillsetName'>
 141            /// The name of the skillset to retrieve.
 142            /// </param>
 143            /// <param name='searchRequestOptions'>
 144            /// Additional parameters for the operation
 145            /// </param>
 146            /// <param name='cancellationToken'>
 147            /// The cancellation token.
 148            /// </param>
 149            public static async Task<Skillset> GetAsync(this ISkillsetsOperations operations, string skillsetName, Searc
 150            {
 6151                using (var _result = await operations.GetWithHttpMessagesAsync(skillsetName, searchRequestOptions, null,
 152                {
 4153                    return _result.Body;
 154                }
 4155            }
 156
 157            /// <summary>
 158            /// List all skillsets in a search service.
 159            /// <see href="https://docs.microsoft.com/rest/api/searchservice/list-skillset" />
 160            /// </summary>
 161            /// <param name='operations'>
 162            /// The operations group for this extension method.
 163            /// </param>
 164            /// <param name='searchRequestOptions'>
 165            /// Additional parameters for the operation
 166            /// </param>
 167            public static SkillsetListResult List(this ISkillsetsOperations operations, SearchRequestOptions searchReque
 168            {
 0169                return operations.ListAsync(searchRequestOptions).GetAwaiter().GetResult();
 170            }
 171
 172            /// <summary>
 173            /// List all skillsets in a search service.
 174            /// <see href="https://docs.microsoft.com/rest/api/searchservice/list-skillset" />
 175            /// </summary>
 176            /// <param name='operations'>
 177            /// The operations group for this extension method.
 178            /// </param>
 179            /// <param name='searchRequestOptions'>
 180            /// Additional parameters for the operation
 181            /// </param>
 182            /// <param name='cancellationToken'>
 183            /// The cancellation token.
 184            /// </param>
 185            public static async Task<SkillsetListResult> ListAsync(this ISkillsetsOperations operations, SearchRequestOp
 186            {
 0187                using (var _result = await operations.ListWithHttpMessagesAsync(searchRequestOptions, null, cancellation
 188                {
 0189                    return _result.Body;
 190                }
 0191            }
 192
 193            /// <summary>
 194            /// Creates a new skillset in a search service.
 195            /// <see href="https://docs.microsoft.com/rest/api/searchservice/create-skillset" />
 196            /// </summary>
 197            /// <param name='operations'>
 198            /// The operations group for this extension method.
 199            /// </param>
 200            /// <param name='skillset'>
 201            /// The skillset containing one or more skills to create in a search service.
 202            /// </param>
 203            /// <param name='searchRequestOptions'>
 204            /// Additional parameters for the operation
 205            /// </param>
 206            public static Skillset Create(this ISkillsetsOperations operations, Skillset skillset, SearchRequestOptions 
 207            {
 72208                return operations.CreateAsync(skillset, searchRequestOptions).GetAwaiter().GetResult();
 209            }
 210
 211            /// <summary>
 212            /// Creates a new skillset in a search service.
 213            /// <see href="https://docs.microsoft.com/rest/api/searchservice/create-skillset" />
 214            /// </summary>
 215            /// <param name='operations'>
 216            /// The operations group for this extension method.
 217            /// </param>
 218            /// <param name='skillset'>
 219            /// The skillset containing one or more skills to create in a search service.
 220            /// </param>
 221            /// <param name='searchRequestOptions'>
 222            /// Additional parameters for the operation
 223            /// </param>
 224            /// <param name='cancellationToken'>
 225            /// The cancellation token.
 226            /// </param>
 227            public static async Task<Skillset> CreateAsync(this ISkillsetsOperations operations, Skillset skillset, Sear
 228            {
 72229                using (var _result = await operations.CreateWithHttpMessagesAsync(skillset, searchRequestOptions, null, 
 230                {
 72231                    return _result.Body;
 232                }
 72233            }
 234
 235    }
 236}