/// <summary> /// Gets a single Adaptive Network Hardening resource /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='resourceNamespace'> /// The Namespace of the resource. /// </param> /// <param name='resourceType'> /// The type of the resource. /// </param> /// <param name='resourceName'> /// Name of the resource. /// </param> /// <param name='adaptiveNetworkHardeningResourceName'> /// The name of the Adaptive Network Hardening resource. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AdaptiveNetworkHardening> GetAsync(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Pricings = new PricingsOperations(this); SecurityContacts = new SecurityContactsOperations(this); WorkspaceSettings = new WorkspaceSettingsOperations(this); AutoProvisioningSettings = new AutoProvisioningSettingsOperations(this); Compliances = new CompliancesOperations(this); AdvancedThreatProtection = new AdvancedThreatProtectionOperations(this); DeviceSecurityGroups = new DeviceSecurityGroupsOperations(this); Settings = new SettingsOperations(this); InformationProtectionPolicies = new InformationProtectionPoliciesOperations(this); Operations = new Operations(this); Locations = new LocationsOperations(this); Tasks = new TasksOperations(this); Alerts = new AlertsOperations(this); DiscoveredSecuritySolutions = new DiscoveredSecuritySolutionsOperations(this); JitNetworkAccessPolicies = new JitNetworkAccessPoliciesOperations(this); ExternalSecuritySolutions = new ExternalSecuritySolutionsOperations(this); Topology = new TopologyOperations(this); AllowedConnections = new AllowedConnectionsOperations(this); AdaptiveNetworkHardenings = new AdaptiveNetworkHardeningsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <ExternalSecuritySolution>("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ExternalSecuritySolution>("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Gets a list of Adaptive Network Hardenings resources in scope of an /// extended resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='resourceNamespace'> /// The Namespace of the resource. /// </param> /// <param name='resourceType'> /// The type of the resource. /// </param> /// <param name='resourceName'> /// Name of the resource. /// </param> public static IPage <AdaptiveNetworkHardening> ListByExtendedResource(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) { return(operations.ListByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).GetAwaiter().GetResult()); }
/// <summary> /// Gets a list of Adaptive Network Hardenings resources in scope of an /// extended resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <AdaptiveNetworkHardening> > ListByExtendedResourceNextAsync(this IAdaptiveNetworkHardeningsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByExtendedResourceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a list of Adaptive Network Hardenings resources in scope of an /// extended resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <AdaptiveNetworkHardening> ListByExtendedResourceNext(this IAdaptiveNetworkHardeningsOperations operations, string nextPageLink) { return(operations.ListByExtendedResourceNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Enforces the given rules on the NSG(s) listed in the request /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='resourceNamespace'> /// The Namespace of the resource. /// </param> /// <param name='resourceType'> /// The type of the resource. /// </param> /// <param name='resourceName'> /// Name of the resource. /// </param> /// <param name='adaptiveNetworkHardeningResourceName'> /// The name of the Adaptive Network Hardening resource. /// </param> /// <param name='rules'> /// The rules to enforce /// </param> /// <param name='networkSecurityGroups'> /// The Azure resource IDs of the effective network security groups that will /// be updated with the created security rules from the Adaptive Network /// Hardening rules /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginEnforceAsync(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList <Rule> rules, IList <string> networkSecurityGroups, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginEnforceWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, rules, networkSecurityGroups, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Enforces the given rules on the NSG(s) listed in the request /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='resourceNamespace'> /// The Namespace of the resource. /// </param> /// <param name='resourceType'> /// The type of the resource. /// </param> /// <param name='resourceName'> /// Name of the resource. /// </param> /// <param name='adaptiveNetworkHardeningResourceName'> /// The name of the Adaptive Network Hardening resource. /// </param> /// <param name='rules'> /// The rules to enforce /// </param> /// <param name='networkSecurityGroups'> /// The Azure resource IDs of the effective network security groups that will /// be updated with the created security rules from the Adaptive Network /// Hardening rules /// </param> public static void BeginEnforce(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList <Rule> rules, IList <string> networkSecurityGroups) { operations.BeginEnforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, rules, networkSecurityGroups).GetAwaiter().GetResult(); }
/// <summary> /// Gets a single Adaptive Network Hardening resource /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group within the user's subscription. The name is /// case insensitive. /// </param> /// <param name='resourceNamespace'> /// The Namespace of the resource. /// </param> /// <param name='resourceType'> /// The type of the resource. /// </param> /// <param name='resourceName'> /// Name of the resource. /// </param> /// <param name='adaptiveNetworkHardeningResourceName'> /// The name of the Adaptive Network Hardening resource. /// </param> public static AdaptiveNetworkHardening Get(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName) { return(operations.GetAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName).GetAwaiter().GetResult()); }