|
| 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.PowerShell.Cmdlets.Websites.Helper.Network |
| 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 DefaultSecurityRulesOperations. |
| 21 | + /// </summary> |
| 22 | + public static partial class DefaultSecurityRulesOperationsExtensions |
| 23 | + { |
| 24 | + /// <summary> |
| 25 | + /// Gets all default security rules in a network security group. |
| 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. |
| 32 | + /// </param> |
| 33 | + /// <param name='networkSecurityGroupName'> |
| 34 | + /// The name of the network security group. |
| 35 | + /// </param> |
| 36 | + public static IPage<SecurityRule> List(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName) |
| 37 | + { |
| 38 | + return operations.ListAsync(resourceGroupName, networkSecurityGroupName).GetAwaiter().GetResult(); |
| 39 | + } |
| 40 | + |
| 41 | + /// <summary> |
| 42 | + /// Gets all default security rules in a network security group. |
| 43 | + /// </summary> |
| 44 | + /// <param name='operations'> |
| 45 | + /// The operations group for this extension method. |
| 46 | + /// </param> |
| 47 | + /// <param name='resourceGroupName'> |
| 48 | + /// The name of the resource group. |
| 49 | + /// </param> |
| 50 | + /// <param name='networkSecurityGroupName'> |
| 51 | + /// The name of the network security group. |
| 52 | + /// </param> |
| 53 | + /// <param name='cancellationToken'> |
| 54 | + /// The cancellation token. |
| 55 | + /// </param> |
| 56 | + public static async Task<IPage<SecurityRule>> ListAsync(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, CancellationToken cancellationToken = default(CancellationToken)) |
| 57 | + { |
| 58 | + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, null, cancellationToken).ConfigureAwait(false)) |
| 59 | + { |
| 60 | + return _result.Body; |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + /// <summary> |
| 65 | + /// Get the specified default network security rule. |
| 66 | + /// </summary> |
| 67 | + /// <param name='operations'> |
| 68 | + /// The operations group for this extension method. |
| 69 | + /// </param> |
| 70 | + /// <param name='resourceGroupName'> |
| 71 | + /// The name of the resource group. |
| 72 | + /// </param> |
| 73 | + /// <param name='networkSecurityGroupName'> |
| 74 | + /// The name of the network security group. |
| 75 | + /// </param> |
| 76 | + /// <param name='defaultSecurityRuleName'> |
| 77 | + /// The name of the default security rule. |
| 78 | + /// </param> |
| 79 | + public static SecurityRule Get(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName) |
| 80 | + { |
| 81 | + return operations.GetAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName).GetAwaiter().GetResult(); |
| 82 | + } |
| 83 | + |
| 84 | + /// <summary> |
| 85 | + /// Get the specified default network security rule. |
| 86 | + /// </summary> |
| 87 | + /// <param name='operations'> |
| 88 | + /// The operations group for this extension method. |
| 89 | + /// </param> |
| 90 | + /// <param name='resourceGroupName'> |
| 91 | + /// The name of the resource group. |
| 92 | + /// </param> |
| 93 | + /// <param name='networkSecurityGroupName'> |
| 94 | + /// The name of the network security group. |
| 95 | + /// </param> |
| 96 | + /// <param name='defaultSecurityRuleName'> |
| 97 | + /// The name of the default security rule. |
| 98 | + /// </param> |
| 99 | + /// <param name='cancellationToken'> |
| 100 | + /// The cancellation token. |
| 101 | + /// </param> |
| 102 | + public static async Task<SecurityRule> GetAsync(this IDefaultSecurityRulesOperations operations, string resourceGroupName, string networkSecurityGroupName, string defaultSecurityRuleName, CancellationToken cancellationToken = default(CancellationToken)) |
| 103 | + { |
| 104 | + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName, null, cancellationToken).ConfigureAwait(false)) |
| 105 | + { |
| 106 | + return _result.Body; |
| 107 | + } |
| 108 | + } |
| 109 | + |
| 110 | + /// <summary> |
| 111 | + /// Gets all default security rules in a network security group. |
| 112 | + /// </summary> |
| 113 | + /// <param name='operations'> |
| 114 | + /// The operations group for this extension method. |
| 115 | + /// </param> |
| 116 | + /// <param name='nextPageLink'> |
| 117 | + /// The NextLink from the previous successful call to List operation. |
| 118 | + /// </param> |
| 119 | + public static IPage<SecurityRule> ListNext(this IDefaultSecurityRulesOperations operations, string nextPageLink) |
| 120 | + { |
| 121 | + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); |
| 122 | + } |
| 123 | + |
| 124 | + /// <summary> |
| 125 | + /// Gets all default security rules in a network security group. |
| 126 | + /// </summary> |
| 127 | + /// <param name='operations'> |
| 128 | + /// The operations group for this extension method. |
| 129 | + /// </param> |
| 130 | + /// <param name='nextPageLink'> |
| 131 | + /// The NextLink from the previous successful call to List operation. |
| 132 | + /// </param> |
| 133 | + /// <param name='cancellationToken'> |
| 134 | + /// The cancellation token. |
| 135 | + /// </param> |
| 136 | + public static async Task<IPage<SecurityRule>> ListNextAsync(this IDefaultSecurityRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) |
| 137 | + { |
| 138 | + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) |
| 139 | + { |
| 140 | + return _result.Body; |
| 141 | + } |
| 142 | + } |
| 143 | + |
| 144 | + } |
| 145 | +} |
0 commit comments