|
| 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 | + |
| 11 | +namespace 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 searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions)) |
| 44 | + { |
| 45 | + return operations.GetAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions).GetAwaiter().GetResult(); |
| 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 resourceGroupName, string searchServiceName, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions), CancellationToken cancellationToken = default(CancellationToken)) |
| 71 | + { |
| 72 | + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, searchServiceName, searchManagementRequestOptions, null, cancellationToken).ConfigureAwait(false)) |
| 73 | + { |
| 74 | + return _result.Body; |
| 75 | + } |
| 76 | + } |
| 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, string searchServiceName, AdminKeyKind keyKind, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions)) |
| 102 | + { |
| 103 | + return operations.RegenerateAsync(resourceGroupName, searchServiceName, keyKind, searchManagementRequestOptions).GetAwaiter().GetResult(); |
| 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 resourceGroupName, string searchServiceName, AdminKeyKind keyKind, SearchManagementRequestOptions searchManagementRequestOptions = default(SearchManagementRequestOptions), CancellationToken cancellationToken = default(CancellationToken)) |
| 133 | + { |
| 134 | + using (var _result = await operations.RegenerateWithHttpMessagesAsync(resourceGroupName, searchServiceName, keyKind, searchManagementRequestOptions, null, cancellationToken).ConfigureAwait(false)) |
| 135 | + { |
| 136 | + return _result.Body; |
| 137 | + } |
| 138 | + } |
| 139 | + |
| 140 | + } |
| 141 | +} |
0 commit comments