/// <summary> /// List policies in a given policy set. /// </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 <Policy> > ListNextAsync(this IPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// The policy for a given billing account name and billing profile name. /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// billing Account Id. /// </param> /// <param name='billingProfileName'> /// Billing Profile Id. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Policy> GetByBillingProfileNameAsync(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetByBillingProfileNameWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Modify properties of policies. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='name'> /// The name of the policy. /// </param> /// <param name='policy'> /// A Policy. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Policy> UpdateAsync(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, PolicyFragment policy, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, policySetName, name, policy, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Updates the policies for a customer. This operation is supported only for /// billing accounts with agreement type Microsoft Partner Agreement. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// The ID that uniquely identifies a billing account. /// </param> /// <param name='customerName'> /// The ID that uniquely identifies a customer. /// </param> /// <param name='parameters'> /// Request parameters that are provided to the update policies operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <CustomerPolicy> UpdateCustomerAsync(this IPoliciesOperations operations, string billingAccountName, string customerName, CustomerPolicy parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateCustomerWithHttpMessagesAsync(billingAccountName, customerName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='name'> /// The name of the policy. /// </param> /// <param name='expand'> /// Specify the $expand query. Example: 'properties($select=description)' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyInner> GetAsync(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, policySetName, name, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Update an existing CdnWebApplicationFirewallPolicy with the specified /// policy name under the specified subscription and resource group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the CdnWebApplicationFirewallPolicy. /// </param> /// <param name='tags'> /// CdnWebApplicationFirewallPolicy tags /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <CdnWebApplicationFirewallPolicy> BeginUpdateAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, IDictionary <string, string> tags = default(IDictionary <string, string>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, policyName, tags, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve protection policy with specified name within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the Web Application Firewall Policy. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <WebApplicationFirewallPolicy> GetAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List policies in a given policy set. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Policy> > ListAsync(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, ODataQuery <Policy> odataQuery = default(ODataQuery <Policy>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, policySetName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { FrontDoors = new FrontDoorsOperations(this); RoutingRules = new RoutingRulesOperations(this); HealthProbeSettings = new HealthProbeSettingsOperations(this); LoadBalancingSettings = new LoadBalancingSettingsOperations(this); BackendPools = new BackendPoolsOperations(this); FrontendEndpoints = new FrontendEndpointsOperations(this); Endpoints = new EndpointsOperations(this); Policies = new PoliciesOperations(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 <ManagedRuleSet>("ruleSetType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <ManagedRuleSet>("ruleSetType")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Lists all of the protection policies within a resource group. /// </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 <WebApplicationFirewallPolicy> ListNext(this IPoliciesOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Deletes Policy /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the Web Application Firewall Policy. /// </param> public static void BeginDelete(this IPoliciesOperations operations, string resourceGroupName, string policyName) { operations.BeginDeleteAsync(resourceGroupName, policyName).GetAwaiter().GetResult(); }
/// <summary> /// Deletes Policy /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the Web Application Firewall Policy. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginDeleteAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Delete policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='name'> /// The name of the policy. /// </param> public static void Delete(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name) { operations.DeleteAsync(resourceGroupName, labName, policySetName, name).GetAwaiter().GetResult(); }
/// <summary> /// Create or update policy with specified rule set name within a resource /// group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the Web Application Firewall Policy. /// </param> /// <param name='parameters'> /// Policy to be created. /// </param> public static WebApplicationFirewallPolicy BeginCreateOrUpdate(this IPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters) { return(operations.BeginCreateOrUpdateAsync(resourceGroupName, policyName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Updates the policies for a customer. This operation is supported only for /// billing accounts with agreement type Microsoft Partner Agreement. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// The ID that uniquely identifies a billing account. /// </param> /// <param name='customerName'> /// The ID that uniquely identifies a customer. /// </param> /// <param name='parameters'> /// Request parameters that are provided to the update policies operation. /// </param> public static CustomerPolicy UpdateCustomer(this IPoliciesOperations operations, string billingAccountName, string customerName, CustomerPolicy parameters) { return(operations.UpdateCustomerAsync(billingAccountName, customerName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Update an existing CdnWebApplicationFirewallPolicy with the specified /// policy name under the specified subscription and resource group /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the CdnWebApplicationFirewallPolicy. /// </param> /// <param name='tags'> /// CdnWebApplicationFirewallPolicy tags /// </param> public static CdnWebApplicationFirewallPolicy BeginUpdate(this IPoliciesOperations operations, string resourceGroupName, string policyName, IDictionary <string, string> tags = default(IDictionary <string, string>)) { return(operations.BeginUpdateAsync(resourceGroupName, policyName, tags).GetAwaiter().GetResult()); }
/// <summary> /// Modify properties of policies. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='name'> /// The name of the policy. /// </param> /// <param name='policy'> /// A Policy. /// </param> public static Policy Update(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, PolicyFragment policy) { return(operations.UpdateAsync(resourceGroupName, labName, policySetName, name, policy).GetAwaiter().GetResult()); }
/// <summary> /// List policies in a given policy set. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <Policy> List(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, ODataQuery <Policy> odataQuery = default(ODataQuery <Policy>)) { return(operations.ListAsync(resourceGroupName, labName, policySetName, odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// Lists all of the protection policies within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> public static IPage <WebApplicationFirewallPolicy> List(this IPoliciesOperations operations, string resourceGroupName) { return(operations.ListAsync(resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Retrieve protection policy with specified name within a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the Web Application Firewall Policy. /// </param> public static WebApplicationFirewallPolicy Get(this IPoliciesOperations operations, string resourceGroupName, string policyName) { return(operations.GetAsync(resourceGroupName, policyName).GetAwaiter().GetResult()); }
/// <summary> /// Get policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='name'> /// The name of the policy. /// </param> /// <param name='expand'> /// Specify the $expand query. Example: 'properties($select=description)' /// </param> public static Policy Get(this IPoliciesOperations operations, string resourceGroupName, string labName, string policySetName, string name, string expand = default(string)) { return(operations.GetAsync(resourceGroupName, labName, policySetName, name, expand).GetAwaiter().GetResult()); }
/// <summary> /// The policy for a given billing account name and billing profile name. /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// billing Account Id. /// </param> /// <param name='billingProfileName'> /// Billing Profile Id. /// </param> public static Policy GetByBillingProfileName(this IPoliciesOperations operations, string billingAccountName, string billingProfileName) { return(operations.GetByBillingProfileNameAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult()); }
/// <summary> /// Lists the policies for a customer. This operation is supported only for /// billing accounts with agreement type Microsoft Partner Agreement. /// <see href="https://docs.microsoft.com/en-us/rest/api/billing/" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// The ID that uniquely identifies a billing account. /// </param> /// <param name='customerName'> /// The ID that uniquely identifies a customer. /// </param> public static CustomerPolicy GetByCustomer(this IPoliciesOperations operations, string billingAccountName, string customerName) { return(operations.GetByCustomerAsync(billingAccountName, customerName).GetAwaiter().GetResult()); }
/// <summary> /// The operation to update a policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// billing Account Id. /// </param> /// <param name='billingProfileName'> /// Billing Profile Id. /// </param> /// <param name='parameters'> /// Parameters supplied to the update policy operation. /// </param> public static Policy Update(this IPoliciesOperations operations, string billingAccountName, string billingProfileName, Policy parameters) { return(operations.UpdateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Create or update policy with specified rule set name within a resource /// group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Name of the Resource group within the Azure subscription. /// </param> /// <param name='policyName'> /// The name of the CdnWebApplicationFirewallPolicy. /// </param> /// <param name='cdnWebApplicationFirewallPolicy'> /// Policy to be created. /// </param> public static CdnWebApplicationFirewallPolicy CreateOrUpdate(this IPoliciesOperations operations, string resourceGroupName, string policyName, CdnWebApplicationFirewallPolicy cdnWebApplicationFirewallPolicy) { return(operations.CreateOrUpdateAsync(resourceGroupName, policyName, cdnWebApplicationFirewallPolicy).GetAwaiter().GetResult()); }