< Summary

Class:Microsoft.Azure.Management.Search.AdminKeysOperationsExtensions
Assembly:Microsoft.Azure.Management.Search
File(s):C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\src\Generated\AdminKeysOperationsExtensions.cs
Covered lines:4
Uncovered lines:4
Coverable lines:8
Total lines:141
Line coverage:50% (4 of 8)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Get(...)-100%100%
GetAsync()-100%100%
Regenerate(...)-0%100%
RegenerateAsync()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Microsoft.Azure.Management.Search\src\Generated\AdminKeysOperationsExtensions.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.Management.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 AdminKeysOperations.
 21    /// </summary>
 22    public static partial class AdminKeysOperationsExtensions
 23    {
 24            /// <summary>
 25            /// Gets the primary and secondary admin API keys for the specified Azure
 26            /// Cognitive Search service.
 27            /// <see href="https://aka.ms/search-manage" />
 28            /// </summary>
 29            /// <param name='operations'>
 30            /// The operations group for this extension method.
 31            /// </param>
 32            /// <param name='resourceGroupName'>
 33            /// The name of the resource group within the current subscription. You can
 34            /// obtain this value from the Azure Resource Manager API or the portal.
 35            /// </param>
 36            /// <param name='searchServiceName'>
 37            /// The name of the Azure Cognitive Search service associated with the
 38            /// specified resource group.
 39            /// </param>
 40            /// <param name='searchManagementRequestOptions'>
 41            /// Additional parameters for the operation
 42            /// </param>
 43            public static AdminKeyResult Get(this IAdminKeysOperations operations, string resourceGroupName, string sear
 44            {
 60245                return operations.GetAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).GetAwai
 46            }
 47
 48            /// <summary>
 49            /// Gets the primary and secondary admin API keys for the specified Azure
 50            /// Cognitive Search service.
 51            /// <see href="https://aka.ms/search-manage" />
 52            /// </summary>
 53            /// <param name='operations'>
 54            /// The operations group for this extension method.
 55            /// </param>
 56            /// <param name='resourceGroupName'>
 57            /// The name of the resource group within the current subscription. You can
 58            /// obtain this value from the Azure Resource Manager API or the portal.
 59            /// </param>
 60            /// <param name='searchServiceName'>
 61            /// The name of the Azure Cognitive Search service associated with the
 62            /// specified resource group.
 63            /// </param>
 64            /// <param name='searchManagementRequestOptions'>
 65            /// Additional parameters for the operation
 66            /// </param>
 67            /// <param name='cancellationToken'>
 68            /// The cancellation token.
 69            /// </param>
 70            public static async Task<AdminKeyResult> GetAsync(this IAdminKeysOperations operations, string resourceGroup
 71            {
 60272                using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, searchServiceName, sea
 73                {
 60274                    return _result.Body;
 75                }
 60276            }
 77
 78            /// <summary>
 79            /// Regenerates either the primary or secondary admin API key. You can only
 80            /// regenerate one key at a time.
 81            /// <see href="https://aka.ms/search-manage" />
 82            /// </summary>
 83            /// <param name='operations'>
 84            /// The operations group for this extension method.
 85            /// </param>
 86            /// <param name='resourceGroupName'>
 87            /// The name of the resource group within the current subscription. You can
 88            /// obtain this value from the Azure Resource Manager API or the portal.
 89            /// </param>
 90            /// <param name='searchServiceName'>
 91            /// The name of the Azure Cognitive Search service associated with the
 92            /// specified resource group.
 93            /// </param>
 94            /// <param name='keyKind'>
 95            /// Specifies which key to regenerate. Valid values include 'primary' and
 96            /// 'secondary'. Possible values include: 'primary', 'secondary'
 97            /// </param>
 98            /// <param name='searchManagementRequestOptions'>
 99            /// Additional parameters for the operation
 100            /// </param>
 101            public static AdminKeyResult Regenerate(this IAdminKeysOperations operations, string resourceGroupName, stri
 102            {
 0103                return operations.RegenerateAsync(resourceGroupName, searchServiceName, keyKind, searchManagementRequest
 104            }
 105
 106            /// <summary>
 107            /// Regenerates either the primary or secondary admin API key. You can only
 108            /// regenerate one key at a time.
 109            /// <see href="https://aka.ms/search-manage" />
 110            /// </summary>
 111            /// <param name='operations'>
 112            /// The operations group for this extension method.
 113            /// </param>
 114            /// <param name='resourceGroupName'>
 115            /// The name of the resource group within the current subscription. You can
 116            /// obtain this value from the Azure Resource Manager API or the portal.
 117            /// </param>
 118            /// <param name='searchServiceName'>
 119            /// The name of the Azure Cognitive Search service associated with the
 120            /// specified resource group.
 121            /// </param>
 122            /// <param name='keyKind'>
 123            /// Specifies which key to regenerate. Valid values include 'primary' and
 124            /// 'secondary'. Possible values include: 'primary', 'secondary'
 125            /// </param>
 126            /// <param name='searchManagementRequestOptions'>
 127            /// Additional parameters for the operation
 128            /// </param>
 129            /// <param name='cancellationToken'>
 130            /// The cancellation token.
 131            /// </param>
 132            public static async Task<AdminKeyResult> RegenerateAsync(this IAdminKeysOperations operations, string resour
 133            {
 0134                using (var _result = await operations.RegenerateWithHttpMessagesAsync(resourceGroupName, searchServiceNa
 135                {
 0136                    return _result.Body;
 137                }
 0138            }
 139
 140    }
 141}