|
| 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.Sql |
| 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 DatabaseAdvancedThreatProtectionSettingsOperations. |
| 21 | + /// </summary> |
| 22 | + public static partial class DatabaseAdvancedThreatProtectionSettingsOperationsExtensions |
| 23 | + { |
| 24 | + /// <summary> |
| 25 | + /// Gets a list of database's Advanced Threat Protection states. |
| 26 | + /// </summary> |
| 27 | + /// <param name='operations'> |
| 28 | + /// The operations group for this extension method. |
| 29 | + /// </param> |
| 30 | + /// <param name='resourceGroupName'> |
| 31 | + /// The name of the resource group that contains the resource. You can obtain |
| 32 | + /// this value from the Azure Resource Manager API or the portal. |
| 33 | + /// </param> |
| 34 | + /// <param name='serverName'> |
| 35 | + /// The name of the server. |
| 36 | + /// </param> |
| 37 | + /// <param name='databaseName'> |
| 38 | + /// The name of the database. |
| 39 | + /// </param> |
| 40 | + public static IPage<DatabaseAdvancedThreatProtection> ListByDatabase(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string resourceGroupName, string serverName, string databaseName) |
| 41 | + { |
| 42 | + return operations.ListByDatabaseAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); |
| 43 | + } |
| 44 | + |
| 45 | + /// <summary> |
| 46 | + /// Gets a list of database's Advanced Threat Protection states. |
| 47 | + /// </summary> |
| 48 | + /// <param name='operations'> |
| 49 | + /// The operations group for this extension method. |
| 50 | + /// </param> |
| 51 | + /// <param name='resourceGroupName'> |
| 52 | + /// The name of the resource group that contains the resource. You can obtain |
| 53 | + /// this value from the Azure Resource Manager API or the portal. |
| 54 | + /// </param> |
| 55 | + /// <param name='serverName'> |
| 56 | + /// The name of the server. |
| 57 | + /// </param> |
| 58 | + /// <param name='databaseName'> |
| 59 | + /// The name of the database. |
| 60 | + /// </param> |
| 61 | + /// <param name='cancellationToken'> |
| 62 | + /// The cancellation token. |
| 63 | + /// </param> |
| 64 | + public static async Task<IPage<DatabaseAdvancedThreatProtection>> ListByDatabaseAsync(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) |
| 65 | + { |
| 66 | + using (var _result = await operations.ListByDatabaseWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) |
| 67 | + { |
| 68 | + return _result.Body; |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// Gets a database's Advanced Threat Protection state. |
| 74 | + /// </summary> |
| 75 | + /// <param name='operations'> |
| 76 | + /// The operations group for this extension method. |
| 77 | + /// </param> |
| 78 | + /// <param name='resourceGroupName'> |
| 79 | + /// The name of the resource group that contains the resource. You can obtain |
| 80 | + /// this value from the Azure Resource Manager API or the portal. |
| 81 | + /// </param> |
| 82 | + /// <param name='serverName'> |
| 83 | + /// The name of the server. |
| 84 | + /// </param> |
| 85 | + /// <param name='databaseName'> |
| 86 | + /// The name of the database. |
| 87 | + /// </param> |
| 88 | + public static DatabaseAdvancedThreatProtection Get(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string resourceGroupName, string serverName, string databaseName) |
| 89 | + { |
| 90 | + return operations.GetAsync(resourceGroupName, serverName, databaseName).GetAwaiter().GetResult(); |
| 91 | + } |
| 92 | + |
| 93 | + /// <summary> |
| 94 | + /// Gets a database's Advanced Threat Protection state. |
| 95 | + /// </summary> |
| 96 | + /// <param name='operations'> |
| 97 | + /// The operations group for this extension method. |
| 98 | + /// </param> |
| 99 | + /// <param name='resourceGroupName'> |
| 100 | + /// The name of the resource group that contains the resource. You can obtain |
| 101 | + /// this value from the Azure Resource Manager API or the portal. |
| 102 | + /// </param> |
| 103 | + /// <param name='serverName'> |
| 104 | + /// The name of the server. |
| 105 | + /// </param> |
| 106 | + /// <param name='databaseName'> |
| 107 | + /// The name of the database. |
| 108 | + /// </param> |
| 109 | + /// <param name='cancellationToken'> |
| 110 | + /// The cancellation token. |
| 111 | + /// </param> |
| 112 | + public static async Task<DatabaseAdvancedThreatProtection> GetAsync(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string resourceGroupName, string serverName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) |
| 113 | + { |
| 114 | + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, null, cancellationToken).ConfigureAwait(false)) |
| 115 | + { |
| 116 | + return _result.Body; |
| 117 | + } |
| 118 | + } |
| 119 | + |
| 120 | + /// <summary> |
| 121 | + /// Creates or updates a database's Advanced Threat Protection state. |
| 122 | + /// </summary> |
| 123 | + /// <param name='operations'> |
| 124 | + /// The operations group for this extension method. |
| 125 | + /// </param> |
| 126 | + /// <param name='resourceGroupName'> |
| 127 | + /// The name of the resource group that contains the resource. You can obtain |
| 128 | + /// this value from the Azure Resource Manager API or the portal. |
| 129 | + /// </param> |
| 130 | + /// <param name='serverName'> |
| 131 | + /// The name of the server. |
| 132 | + /// </param> |
| 133 | + /// <param name='databaseName'> |
| 134 | + /// The name of the database. |
| 135 | + /// </param> |
| 136 | + /// <param name='parameters'> |
| 137 | + /// The database Advanced Threat Protection state. |
| 138 | + /// </param> |
| 139 | + public static DatabaseAdvancedThreatProtection CreateOrUpdate(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseAdvancedThreatProtection parameters) |
| 140 | + { |
| 141 | + return operations.CreateOrUpdateAsync(resourceGroupName, serverName, databaseName, parameters).GetAwaiter().GetResult(); |
| 142 | + } |
| 143 | + |
| 144 | + /// <summary> |
| 145 | + /// Creates or updates a database's Advanced Threat Protection state. |
| 146 | + /// </summary> |
| 147 | + /// <param name='operations'> |
| 148 | + /// The operations group for this extension method. |
| 149 | + /// </param> |
| 150 | + /// <param name='resourceGroupName'> |
| 151 | + /// The name of the resource group that contains the resource. You can obtain |
| 152 | + /// this value from the Azure Resource Manager API or the portal. |
| 153 | + /// </param> |
| 154 | + /// <param name='serverName'> |
| 155 | + /// The name of the server. |
| 156 | + /// </param> |
| 157 | + /// <param name='databaseName'> |
| 158 | + /// The name of the database. |
| 159 | + /// </param> |
| 160 | + /// <param name='parameters'> |
| 161 | + /// The database Advanced Threat Protection state. |
| 162 | + /// </param> |
| 163 | + /// <param name='cancellationToken'> |
| 164 | + /// The cancellation token. |
| 165 | + /// </param> |
| 166 | + public static async Task<DatabaseAdvancedThreatProtection> CreateOrUpdateAsync(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string resourceGroupName, string serverName, string databaseName, DatabaseAdvancedThreatProtection parameters, CancellationToken cancellationToken = default(CancellationToken)) |
| 167 | + { |
| 168 | + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serverName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)) |
| 169 | + { |
| 170 | + return _result.Body; |
| 171 | + } |
| 172 | + } |
| 173 | + |
| 174 | + /// <summary> |
| 175 | + /// Gets a list of database's Advanced Threat Protection states. |
| 176 | + /// </summary> |
| 177 | + /// <param name='operations'> |
| 178 | + /// The operations group for this extension method. |
| 179 | + /// </param> |
| 180 | + /// <param name='nextPageLink'> |
| 181 | + /// The NextLink from the previous successful call to List operation. |
| 182 | + /// </param> |
| 183 | + public static IPage<DatabaseAdvancedThreatProtection> ListByDatabaseNext(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string nextPageLink) |
| 184 | + { |
| 185 | + return operations.ListByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); |
| 186 | + } |
| 187 | + |
| 188 | + /// <summary> |
| 189 | + /// Gets a list of database's Advanced Threat Protection states. |
| 190 | + /// </summary> |
| 191 | + /// <param name='operations'> |
| 192 | + /// The operations group for this extension method. |
| 193 | + /// </param> |
| 194 | + /// <param name='nextPageLink'> |
| 195 | + /// The NextLink from the previous successful call to List operation. |
| 196 | + /// </param> |
| 197 | + /// <param name='cancellationToken'> |
| 198 | + /// The cancellation token. |
| 199 | + /// </param> |
| 200 | + public static async Task<IPage<DatabaseAdvancedThreatProtection>> ListByDatabaseNextAsync(this IDatabaseAdvancedThreatProtectionSettingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) |
| 201 | + { |
| 202 | + using (var _result = await operations.ListByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) |
| 203 | + { |
| 204 | + return _result.Body; |
| 205 | + } |
| 206 | + } |
| 207 | + |
| 208 | + } |
| 209 | +} |
0 commit comments