diff --git a/src/SDKs/FrontDoor/AzSdk.RP.props b/src/SDKs/FrontDoor/AzSdk.RP.props
index cdcc60067252..b7c3b1f681e6 100644
--- a/src/SDKs/FrontDoor/AzSdk.RP.props
+++ b/src/SDKs/FrontDoor/AzSdk.RP.props
@@ -1,7 +1,7 @@
- Network_2018-08-01;
+ Network_2018-08-01;Network_2019-03-01;
$(PackageTags);$(CommonTags);$(AzureApiTag);
\ No newline at end of file
diff --git a/src/SDKs/FrontDoor/FrontDoor.Tests/ScenarioTests/FrontDoorTests.cs b/src/SDKs/FrontDoor/FrontDoor.Tests/ScenarioTests/FrontDoorTests.cs
index 3752f04a0482..1863dc47d542 100644
--- a/src/SDKs/FrontDoor/FrontDoor.Tests/ScenarioTests/FrontDoorTests.cs
+++ b/src/SDKs/FrontDoor/FrontDoor.Tests/ScenarioTests/FrontDoorTests.cs
@@ -155,31 +155,35 @@ public void WAFCRUDTest()
// Create a frontDoor
string policyName = TestUtilities.GenerateName("policy");
- WebApplicationFirewallPolicy1 createParameters = new WebApplicationFirewallPolicy1
+ WebApplicationFirewallPolicy createParameters = new WebApplicationFirewallPolicy
{
Location = "global",
Tags = new Dictionary
- {
- {"key1","value1"},
- {"key2","value2"}
- },
+ {
+ {"key1","value1"},
+ {"key2","value2"}
+ },
PolicySettings = new PolicySettings
{
EnabledState = "Enabled",
- Mode = "Prevention"
+ Mode = "Prevention",
+ CustomBlockResponseBody = "PGh0bWw+SGVsbG88L2h0bWw+",
+ CustomBlockResponseStatusCode = 403,
+ RedirectUrl = "http://www.bing.com"
},
- CustomRules = new CustomRules(
+ CustomRules = new CustomRuleList(
new List
{
new CustomRule
{
Name = "rule1",
+ EnabledState = "Enabled",
Priority = 1,
RuleType = "RateLimitRule",
RateLimitThreshold = 1000,
- MatchConditions = new List
+ MatchConditions = new List
{
- new MatchCondition1
+ new MatchCondition
{
MatchVariable = "RemoteAddr",
OperatorProperty = "IPMatch",
@@ -194,18 +198,27 @@ public void WAFCRUDTest()
}
}
),
- ManagedRules = new ManagedRuleSets(
+ ManagedRules = new ManagedRuleSetList(
new List {
- new AzureManagedRuleSet
+ new ManagedRuleSet
{
- Priority = 1,
- RuleGroupOverrides = new List
+ RuleSetType = "DefaultRuleSet",
+ RuleSetVersion = "1.0",
+ RuleGroupOverrides = new List
{
- new AzureManagedOverrideRuleGroup
+ new ManagedRuleGroupOverride
{
- RuleGroupOverride = "SqlInjection",
- Action = "Block"
- },
+ RuleGroupName = "SQLI",
+ Rules = new List
+ {
+ new ManagedRuleOverride
+ {
+ RuleId = "Rule1",
+ Action = "Redirect",
+ EnabledState = "Disabled"
+ }
+ }
+ }
}
}
@@ -230,9 +243,9 @@ public void WAFCRUDTest()
Name = "rule2",
Priority = 2,
RuleType = "MatchRule",
- MatchConditions = new List
+ MatchConditions = new List
{
- new MatchCondition1
+ new MatchCondition
{
MatchVariable = "RemoteAddr",
OperatorProperty = "GeoMatch",
@@ -247,7 +260,7 @@ public void WAFCRUDTest()
retrievedPolicy.CustomRules.Rules.Add(geoFilter);
- var updatedPolicy = frontDoorMgmtClient.Policies.CreateOrUpdate(resourceGroupName,policyName, retrievedPolicy);
+ var updatedPolicy = frontDoorMgmtClient.Policies.CreateOrUpdate(resourceGroupName, policyName, retrievedPolicy);
// validate that Policy is correctly updated
VerifyPolicy(updatedPolicy, retrievedPolicy);
@@ -264,15 +277,19 @@ public void WAFCRUDTest()
FrontDoorTestUtilities.DeleteResourceGroup(resourcesClient, resourceGroupName);
}
}
- private static void VerifyPolicy(WebApplicationFirewallPolicy1 policy, WebApplicationFirewallPolicy1 parameters)
+
+ private static void VerifyPolicy(WebApplicationFirewallPolicy policy, WebApplicationFirewallPolicy parameters)
{
Assert.Equal(policy.Location.ToLower(), parameters.Location.ToLower());
Assert.Equal(policy.Tags.Count, parameters.Tags.Count);
Assert.True(policy.Tags.SequenceEqual(parameters.Tags));
Assert.Equal(policy.PolicySettings.EnabledState, parameters.PolicySettings.EnabledState);
Assert.Equal(policy.PolicySettings.Mode, parameters.PolicySettings.Mode);
+ Assert.Equal(policy.PolicySettings.CustomBlockResponseBody, parameters.PolicySettings.CustomBlockResponseBody);
+ Assert.Equal(policy.PolicySettings.CustomBlockResponseStatusCode, parameters.PolicySettings.CustomBlockResponseStatusCode);
+ Assert.Equal(policy.PolicySettings.RedirectUrl, parameters.PolicySettings.RedirectUrl);
Assert.Equal(policy.CustomRules.Rules.Count, parameters.CustomRules.Rules.Count);
- Assert.Equal(policy.ManagedRules.RuleSets.Count, parameters.ManagedRules.RuleSets.Count);
+ Assert.Equal(policy.ManagedRules.ManagedRuleSets.Count, parameters.ManagedRules.ManagedRuleSets.Count);
}
private static void VerifyFrontDoor(FrontDoorModel frontDoor, FrontDoorModel parameters)
diff --git a/src/SDKs/FrontDoor/FrontDoor.Tests/SessionRecords/FrontDoor.Tests.ScenarioTests.FrontDoorTests/WAFCRUDTest.json b/src/SDKs/FrontDoor/FrontDoor.Tests/SessionRecords/FrontDoor.Tests.ScenarioTests.FrontDoorTests/WAFCRUDTest.json
index c9737508f518..46bc62f1140e 100644
--- a/src/SDKs/FrontDoor/FrontDoor.Tests/SessionRecords/FrontDoor.Tests.ScenarioTests.FrontDoorTests/WAFCRUDTest.json
+++ b/src/SDKs/FrontDoor/FrontDoor.Tests/SessionRecords/FrontDoor.Tests.ScenarioTests.FrontDoorTests/WAFCRUDTest.json
@@ -65,10 +65,10 @@
"StatusCode": 201
},
{
- "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2018-08-01",
- "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE4LTA4LTAx",
+ "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2019-03-01",
+ "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE5LTAzLTAx",
"RequestMethod": "PUT",
- "RequestBody": "{\r\n \"properties\": {\r\n \"policySettings\": {\r\n \"enabledState\": \"Enabled\",\r\n \"mode\": \"Prevention\"\r\n },\r\n \"customRules\": {\r\n \"rules\": [\r\n {\r\n \"name\": \"rule1\",\r\n \"priority\": 1,\r\n \"ruleType\": \"RateLimitRule\",\r\n \"rateLimitThreshold\": 1000,\r\n \"matchConditions\": [\r\n {\r\n \"matchVariable\": \"RemoteAddr\",\r\n \"operator\": \"IPMatch\",\r\n \"matchValue\": [\r\n \"192.168.1.0/24\",\r\n \"10.0.0.0/24\"\r\n ]\r\n }\r\n ],\r\n \"action\": \"Block\"\r\n }\r\n ]\r\n },\r\n \"managedRules\": {\r\n \"ruleSets\": [\r\n {\r\n \"ruleSetType\": \"AzureManagedRuleSet\",\r\n \"ruleGroupOverrides\": [\r\n {\r\n \"ruleGroupOverride\": \"SqlInjection\",\r\n \"action\": \"Block\"\r\n }\r\n ],\r\n \"priority\": 1\r\n }\r\n ]\r\n }\r\n },\r\n \"location\": \"global\",\r\n \"tags\": {\r\n \"key1\": \"value1\",\r\n \"key2\": \"value2\"\r\n }\r\n}",
+ "RequestBody": "{\"properties\":{\"policySettings\":{\"enabledState\":\"Enabled\",\"mode\":\"Prevention\",\"CustomBlockResponseBody\":\"PGh0bWw+SGVsbG88L2h0bWw+\",\"CustomBlockResponseStatusCode\":403,\"RedirectUrl\":\"http://www.bing.com\"},\"customRules\":{\"rules\":[{\"name\":\"rule1\",\"enabledState\":\"Enabled\",\"priority\":1,\"ruleType\":\"RateLimitRule\",\"rateLimitThreshold\":1000,\"matchConditions\":[{\"matchVariable\":\"RemoteAddr\",\"operator\":\"IPMatch\",\"matchValue\":[\"192.168.1.0/24\",\"10.0.0.0/24\"]}],\"action\":\"Block\"}]},\"managedRules\":{\"managedRuleSets\":[{\"ruleSetType\":\"DefaultRuleSet\",\"ruleSetVersion\":\"1.0\",\"ruleGroupOverrides\":[{\"ruleGroupOverride\":\"SQLI\",\"rules\":[{\"ruleId\":\"Rule1\",\"action\":\"Redirect\",\"enabledState\":\"Disabled\"}]}]}]}},\"location\":\"global\",\"tags\":{\"key1\":\"value1\",\"key2\":\"value2\"}}",
"RequestHeaders": {
"x-ms-client-request-id": [
"0069e083-3f70-4205-a17d-44eaff90b558"
@@ -140,14 +140,14 @@
"-1"
]
},
- "ResponseBody": "{\r\n \"name\": \"policy5844\",\r\n \"id\": \"/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourcegroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/policy5844\",\r\n \"type\": \"Microsoft.Network/frontdoorwebapplicationfirewallpolicies\",\r\n \"tags\": {\r\n \"key1\": \"value1\",\r\n \"key2\": \"value2\"\r\n },\r\n \"location\": \"Global\",\r\n \"properties\": {\r\n \"resourceState\": \"Enabled\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"policySettings\": {\r\n \"enabledState\": \"Enabled\",\r\n \"mode\": \"Prevention\"\r\n },\r\n \"customRules\": {\r\n \"rules\": [\r\n {\r\n \"name\": \"rule1\",\r\n \"priority\": 1,\r\n \"ruleType\": \"RateLimitRule\",\r\n \"rateLimitDurationInMinutes\": 0,\r\n \"rateLimitThreshold\": 1000,\r\n \"matchConditions\": [\r\n {\r\n \"matchVariable\": \"RemoteAddr\",\r\n \"selector\": null,\r\n \"operator\": \"IPMatch\",\r\n \"negateCondition\": false,\r\n \"matchValue\": [\r\n \"192.168.1.0/24\",\r\n \"10.0.0.0/24\"\r\n ]\r\n }\r\n ],\r\n \"action\": \"Block\",\r\n \"transforms\": []\r\n }\r\n ]\r\n },\r\n \"managedRules\": {\r\n \"ruleSets\": [\r\n {\r\n \"priority\": 1,\r\n \"version\": 0,\r\n \"ruleSetType\": \"AzureManagedRuleSet\",\r\n \"ruleGroupOverrides\": [\r\n {\r\n \"ruleGroupOverride\": \"SqlInjection\",\r\n \"action\": \"Block\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n}",
+ "ResponseBody": "{\"name\":\"policy5844\",\"id\":\"/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourcegroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/policy5844\",\"type\":\"Microsoft.Network/frontdoorwebapplicationfirewallpolicies\",\"tags\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"location\":\"Global\",\"properties\":{\"resourceState\":\"Enabled\",\"provisioningState\":\"Succeeded\",\"policySettings\":{\"enabledState\":\"Enabled\",\"mode\":\"Prevention\",\"CustomBlockResponseBody\":\"PGh0bWw+SGVsbG88L2h0bWw+\",\"CustomBlockResponseStatusCode\":403,\"RedirectUrl\":\"http://www.bing.com\"},\"customRules\":{\"rules\":[{\"name\":\"rule1\",\"enabledState\":\"Enabled\",\"priority\":1,\"ruleType\":\"RateLimitRule\",\"rateLimitDurationInMinutes\":0,\"rateLimitThreshold\":1000,\"matchConditions\":[{\"matchVariable\":\"RemoteAddr\",\"selector\":null,\"operator\":\"IPMatch\",\"negateCondition\":false,\"matchValue\":[\"192.168.1.0/24\",\"10.0.0.0/24\"]}],\"action\":\"Block\",\"transforms\":[]}]},\"managedRules\":{\"managedRuleSets\":[{\"ruleSetType\":\"DefaultRuleSet\",\"ruleSetVersion\":\"1.0\",\"ruleGroupOverrides\":[{\"ruleGroupOverride\":\"SQLI\",\"rules\":[{\"ruleId\":\"Rule1\",\"action\":\"Redirect\",\"enabledState\":\"Disabled\"}]}]}]}}}",
"StatusCode": 201
},
{
- "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2018-08-01",
- "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE4LTA4LTAx",
+ "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2019-03-01",
+ "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE5LTAzLTAx",
"RequestMethod": "PUT",
- "RequestBody": "{\r\n \"properties\": {\r\n \"policySettings\": {\r\n \"enabledState\": \"Enabled\",\r\n \"mode\": \"Prevention\"\r\n },\r\n \"customRules\": {\r\n \"rules\": [\r\n {\r\n \"name\": \"rule1\",\r\n \"priority\": 1,\r\n \"ruleType\": \"RateLimitRule\",\r\n \"rateLimitDurationInMinutes\": 0,\r\n \"rateLimitThreshold\": 1000,\r\n \"matchConditions\": [\r\n {\r\n \"matchVariable\": \"RemoteAddr\",\r\n \"operator\": \"IPMatch\",\r\n \"negateCondition\": false,\r\n \"matchValue\": [\r\n \"192.168.1.0/24\",\r\n \"10.0.0.0/24\"\r\n ]\r\n }\r\n ],\r\n \"action\": \"Block\",\r\n \"transforms\": []\r\n },\r\n {\r\n \"name\": \"rule2\",\r\n \"priority\": 2,\r\n \"ruleType\": \"MatchRule\",\r\n \"matchConditions\": [\r\n {\r\n \"matchVariable\": \"RemoteAddr\",\r\n \"operator\": \"GeoMatch\",\r\n \"matchValue\": [\r\n \"US\"\r\n ]\r\n }\r\n ],\r\n \"action\": \"Allow\"\r\n }\r\n ]\r\n },\r\n \"managedRules\": {\r\n \"ruleSets\": [\r\n {\r\n \"ruleSetType\": \"AzureManagedRuleSet\",\r\n \"ruleGroupOverrides\": [\r\n {\r\n \"ruleGroupOverride\": \"SqlInjection\",\r\n \"action\": \"Block\"\r\n }\r\n ],\r\n \"priority\": 1,\r\n \"version\": 0\r\n }\r\n ]\r\n }\r\n },\r\n \"location\": \"Global\",\r\n \"tags\": {\r\n \"key1\": \"value1\",\r\n \"key2\": \"value2\"\r\n }\r\n}",
+ "RequestBody": "{\"properties\":{\"policySettings\":{\"enabledState\":\"Enabled\",\"mode\":\"Prevention\",\"CustomBlockResponseBody\":\"PGh0bWw+SGVsbG88L2h0bWw+\",\"CustomBlockResponseStatusCode\":403,\"RedirectUrl\":\"http://www.bing.com\"},\"customRules\":{\"rules\":[{\"name\":\"rule1\",\"enabledState\":\"Enabled\",\"priority\":1,\"ruleType\":\"RateLimitRule\",\"rateLimitDurationInMinutes\":0,\"rateLimitThreshold\":1000,\"matchConditions\":[{\"matchVariable\":\"RemoteAddr\",\"operator\":\"IPMatch\",\"negateCondition\":false,\"matchValue\":[\"192.168.1.0/24\",\"10.0.0.0/24\"]}],\"action\":\"Block\",\"transforms\":[]},{\"name\":\"rule2\",\"priority\":2,\"ruleType\":\"MatchRule\",\"matchConditions\":[{\"matchVariable\":\"RemoteAddr\",\"operator\":\"GeoMatch\",\"matchValue\":[\"US\"]}],\"action\":\"Allow\"}]},\"managedRules\":{\"managedRuleSets\":[{\"ruleSetType\":\"DefaultRuleSet\",\"ruleSetVersion\":\"1.0\",\"ruleGroupOverrides\":[{\"ruleGroupOverride\":\"SQLI\",\"rules\":[{\"ruleId\":\"Rule1\",\"action\":\"Redirect\",\"enabledState\":\"Disabled\"}]}]}]}},\"location\":\"Global\",\"tags\":{\"key1\":\"value1\",\"key2\":\"value2\"}}",
"RequestHeaders": {
"x-ms-client-request-id": [
"c1a66360-0de2-4fd5-b0df-3e3011afad24"
@@ -219,12 +219,12 @@
"-1"
]
},
- "ResponseBody": "{\r\n \"name\": \"policy5844\",\r\n \"id\": \"/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourcegroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/policy5844\",\r\n \"type\": \"Microsoft.Network/frontdoorwebapplicationfirewallpolicies\",\r\n \"tags\": {\r\n \"key1\": \"value1\",\r\n \"key2\": \"value2\"\r\n },\r\n \"location\": \"Global\",\r\n \"properties\": {\r\n \"resourceState\": \"Enabled\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"policySettings\": {\r\n \"enabledState\": \"Enabled\",\r\n \"mode\": \"Prevention\"\r\n },\r\n \"customRules\": {\r\n \"rules\": [\r\n {\r\n \"name\": \"rule1\",\r\n \"priority\": 1,\r\n \"ruleType\": \"RateLimitRule\",\r\n \"rateLimitDurationInMinutes\": 0,\r\n \"rateLimitThreshold\": 1000,\r\n \"matchConditions\": [\r\n {\r\n \"matchVariable\": \"RemoteAddr\",\r\n \"selector\": null,\r\n \"operator\": \"IPMatch\",\r\n \"negateCondition\": false,\r\n \"matchValue\": [\r\n \"192.168.1.0/24\",\r\n \"10.0.0.0/24\"\r\n ]\r\n }\r\n ],\r\n \"action\": \"Block\",\r\n \"transforms\": []\r\n },\r\n {\r\n \"name\": \"rule2\",\r\n \"priority\": 2,\r\n \"ruleType\": \"MatchRule\",\r\n \"rateLimitDurationInMinutes\": 0,\r\n \"rateLimitThreshold\": 0,\r\n \"matchConditions\": [\r\n {\r\n \"matchVariable\": \"RemoteAddr\",\r\n \"selector\": null,\r\n \"operator\": \"GeoMatch\",\r\n \"negateCondition\": false,\r\n \"matchValue\": [\r\n \"US\"\r\n ]\r\n }\r\n ],\r\n \"action\": \"Allow\",\r\n \"transforms\": []\r\n }\r\n ]\r\n },\r\n \"managedRules\": {\r\n \"ruleSets\": [\r\n {\r\n \"priority\": 1,\r\n \"version\": 0,\r\n \"ruleSetType\": \"AzureManagedRuleSet\",\r\n \"ruleGroupOverrides\": [\r\n {\r\n \"ruleGroupOverride\": \"SqlInjection\",\r\n \"action\": \"Block\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n}",
+ "ResponseBody": "{\"name\":\"policy5844\",\"id\":\"/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourcegroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/policy5844\",\"type\":\"Microsoft.Network/frontdoorwebapplicationfirewallpolicies\",\"tags\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"location\":\"Global\",\"properties\":{\"resourceState\":\"Enabled\",\"provisioningState\":\"Succeeded\",\"policySettings\":{\"enabledState\":\"Enabled\",\"mode\":\"Prevention\",\"CustomBlockResponseBody\":\"PGh0bWw+SGVsbG88L2h0bWw+\",\"CustomBlockResponseStatusCode\":403,\"RedirectUrl\":\"http://www.bing.com\"},\"customRules\":{\"rules\":[{\"name\":\"rule1\",\"enabledState\":\"Enabled\",\"priority\":1,\"ruleType\":\"RateLimitRule\",\"rateLimitDurationInMinutes\":0,\"rateLimitThreshold\":1000,\"matchConditions\":[{\"matchVariable\":\"RemoteAddr\",\"selector\":null,\"operator\":\"IPMatch\",\"negateCondition\":false,\"matchValue\":[\"192.168.1.0/24\",\"10.0.0.0/24\"]}],\"action\":\"Block\",\"transforms\":[]},{\"name\":\"rule2\",\"priority\":2,\"ruleType\":\"MatchRule\",\"rateLimitDurationInMinutes\":0,\"rateLimitThreshold\":0,\"matchConditions\":[{\"matchVariable\":\"RemoteAddr\",\"selector\":null,\"operator\":\"GeoMatch\",\"negateCondition\":false,\"matchValue\":[\"US\"]}],\"action\":\"Allow\",\"transforms\":[]}]},\"managedRules\":{\"managedRuleSets\":[{\"ruleSetType\":\"DefaultRuleSet\",\"ruleSetVersion\":\"1.0\",\"ruleGroupOverrides\":[{\"ruleGroupOverride\":\"SQLI\",\"rules\":[{\"ruleId\":\"Rule1\",\"action\":\"Redirect\",\"enabledState\":\"Disabled\"}]}]}]}}}",
"StatusCode": 200
},
{
- "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2018-08-01",
- "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE4LTA4LTAx",
+ "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2019-03-01",
+ "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE5LTAzLTAx",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
@@ -292,12 +292,12 @@
"-1"
]
},
- "ResponseBody": "{\r\n \"name\": \"policy5844\",\r\n \"id\": \"/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourcegroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/policy5844\",\r\n \"type\": \"Microsoft.Network/frontdoorwebapplicationfirewallpolicies\",\r\n \"tags\": {\r\n \"key1\": \"value1\",\r\n \"key2\": \"value2\"\r\n },\r\n \"location\": \"Global\",\r\n \"properties\": {\r\n \"resourceState\": \"Enabled\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"policySettings\": {\r\n \"enabledState\": \"Enabled\",\r\n \"mode\": \"Prevention\"\r\n },\r\n \"customRules\": {\r\n \"rules\": [\r\n {\r\n \"name\": \"rule1\",\r\n \"priority\": 1,\r\n \"ruleType\": \"RateLimitRule\",\r\n \"rateLimitDurationInMinutes\": 0,\r\n \"rateLimitThreshold\": 1000,\r\n \"matchConditions\": [\r\n {\r\n \"matchVariable\": \"RemoteAddr\",\r\n \"selector\": null,\r\n \"operator\": \"IPMatch\",\r\n \"negateCondition\": false,\r\n \"matchValue\": [\r\n \"192.168.1.0/24\",\r\n \"10.0.0.0/24\"\r\n ]\r\n }\r\n ],\r\n \"action\": \"Block\",\r\n \"transforms\": []\r\n }\r\n ]\r\n },\r\n \"managedRules\": {\r\n \"ruleSets\": [\r\n {\r\n \"priority\": 1,\r\n \"version\": 0,\r\n \"ruleSetType\": \"AzureManagedRuleSet\",\r\n \"ruleGroupOverrides\": [\r\n {\r\n \"ruleGroupOverride\": \"SqlInjection\",\r\n \"action\": \"Block\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n}",
+ "ResponseBody": "{\"name\":\"policy5844\",\"id\":\"/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourcegroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/policy5844\",\"type\":\"Microsoft.Network/frontdoorwebapplicationfirewallpolicies\",\"tags\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"location\":\"Global\",\"properties\":{\"resourceState\":\"Enabled\",\"provisioningState\":\"Succeeded\",\"policySettings\":{\"enabledState\":\"Enabled\",\"mode\":\"Prevention\",\"CustomBlockResponseBody\":\"PGh0bWw+SGVsbG88L2h0bWw+\",\"CustomBlockResponseStatusCode\":403,\"RedirectUrl\":\"http://www.bing.com\"},\"customRules\":{\"rules\":[{\"name\":\"rule1\",\"enabledState\":\"Enabled\",\"priority\":1,\"ruleType\":\"RateLimitRule\",\"rateLimitDurationInMinutes\":0,\"rateLimitThreshold\":1000,\"matchConditions\":[{\"matchVariable\":\"RemoteAddr\",\"selector\":null,\"operator\":\"IPMatch\",\"negateCondition\":false,\"matchValue\":[\"192.168.1.0/24\",\"10.0.0.0/24\"]}],\"action\":\"Block\",\"transforms\":[]}]},\"managedRules\":{\"managedRuleSets\":[{\"ruleSetType\":\"DefaultRuleSet\",\"ruleSetVersion\":\"1.0\",\"ruleGroupOverrides\":[{\"ruleGroupOverride\":\"SQLI\",\"rules\":[{\"ruleId\":\"Rule1\",\"action\":\"Redirect\",\"enabledState\":\"Disabled\"}]}]}]}}}",
"StatusCode": 200
},
{
- "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2018-08-01",
- "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE4LTA4LTAx",
+ "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2019-03-01",
+ "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE5LTAzLTAx",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
@@ -354,8 +354,8 @@
"StatusCode": 404
},
{
- "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2018-08-01",
- "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE4LTA4LTAx",
+ "RequestUri": "/subscriptions/47f4bc68-6fe4-43a2-be8b-dfd0e290efa2/resourceGroups/FrontDoorResourceGroup6647/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/policy5844?api-version=2019-03-01",
+ "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDdmNGJjNjgtNmZlNC00M2EyLWJlOGItZGZkMGUyOTBlZmEyL3Jlc291cmNlR3JvdXBzL0Zyb250RG9vclJlc291cmNlR3JvdXA2NjQ3L3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9Gcm9udERvb3JXZWJBcHBsaWNhdGlvbkZpcmV3YWxsUG9saWNpZXMvcG9saWN5NTg0ND9hcGktdmVyc2lvbj0yMDE5LTAzLTAx",
"RequestMethod": "DELETE",
"RequestBody": "",
"RequestHeaders": {
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/FrontDoorManagementClient.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/FrontDoorManagementClient.cs
index e5295f7622ea..81493f19a6a5 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/FrontDoorManagementClient.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/FrontDoorManagementClient.cs
@@ -113,6 +113,11 @@ public partial class FrontDoorManagementClient : ServiceClient
public virtual IPoliciesOperations Policies { get; private set; }
+ ///
+ /// Gets the IManagedRuleSetsOperations.
+ ///
+ public virtual IManagedRuleSetsOperations ManagedRuleSets { get; private set; }
+
///
/// Initializes a new instance of the FrontDoorManagementClient class.
///
@@ -362,6 +367,7 @@ private void Initialize()
FrontendEndpoints = new FrontendEndpointsOperations(this);
Endpoints = new EndpointsOperations(this);
Policies = new PoliciesOperations(this);
+ ManagedRuleSets = new ManagedRuleSetsOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
@@ -392,8 +398,6 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
- SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("ruleSetType"));
- DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleSetType"));
CustomInitialize();
DeserializationSettings.Converters.Add(new TransformationJsonConverter());
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IFrontDoorManagementClient.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IFrontDoorManagementClient.cs
index b654ed9d523f..7056083a2841 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IFrontDoorManagementClient.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IFrontDoorManagementClient.cs
@@ -110,6 +110,11 @@ public partial interface IFrontDoorManagementClient : System.IDisposable
///
IPoliciesOperations Policies { get; }
+ ///
+ /// Gets the IManagedRuleSetsOperations.
+ ///
+ IManagedRuleSetsOperations ManagedRuleSets { get; }
+
///
/// Check the availability of a Front Door resource name.
///
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IManagedRuleSetsOperations.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IManagedRuleSetsOperations.cs
new file mode 100644
index 000000000000..b2dacc32b8b3
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IManagedRuleSetsOperations.cs
@@ -0,0 +1,68 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ManagedRuleSetsOperations operations.
+ ///
+ public partial interface IManagedRuleSetsOperations
+ {
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IPoliciesOperations.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IPoliciesOperations.cs
index ff4339941c78..bb0f4fb18403 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IPoliciesOperations.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/IPoliciesOperations.cs
@@ -27,7 +27,7 @@ public partial interface IPoliciesOperations
/// Lists all of the protection policies within a resource group.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
/// The headers that will be added to request.
@@ -44,16 +44,16 @@ public partial interface IPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Retrieve protection policy with specified name within a resource
/// group.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// The headers that will be added to request.
@@ -70,16 +70,16 @@ public partial interface IPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Creates or update policy with specified rule set name within a
+ /// Create or update policy with specified ruleset name within a
/// resource group.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// Policy to be created.
@@ -99,15 +99,15 @@ public partial interface IPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy1 parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Deletes Policy
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// The headers that will be added to request.
@@ -123,13 +123,42 @@ public partial interface IPoliciesOperations
///
Task DeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Create or update policy with specified ruleset name within a
+ /// resource group.
+ ///
+ ///
+ /// Name of the Resource group within the Azure subscription.
+ ///
+ ///
+ /// The name of the Web Application Firewall Policy.
+ ///
+ ///
+ /// Policy to be created.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Deletes Policy
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// The headers that will be added to request.
@@ -165,6 +194,6 @@ public partial interface IPoliciesOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/ManagedRuleSetsOperations.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/ManagedRuleSetsOperations.cs
new file mode 100644
index 000000000000..2a79c6138f41
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/ManagedRuleSetsOperations.cs
@@ -0,0 +1,393 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ManagedRuleSetsOperations operations.
+ ///
+ internal partial class ManagedRuleSetsOperations : IServiceOperations, IManagedRuleSetsOperations
+ {
+ ///
+ /// Initializes a new instance of the ManagedRuleSetsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ManagedRuleSetsOperations(FrontDoorManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the FrontDoorManagementClient
+ ///
+ public FrontDoorManagementClient Client { get; private set; }
+
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2019-03-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallManagedRuleSets").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/ManagedRuleSetsOperationsExtensions.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/ManagedRuleSetsOperationsExtensions.cs
new file mode 100644
index 000000000000..aa45d3b5f01a
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/ManagedRuleSetsOperationsExtensions.cs
@@ -0,0 +1,87 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for ManagedRuleSetsOperations.
+ ///
+ public static partial class ManagedRuleSetsOperationsExtensions
+ {
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IPage List(this IManagedRuleSetsOperations operations)
+ {
+ return operations.ListAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IManagedRuleSetsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IManagedRuleSetsOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all available managed rule sets.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListNextAsync(this IManagedRuleSetsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Action.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ActionType.cs
similarity index 82%
rename from src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Action.cs
rename to src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ActionType.cs
index 4f16e516a4f0..57a6e9fa0508 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Action.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ActionType.cs
@@ -12,12 +12,13 @@ namespace Microsoft.Azure.Management.FrontDoor.Models
{
///
- /// Defines values for Action.
+ /// Defines values for ActionType.
///
- public static class Action
+ public static class ActionType
{
public const string Allow = "Allow";
public const string Block = "Block";
public const string Log = "Log";
+ public const string Redirect = "Redirect";
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/AzureManagedOverrideRuleGroup.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/AzureManagedOverrideRuleGroup.cs
deleted file mode 100644
index 110a5f2130ba..000000000000
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/AzureManagedOverrideRuleGroup.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.FrontDoor.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Linq;
-
- ///
- /// Defines contents of a web application rule
- ///
- public partial class AzureManagedOverrideRuleGroup
- {
- ///
- /// Initializes a new instance of the AzureManagedOverrideRuleGroup
- /// class.
- ///
- public AzureManagedOverrideRuleGroup()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the AzureManagedOverrideRuleGroup
- /// class.
- ///
- /// Describes override rule group.
- /// Possible values include: 'SqlInjection', 'XSS'
- /// Type of Actions. Possible values include:
- /// 'Allow', 'Block', 'Log'
- public AzureManagedOverrideRuleGroup(string ruleGroupOverride, string action)
- {
- RuleGroupOverride = ruleGroupOverride;
- Action = action;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets describes override rule group. Possible values
- /// include: 'SqlInjection', 'XSS'
- ///
- [JsonProperty(PropertyName = "ruleGroupOverride")]
- public string RuleGroupOverride { get; set; }
-
- ///
- /// Gets or sets type of Actions. Possible values include: 'Allow',
- /// 'Block', 'Log'
- ///
- [JsonProperty(PropertyName = "action")]
- public string Action { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (RuleGroupOverride == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupOverride");
- }
- if (Action == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "Action");
- }
- }
- }
-}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/AzureManagedRuleSet.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/AzureManagedRuleSet.cs
deleted file mode 100644
index c468d91ca970..000000000000
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/AzureManagedRuleSet.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.FrontDoor.Models
-{
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Describes azure managed provider.
- ///
- public partial class AzureManagedRuleSet : ManagedRuleSet
- {
- ///
- /// Initializes a new instance of the AzureManagedRuleSet class.
- ///
- public AzureManagedRuleSet()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the AzureManagedRuleSet class.
- ///
- /// Describes priority of the rule
- /// defines version of the rule set
- /// List of azure managed provider
- /// override configuration (optional)
- public AzureManagedRuleSet(int? priority = default(int?), int? version = default(int?), IList ruleGroupOverrides = default(IList))
- : base(priority, version)
- {
- RuleGroupOverrides = ruleGroupOverrides;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets list of azure managed provider override configuration
- /// (optional)
- ///
- [JsonProperty(PropertyName = "ruleGroupOverrides")]
- public IList RuleGroupOverrides { get; set; }
-
- }
-}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRule.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRule.cs
index cfed8de4ab06..9c326945c468 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRule.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRule.cs
@@ -34,32 +34,31 @@ public CustomRule()
///
/// Describes priority of the rule. Rules with a
/// lower value will be evaluated before rules with a higher
- /// value
+ /// value.
/// Describes type of rule. Possible values
/// include: 'MatchRule', 'RateLimitRule'
- /// List of match conditions
- /// Type of Actions. Possible values include:
- /// 'Allow', 'Block', 'Log'
- /// Gets name of the resource that is unique within
- /// a policy. This name can be used to access the resource.
- /// Gets a unique read-only string that changes
- /// whenever the resource is updated.
+ /// List of match conditions.
+ /// Describes what action to be applied when rule
+ /// matches. Possible values include: 'Allow', 'Block', 'Log',
+ /// 'Redirect'
+ /// Describes the name of the rule.
+ /// Describes if the custom rule is in
+ /// enabled or disabled state. Defaults to Enabled if not specified.
+ /// Possible values include: 'Disabled', 'Enabled'
/// Defines rate limit
- /// duration. Default - 1 minute
+ /// duration. Default is 1 minute.
/// Defines rate limit
- /// threshold
- /// List of transforms
- public CustomRule(int priority, string ruleType, IList matchConditions, string action, string name = default(string), string etag = default(string), int? rateLimitDurationInMinutes = default(int?), int? rateLimitThreshold = default(int?), IList transforms = default(IList))
+ /// threshold.
+ public CustomRule(int priority, string ruleType, IList matchConditions, string action, string name = default(string), string enabledState = default(string), int? rateLimitDurationInMinutes = default(int?), int? rateLimitThreshold = default(int?))
{
Name = name;
- Etag = etag;
Priority = priority;
+ EnabledState = enabledState;
RuleType = ruleType;
RateLimitDurationInMinutes = rateLimitDurationInMinutes;
RateLimitThreshold = rateLimitThreshold;
MatchConditions = matchConditions;
Action = action;
- Transforms = transforms;
CustomInit();
}
@@ -69,26 +68,26 @@ public CustomRule()
partial void CustomInit();
///
- /// Gets name of the resource that is unique within a policy. This name
- /// can be used to access the resource.
+ /// Gets or sets describes the name of the rule.
///
[JsonProperty(PropertyName = "name")]
public string Name { get; set; }
- ///
- /// Gets a unique read-only string that changes whenever the resource
- /// is updated.
- ///
- [JsonProperty(PropertyName = "etag")]
- public string Etag { get; private set; }
-
///
/// Gets or sets describes priority of the rule. Rules with a lower
- /// value will be evaluated before rules with a higher value
+ /// value will be evaluated before rules with a higher value.
///
[JsonProperty(PropertyName = "priority")]
public int Priority { get; set; }
+ ///
+ /// Gets or sets describes if the custom rule is in enabled or disabled
+ /// state. Defaults to Enabled if not specified. Possible values
+ /// include: 'Disabled', 'Enabled'
+ ///
+ [JsonProperty(PropertyName = "enabledState")]
+ public string EnabledState { get; set; }
+
///
/// Gets or sets describes type of rule. Possible values include:
/// 'MatchRule', 'RateLimitRule'
@@ -97,36 +96,30 @@ public CustomRule()
public string RuleType { get; set; }
///
- /// Gets or sets defines rate limit duration. Default - 1 minute
+ /// Gets or sets defines rate limit duration. Default is 1 minute.
///
[JsonProperty(PropertyName = "rateLimitDurationInMinutes")]
public int? RateLimitDurationInMinutes { get; set; }
///
- /// Gets or sets defines rate limit threshold
+ /// Gets or sets defines rate limit threshold.
///
[JsonProperty(PropertyName = "rateLimitThreshold")]
public int? RateLimitThreshold { get; set; }
///
- /// Gets or sets list of match conditions
+ /// Gets or sets list of match conditions.
///
[JsonProperty(PropertyName = "matchConditions")]
- public IList MatchConditions { get; set; }
+ public IList MatchConditions { get; set; }
///
- /// Gets or sets type of Actions. Possible values include: 'Allow',
- /// 'Block', 'Log'
+ /// Gets or sets describes what action to be applied when rule matches.
+ /// Possible values include: 'Allow', 'Block', 'Log', 'Redirect'
///
[JsonProperty(PropertyName = "action")]
public string Action { get; set; }
- ///
- /// Gets or sets list of transforms
- ///
- [JsonProperty(PropertyName = "transforms")]
- public IList Transforms { get; set; }
-
///
/// Validate the object.
///
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/RuleGroupOverride.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRuleEnabledState.cs
similarity index 69%
rename from src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/RuleGroupOverride.cs
rename to src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRuleEnabledState.cs
index 1cf8b17ad593..06e99ecb0eb3 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/RuleGroupOverride.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRuleEnabledState.cs
@@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.FrontDoor.Models
{
///
- /// Defines values for RuleGroupOverride.
+ /// Defines values for CustomRuleEnabledState.
///
- public static class RuleGroupOverride
+ public static class CustomRuleEnabledState
{
- public const string SqlInjection = "SqlInjection";
- public const string XSS = "XSS";
+ public const string Disabled = "Disabled";
+ public const string Enabled = "Enabled";
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRules.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRuleList.cs
similarity index 80%
rename from src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRules.cs
rename to src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRuleList.cs
index 0ead6e68b99c..197fdf6ac64f 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRules.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/CustomRuleList.cs
@@ -18,21 +18,21 @@ namespace Microsoft.Azure.Management.FrontDoor.Models
///
/// Defines contents of custom rules
///
- public partial class CustomRules
+ public partial class CustomRuleList
{
///
- /// Initializes a new instance of the CustomRules class.
+ /// Initializes a new instance of the CustomRuleList class.
///
- public CustomRules()
+ public CustomRuleList()
{
CustomInit();
}
///
- /// Initializes a new instance of the CustomRules class.
+ /// Initializes a new instance of the CustomRuleList class.
///
/// List of rules
- public CustomRules(IList rules = default(IList))
+ public CustomRuleList(IList rules = default(IList))
{
Rules = rules;
CustomInit();
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/FrontendEndpointLink.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/FrontendEndpointLink.cs
new file mode 100644
index 000000000000..9f482d5f9806
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/FrontendEndpointLink.cs
@@ -0,0 +1,51 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Defines the Resource ID for a Frontend Endpoint.
+ ///
+ public partial class FrontendEndpointLink
+ {
+ ///
+ /// Initializes a new instance of the FrontendEndpointLink class.
+ ///
+ public FrontendEndpointLink()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the FrontendEndpointLink class.
+ ///
+ /// Resource ID.
+ public FrontendEndpointLink(string id = default(string))
+ {
+ Id = id;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets resource ID.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleDefinition.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleDefinition.cs
new file mode 100644
index 000000000000..81dc7e9d18ab
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleDefinition.cs
@@ -0,0 +1,60 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Describes a managed rule definition.
+ ///
+ public partial class ManagedRuleDefinition
+ {
+ ///
+ /// Initializes a new instance of the ManagedRuleDefinition class.
+ ///
+ public ManagedRuleDefinition()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ManagedRuleDefinition class.
+ ///
+ /// Identifier for the managed rule.
+ /// Describes the functionality of the
+ /// managed rule.
+ public ManagedRuleDefinition(string ruleId = default(string), string description = default(string))
+ {
+ RuleId = ruleId;
+ Description = description;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets identifier for the managed rule.
+ ///
+ [JsonProperty(PropertyName = "ruleId")]
+ public string RuleId { get; private set; }
+
+ ///
+ /// Gets describes the functionality of the managed rule.
+ ///
+ [JsonProperty(PropertyName = "description")]
+ public string Description { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleEnabledState.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleEnabledState.cs
new file mode 100644
index 000000000000..2abe1296753e
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleEnabledState.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+
+ ///
+ /// Defines values for ManagedRuleEnabledState.
+ ///
+ public static class ManagedRuleEnabledState
+ {
+ public const string Disabled = "Disabled";
+ public const string Enabled = "Enabled";
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleGroupDefinition.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleGroupDefinition.cs
new file mode 100644
index 000000000000..3375bf167077
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleGroupDefinition.cs
@@ -0,0 +1,71 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Describes a managed rule group.
+ ///
+ public partial class ManagedRuleGroupDefinition
+ {
+ ///
+ /// Initializes a new instance of the ManagedRuleGroupDefinition class.
+ ///
+ public ManagedRuleGroupDefinition()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ManagedRuleGroupDefinition class.
+ ///
+ /// Name of the managed rule group.
+ /// Description of the managed rule
+ /// group.
+ /// List of rules within the managed rule
+ /// group.
+ public ManagedRuleGroupDefinition(string ruleGroupName = default(string), string description = default(string), IList rules = default(IList))
+ {
+ RuleGroupName = ruleGroupName;
+ Description = description;
+ Rules = rules;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets name of the managed rule group.
+ ///
+ [JsonProperty(PropertyName = "ruleGroupName")]
+ public string RuleGroupName { get; private set; }
+
+ ///
+ /// Gets description of the managed rule group.
+ ///
+ [JsonProperty(PropertyName = "description")]
+ public string Description { get; private set; }
+
+ ///
+ /// Gets list of rules within the managed rule group.
+ ///
+ [JsonProperty(PropertyName = "rules")]
+ public IList Rules { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleGroupOverride.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleGroupOverride.cs
new file mode 100644
index 000000000000..a28cb3977188
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleGroupOverride.cs
@@ -0,0 +1,88 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Defines a managed rule group override setting.
+ ///
+ public partial class ManagedRuleGroupOverride
+ {
+ ///
+ /// Initializes a new instance of the ManagedRuleGroupOverride class.
+ ///
+ public ManagedRuleGroupOverride()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ManagedRuleGroupOverride class.
+ ///
+ /// Describes the managed rule group to
+ /// override.
+ /// List of rules that will be disabled. If none
+ /// specified, all rules in the group will be disabled.
+ public ManagedRuleGroupOverride(string ruleGroupName, IList rules = default(IList))
+ {
+ RuleGroupName = ruleGroupName;
+ Rules = rules;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets describes the managed rule group to override.
+ ///
+ [JsonProperty(PropertyName = "ruleGroupName")]
+ public string RuleGroupName { get; set; }
+
+ ///
+ /// Gets or sets list of rules that will be disabled. If none
+ /// specified, all rules in the group will be disabled.
+ ///
+ [JsonProperty(PropertyName = "rules")]
+ public IList Rules { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (RuleGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "RuleGroupName");
+ }
+ if (Rules != null)
+ {
+ foreach (var element in Rules)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleOverride.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleOverride.cs
new file mode 100644
index 000000000000..e223322f32c8
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleOverride.cs
@@ -0,0 +1,89 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Defines a managed rule group override setting.
+ ///
+ public partial class ManagedRuleOverride
+ {
+ ///
+ /// Initializes a new instance of the ManagedRuleOverride class.
+ ///
+ public ManagedRuleOverride()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ManagedRuleOverride class.
+ ///
+ /// Identifier for the managed rule.
+ /// Describes if the managed rule is in
+ /// enabled or disabled state. Defaults to Disabled if not specified.
+ /// Possible values include: 'Disabled', 'Enabled'
+ /// Describes the override action to be applied
+ /// when rule matches. Possible values include: 'Allow', 'Block',
+ /// 'Log', 'Redirect'
+ public ManagedRuleOverride(string ruleId, string enabledState = default(string), string action = default(string))
+ {
+ RuleId = ruleId;
+ EnabledState = enabledState;
+ Action = action;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets identifier for the managed rule.
+ ///
+ [JsonProperty(PropertyName = "ruleId")]
+ public string RuleId { get; set; }
+
+ ///
+ /// Gets or sets describes if the managed rule is in enabled or
+ /// disabled state. Defaults to Disabled if not specified. Possible
+ /// values include: 'Disabled', 'Enabled'
+ ///
+ [JsonProperty(PropertyName = "enabledState")]
+ public string EnabledState { get; set; }
+
+ ///
+ /// Gets or sets describes the override action to be applied when rule
+ /// matches. Possible values include: 'Allow', 'Block', 'Log',
+ /// 'Redirect'
+ ///
+ [JsonProperty(PropertyName = "action")]
+ public string Action { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (RuleId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "RuleId");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSet.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSet.cs
index dc32c9c94110..d34955a22aa2 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSet.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSet.cs
@@ -10,13 +10,15 @@
namespace Microsoft.Azure.Management.FrontDoor.Models
{
+ using Microsoft.Rest;
using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
using System.Linq;
///
- /// Base class for all types of ManagedRuleSet.
+ /// Defines a managed rule set.
///
- [Newtonsoft.Json.JsonObject("Unknown")]
public partial class ManagedRuleSet
{
///
@@ -30,12 +32,16 @@ public ManagedRuleSet()
///
/// Initializes a new instance of the ManagedRuleSet class.
///
- /// Describes priority of the rule
- /// defines version of the rule set
- public ManagedRuleSet(int? priority = default(int?), int? version = default(int?))
+ /// Defines the rule set type to use.
+ /// Defines the version of the rule set to
+ /// use.
+ /// Defines the rule group overrides
+ /// to apply to the rule set.
+ public ManagedRuleSet(string ruleSetType, string ruleSetVersion, IList ruleGroupOverrides = default(IList))
{
- Priority = priority;
- Version = version;
+ RuleSetType = ruleSetType;
+ RuleSetVersion = ruleSetVersion;
+ RuleGroupOverrides = ruleGroupOverrides;
CustomInit();
}
@@ -45,16 +51,50 @@ public ManagedRuleSet()
partial void CustomInit();
///
- /// Gets or sets describes priority of the rule
+ /// Gets or sets defines the rule set type to use.
///
- [JsonProperty(PropertyName = "priority")]
- public int? Priority { get; set; }
+ [JsonProperty(PropertyName = "ruleSetType")]
+ public string RuleSetType { get; set; }
///
- /// Gets or sets defines version of the rule set
+ /// Gets or sets defines the version of the rule set to use.
///
- [JsonProperty(PropertyName = "version")]
- public int? Version { get; set; }
+ [JsonProperty(PropertyName = "ruleSetVersion")]
+ public string RuleSetVersion { get; set; }
+ ///
+ /// Gets or sets defines the rule group overrides to apply to the rule
+ /// set.
+ ///
+ [JsonProperty(PropertyName = "ruleGroupOverrides")]
+ public IList RuleGroupOverrides { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (RuleSetType == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetType");
+ }
+ if (RuleSetVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "RuleSetVersion");
+ }
+ if (RuleGroupOverrides != null)
+ {
+ foreach (var element in RuleGroupOverrides)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ }
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSetDefinition.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSetDefinition.cs
new file mode 100644
index 000000000000..f91aec201d30
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSetDefinition.cs
@@ -0,0 +1,89 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Describes the a managed rule set definition.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class ManagedRuleSetDefinition : Resource
+ {
+ ///
+ /// Initializes a new instance of the ManagedRuleSetDefinition class.
+ ///
+ public ManagedRuleSetDefinition()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ManagedRuleSetDefinition class.
+ ///
+ /// Resource ID.
+ /// Resource name.
+ /// Resource type.
+ /// Resource location.
+ /// Resource tags.
+ /// Provisioning state of the managed
+ /// rule set.
+ /// Type of the managed rule set.
+ /// Version of the managed rule set
+ /// type.
+ /// Rule groups of the managed rule
+ /// set.
+ public ManagedRuleSetDefinition(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string ruleSetType = default(string), string ruleSetVersion = default(string), IList ruleGroups = default(IList))
+ : base(id, name, type, location, tags)
+ {
+ ProvisioningState = provisioningState;
+ RuleSetType = ruleSetType;
+ RuleSetVersion = ruleSetVersion;
+ RuleGroups = ruleGroups;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets provisioning state of the managed rule set.
+ ///
+ [JsonProperty(PropertyName = "properties.provisioningState")]
+ public string ProvisioningState { get; private set; }
+
+ ///
+ /// Gets type of the managed rule set.
+ ///
+ [JsonProperty(PropertyName = "properties.ruleSetType")]
+ public string RuleSetType { get; private set; }
+
+ ///
+ /// Gets version of the managed rule set type.
+ ///
+ [JsonProperty(PropertyName = "properties.ruleSetVersion")]
+ public string RuleSetVersion { get; private set; }
+
+ ///
+ /// Gets rule groups of the managed rule set.
+ ///
+ [JsonProperty(PropertyName = "properties.ruleGroups")]
+ public IList RuleGroups { get; private set; }
+
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSets.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSetList.cs
similarity index 59%
rename from src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSets.cs
rename to src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSetList.cs
index b21c623d979b..a47161069b4c 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSets.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/ManagedRuleSetList.cs
@@ -16,25 +16,25 @@ namespace Microsoft.Azure.Management.FrontDoor.Models
using System.Linq;
///
- /// Defines ManagedRuleSets - array of managedRuleSet
+ /// Defines the list of managed rule sets for the policy.
///
- public partial class ManagedRuleSets
+ public partial class ManagedRuleSetList
{
///
- /// Initializes a new instance of the ManagedRuleSets class.
+ /// Initializes a new instance of the ManagedRuleSetList class.
///
- public ManagedRuleSets()
+ public ManagedRuleSetList()
{
CustomInit();
}
///
- /// Initializes a new instance of the ManagedRuleSets class.
+ /// Initializes a new instance of the ManagedRuleSetList class.
///
- /// List of rules
- public ManagedRuleSets(IList ruleSets = default(IList))
+ /// List of rule sets.
+ public ManagedRuleSetList(IList managedRuleSets = default(IList))
{
- RuleSets = ruleSets;
+ ManagedRuleSets = managedRuleSets;
CustomInit();
}
@@ -44,10 +44,10 @@ public ManagedRuleSets()
partial void CustomInit();
///
- /// Gets or sets list of rules
+ /// Gets or sets list of rule sets.
///
- [JsonProperty(PropertyName = "ruleSets")]
- public IList RuleSets { get; set; }
+ [JsonProperty(PropertyName = "managedRuleSets")]
+ public IList ManagedRuleSets { get; set; }
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchCondition.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchCondition.cs
index 397c6777efd5..4c77c8405079 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchCondition.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchCondition.cs
@@ -10,18 +10,122 @@
namespace Microsoft.Azure.Management.FrontDoor.Models
{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
///
- /// Defines values for MatchCondition.
+ /// Define a match condition.
///
- public static class MatchCondition
+ public partial class MatchCondition
{
- public const string RemoteAddr = "RemoteAddr";
- public const string RequestMethod = "RequestMethod";
- public const string QueryString = "QueryString";
- public const string PostArgs = "PostArgs";
- public const string RequestUri = "RequestUri";
- public const string RequestHeader = "RequestHeader";
- public const string RequestBody = "RequestBody";
+ ///
+ /// Initializes a new instance of the MatchCondition class.
+ ///
+ public MatchCondition()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the MatchCondition class.
+ ///
+ /// Match variable to compare against.
+ /// Possible values include: 'RemoteAddr', 'RequestMethod',
+ /// 'QueryString', 'PostArgs', 'RequestUri', 'RequestHeader',
+ /// 'RequestBody', 'Cookies'
+ /// Describes operator to be matched.
+ /// Possible values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal',
+ /// 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual',
+ /// 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith', 'RegEx'
+ /// List of possible match values.
+ /// Selector can used to match against a
+ /// specific key from QueryString, PostArgs, RequestHeader or
+ /// Cookies.
+ /// Describes if the result of this
+ /// condition should be negated.
+ /// List of transforms.
+ public MatchCondition(string matchVariable, string operatorProperty, IList matchValue, string selector = default(string), bool? negateCondition = default(bool?), IList transforms = default(IList))
+ {
+ MatchVariable = matchVariable;
+ Selector = selector;
+ OperatorProperty = operatorProperty;
+ NegateCondition = negateCondition;
+ MatchValue = matchValue;
+ Transforms = transforms;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets match variable to compare against. Possible values
+ /// include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs',
+ /// 'RequestUri', 'RequestHeader', 'RequestBody', 'Cookies'
+ ///
+ [JsonProperty(PropertyName = "matchVariable")]
+ public string MatchVariable { get; set; }
+
+ ///
+ /// Gets or sets selector can used to match against a specific key from
+ /// QueryString, PostArgs, RequestHeader or Cookies.
+ ///
+ [JsonProperty(PropertyName = "selector")]
+ public string Selector { get; set; }
+
+ ///
+ /// Gets or sets describes operator to be matched. Possible values
+ /// include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains',
+ /// 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual',
+ /// 'BeginsWith', 'EndsWith', 'RegEx'
+ ///
+ [JsonProperty(PropertyName = "operator")]
+ public string OperatorProperty { get; set; }
+
+ ///
+ /// Gets or sets describes if the result of this condition should be
+ /// negated.
+ ///
+ [JsonProperty(PropertyName = "negateCondition")]
+ public bool? NegateCondition { get; set; }
+
+ ///
+ /// Gets or sets list of possible match values.
+ ///
+ [JsonProperty(PropertyName = "matchValue")]
+ public IList MatchValue { get; set; }
+
+ ///
+ /// Gets or sets list of transforms.
+ ///
+ [JsonProperty(PropertyName = "transforms")]
+ public IList Transforms { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (MatchVariable == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "MatchVariable");
+ }
+ if (OperatorProperty == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "OperatorProperty");
+ }
+ if (MatchValue == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "MatchValue");
+ }
+ }
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchCondition1.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchCondition1.cs
deleted file mode 100644
index 334b824a07de..000000000000
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchCondition1.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.FrontDoor.Models
-{
- using Microsoft.Rest;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Define match conditions
- ///
- public partial class MatchCondition1
- {
- ///
- /// Initializes a new instance of the MatchCondition1 class.
- ///
- public MatchCondition1()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the MatchCondition1 class.
- ///
- /// Match Variable. Possible values
- /// include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs',
- /// 'RequestUri', 'RequestHeader', 'RequestBody'
- /// Describes operator to be matched.
- /// Possible values include: 'Any', 'IPMatch', 'GeoMatch', 'Equal',
- /// 'Contains', 'LessThan', 'GreaterThan', 'LessThanOrEqual',
- /// 'GreaterThanOrEqual', 'BeginsWith', 'EndsWith'
- /// Match value
- /// Name of selector in RequestHeader or
- /// RequestBody to be matched
- /// Describes if this is negate condition
- /// or not
- public MatchCondition1(string matchVariable, string operatorProperty, IList matchValue, string selector = default(string), bool? negateCondition = default(bool?))
- {
- MatchVariable = matchVariable;
- Selector = selector;
- OperatorProperty = operatorProperty;
- NegateCondition = negateCondition;
- MatchValue = matchValue;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets match Variable. Possible values include: 'RemoteAddr',
- /// 'RequestMethod', 'QueryString', 'PostArgs', 'RequestUri',
- /// 'RequestHeader', 'RequestBody'
- ///
- [JsonProperty(PropertyName = "matchVariable")]
- public string MatchVariable { get; set; }
-
- ///
- /// Gets or sets name of selector in RequestHeader or RequestBody to be
- /// matched
- ///
- [JsonProperty(PropertyName = "selector")]
- public string Selector { get; set; }
-
- ///
- /// Gets or sets describes operator to be matched. Possible values
- /// include: 'Any', 'IPMatch', 'GeoMatch', 'Equal', 'Contains',
- /// 'LessThan', 'GreaterThan', 'LessThanOrEqual', 'GreaterThanOrEqual',
- /// 'BeginsWith', 'EndsWith'
- ///
- [JsonProperty(PropertyName = "operator")]
- public string OperatorProperty { get; set; }
-
- ///
- /// Gets or sets describes if this is negate condition or not
- ///
- [JsonProperty(PropertyName = "negateCondition")]
- public bool? NegateCondition { get; set; }
-
- ///
- /// Gets or sets match value
- ///
- [JsonProperty(PropertyName = "matchValue")]
- public IList MatchValue { get; set; }
-
- ///
- /// Validate the object.
- ///
- ///
- /// Thrown if validation fails
- ///
- public virtual void Validate()
- {
- if (MatchVariable == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "MatchVariable");
- }
- if (OperatorProperty == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "OperatorProperty");
- }
- if (MatchValue == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "MatchValue");
- }
- }
- }
-}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchVariable.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchVariable.cs
new file mode 100644
index 000000000000..c2b72181268f
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/MatchVariable.cs
@@ -0,0 +1,28 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+
+ ///
+ /// Defines values for MatchVariable.
+ ///
+ public static class MatchVariable
+ {
+ public const string RemoteAddr = "RemoteAddr";
+ public const string RequestMethod = "RequestMethod";
+ public const string QueryString = "QueryString";
+ public const string PostArgs = "PostArgs";
+ public const string RequestUri = "RequestUri";
+ public const string RequestHeader = "RequestHeader";
+ public const string RequestBody = "RequestBody";
+ public const string Cookies = "Cookies";
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/OperatorModel.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/OperatorModel.cs
index da878210e41c..04b6ef4d3e32 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/OperatorModel.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/OperatorModel.cs
@@ -27,5 +27,6 @@ public static class OperatorModel
public const string GreaterThanOrEqual = "GreaterThanOrEqual";
public const string BeginsWith = "BeginsWith";
public const string EndsWith = "EndsWith";
+ public const string RegEx = "RegEx";
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/EnabledState.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyEnabledState.cs
similarity index 86%
rename from src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/EnabledState.cs
rename to src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyEnabledState.cs
index 56e94b583e77..0c78a3efe415 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/EnabledState.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyEnabledState.cs
@@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.FrontDoor.Models
{
///
- /// Defines values for EnabledState.
+ /// Defines values for PolicyEnabledState.
///
- public static class EnabledState
+ public static class PolicyEnabledState
{
public const string Disabled = "Disabled";
public const string Enabled = "Enabled";
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Mode.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyMode.cs
similarity index 88%
rename from src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Mode.cs
rename to src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyMode.cs
index dd600bc3cd38..65850bb32f11 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Mode.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyMode.cs
@@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.FrontDoor.Models
{
///
- /// Defines values for Mode.
+ /// Defines values for PolicyMode.
///
- public static class Mode
+ public static class PolicyMode
{
public const string Prevention = "Prevention";
public const string Detection = "Detection";
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyResourceState.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyResourceState.cs
new file mode 100644
index 000000000000..e4d28dfdcd2b
--- /dev/null
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicyResourceState.cs
@@ -0,0 +1,26 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.FrontDoor.Models
+{
+
+ ///
+ /// Defines values for PolicyResourceState.
+ ///
+ public static class PolicyResourceState
+ {
+ public const string Creating = "Creating";
+ public const string Enabling = "Enabling";
+ public const string Enabled = "Enabled";
+ public const string Disabling = "Disabling";
+ public const string Disabled = "Disabled";
+ public const string Deleting = "Deleting";
+ }
+}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicySettings.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicySettings.cs
index 5244420cee74..27c7c0096054 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicySettings.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/PolicySettings.cs
@@ -10,11 +10,12 @@
namespace Microsoft.Azure.Management.FrontDoor.Models
{
+ using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
///
- /// Defines contents of a web application firewall global configuration
+ /// Defines top-level WebApplicationFirewallPolicy configuration settings.
///
public partial class PolicySettings
{
@@ -29,16 +30,26 @@ public PolicySettings()
///
/// Initializes a new instance of the PolicySettings class.
///
- /// describes if the policy is in enabled
- /// state or disabled state. Possible values include: 'Disabled',
- /// 'Enabled'
- /// Describes if it is in detection mode or
+ /// Describes if the policy is in enabled or
+ /// disabled state. Defaults to Enabled if not specified. Possible
+ /// values include: 'Disabled', 'Enabled'
+ /// Describes if it is in detection mode or
/// prevention mode at policy level. Possible values include:
/// 'Prevention', 'Detection'
- public PolicySettings(string enabledState = default(string), string mode = default(string))
+ /// If action type is redirect, this field
+ /// represents redirect URL for the client.
+ /// If the action type is
+ /// block, customer can override the response status code.
+ /// If the action type is block,
+ /// customer can override the response body. The body must be specified
+ /// in base64 encoding.
+ public PolicySettings(string enabledState = default(string), string mode = default(string), string redirectUrl = default(string), int? customBlockResponseStatusCode = default(int?), string customBlockResponseBody = default(string))
{
EnabledState = enabledState;
Mode = mode;
+ RedirectUrl = redirectUrl;
+ CustomBlockResponseStatusCode = customBlockResponseStatusCode;
+ CustomBlockResponseBody = customBlockResponseBody;
CustomInit();
}
@@ -48,19 +59,57 @@ public PolicySettings()
partial void CustomInit();
///
- /// Gets or sets describes if the policy is in enabled state or
- /// disabled state. Possible values include: 'Disabled', 'Enabled'
+ /// Gets or sets describes if the policy is in enabled or disabled
+ /// state. Defaults to Enabled if not specified. Possible values
+ /// include: 'Disabled', 'Enabled'
///
[JsonProperty(PropertyName = "enabledState")]
public string EnabledState { get; set; }
///
- /// Gets or sets describes if it is in detection mode or prevention
+ /// Gets or sets describes if it is in detection mode or prevention
/// mode at policy level. Possible values include: 'Prevention',
/// 'Detection'
///
[JsonProperty(PropertyName = "mode")]
public string Mode { get; set; }
+ ///
+ /// Gets or sets if action type is redirect, this field represents
+ /// redirect URL for the client.
+ ///
+ [JsonProperty(PropertyName = "redirectUrl")]
+ public string RedirectUrl { get; set; }
+
+ ///
+ /// Gets or sets if the action type is block, customer can override the
+ /// response status code.
+ ///
+ [JsonProperty(PropertyName = "customBlockResponseStatusCode")]
+ public int? CustomBlockResponseStatusCode { get; set; }
+
+ ///
+ /// Gets or sets if the action type is block, customer can override the
+ /// response body. The body must be specified in base64 encoding.
+ ///
+ [JsonProperty(PropertyName = "customBlockResponseBody")]
+ public string CustomBlockResponseBody { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (CustomBlockResponseBody != null)
+ {
+ if (!System.Text.RegularExpressions.Regex.IsMatch(CustomBlockResponseBody, "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "CustomBlockResponseBody", "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$");
+ }
+ }
+ }
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Transform.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/TransformType.cs
similarity index 84%
rename from src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Transform.cs
rename to src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/TransformType.cs
index 1256ba56be6b..d737b453d509 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/Transform.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/TransformType.cs
@@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.FrontDoor.Models
{
///
- /// Defines values for Transform.
+ /// Defines values for TransformType.
///
- public static class Transform
+ public static class TransformType
{
public const string Lowercase = "Lowercase";
public const string Uppercase = "Uppercase";
@@ -22,6 +22,5 @@ public static class Transform
public const string UrlDecode = "UrlDecode";
public const string UrlEncode = "UrlEncode";
public const string RemoveNulls = "RemoveNulls";
- public const string HtmlEntityDecode = "HtmlEntityDecode";
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/WebApplicationFirewallPolicy.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/WebApplicationFirewallPolicy.cs
index e5f8799b83ae..dbc4bfe3b084 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/WebApplicationFirewallPolicy.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/WebApplicationFirewallPolicy.cs
@@ -10,17 +10,128 @@
namespace Microsoft.Azure.Management.FrontDoor.Models
{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
///
- /// Defines values for WebApplicationFirewallPolicy.
+ /// Defines web application firewall policy.
///
- public static class WebApplicationFirewallPolicy
+ [Rest.Serialization.JsonTransformation]
+ public partial class WebApplicationFirewallPolicy : Resource
{
- public const string Creating = "Creating";
- public const string Enabling = "Enabling";
- public const string Enabled = "Enabled";
- public const string Disabling = "Disabling";
- public const string Disabled = "Disabled";
- public const string Deleting = "Deleting";
+ ///
+ /// Initializes a new instance of the WebApplicationFirewallPolicy
+ /// class.
+ ///
+ public WebApplicationFirewallPolicy()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the WebApplicationFirewallPolicy
+ /// class.
+ ///
+ /// Resource ID.
+ /// Resource name.
+ /// Resource type.
+ /// Resource location.
+ /// Resource tags.
+ /// Describes settings for the
+ /// policy.
+ /// Describes custom rules inside the
+ /// policy.
+ /// Describes managed rules inside the
+ /// policy.
+ /// Describes Frontend Endpoints
+ /// associated with this Web Application Firewall policy.
+ /// Provisioning state of the
+ /// policy.
+ /// Resource status of the policy.
+ /// Gets a unique read-only string that changes
+ /// whenever the resource is updated.
+ public WebApplicationFirewallPolicy(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PolicySettings policySettings = default(PolicySettings), CustomRuleList customRules = default(CustomRuleList), ManagedRuleSetList managedRules = default(ManagedRuleSetList), IList frontendEndpointLinks = default(IList), string provisioningState = default(string), string resourceState = default(string), string etag = default(string))
+ : base(id, name, type, location, tags)
+ {
+ PolicySettings = policySettings;
+ CustomRules = customRules;
+ ManagedRules = managedRules;
+ FrontendEndpointLinks = frontendEndpointLinks;
+ ProvisioningState = provisioningState;
+ ResourceState = resourceState;
+ Etag = etag;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets describes settings for the policy.
+ ///
+ [JsonProperty(PropertyName = "properties.policySettings")]
+ public PolicySettings PolicySettings { get; set; }
+
+ ///
+ /// Gets or sets describes custom rules inside the policy.
+ ///
+ [JsonProperty(PropertyName = "properties.customRules")]
+ public CustomRuleList CustomRules { get; set; }
+
+ ///
+ /// Gets or sets describes managed rules inside the policy.
+ ///
+ [JsonProperty(PropertyName = "properties.managedRules")]
+ public ManagedRuleSetList ManagedRules { get; set; }
+
+ ///
+ /// Gets describes Frontend Endpoints associated with this Web
+ /// Application Firewall policy.
+ ///
+ [JsonProperty(PropertyName = "properties.frontendEndpointLinks")]
+ public IList FrontendEndpointLinks { get; private set; }
+
+ ///
+ /// Gets provisioning state of the policy.
+ ///
+ [JsonProperty(PropertyName = "properties.provisioningState")]
+ public string ProvisioningState { get; private set; }
+
+ ///
+ /// Gets resource status of the policy.
+ ///
+ ///
+ /// Possible values include: 'Creating', 'Enabling', 'Enabled',
+ /// 'Disabling', 'Disabled', 'Deleting'
+ ///
+ [JsonProperty(PropertyName = "properties.resourceState")]
+ public string ResourceState { get; private set; }
+
+ ///
+ /// Gets a unique read-only string that changes whenever the resource
+ /// is updated.
+ ///
+ [JsonProperty(PropertyName = "etag")]
+ public string Etag { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (PolicySettings != null)
+ {
+ PolicySettings.Validate();
+ }
+ }
}
}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/WebApplicationFirewallPolicy1.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/WebApplicationFirewallPolicy1.cs
deleted file mode 100644
index 743a4c456c3a..000000000000
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/Models/WebApplicationFirewallPolicy1.cs
+++ /dev/null
@@ -1,114 +0,0 @@
-//
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for
-// license information.
-//
-// Code generated by Microsoft (R) AutoRest Code Generator.
-// Changes may cause incorrect behavior and will be lost if the code is
-// regenerated.
-//
-
-namespace Microsoft.Azure.Management.FrontDoor.Models
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Serialization;
- using Newtonsoft.Json;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
-
- ///
- /// Defines web application firewall policy.
- ///
- [Rest.Serialization.JsonTransformation]
- public partial class WebApplicationFirewallPolicy1 : Resource
- {
- ///
- /// Initializes a new instance of the WebApplicationFirewallPolicy1
- /// class.
- ///
- public WebApplicationFirewallPolicy1()
- {
- CustomInit();
- }
-
- ///
- /// Initializes a new instance of the WebApplicationFirewallPolicy1
- /// class.
- ///
- /// Resource ID.
- /// Resource name.
- /// Resource type.
- /// Resource location.
- /// Resource tags.
- /// Describes policySettings for
- /// policy
- /// Describes custom rules inside the
- /// policy
- /// Describes managed rules inside the
- /// policy
- /// Provisioning state of the
- /// WebApplicationFirewallPolicy.
- /// Resource status of the policy.
- /// Gets a unique read-only string that changes
- /// whenever the resource is updated.
- public WebApplicationFirewallPolicy1(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), PolicySettings policySettings = default(PolicySettings), CustomRules customRules = default(CustomRules), ManagedRuleSets managedRules = default(ManagedRuleSets), string provisioningState = default(string), string resourceState = default(string), string etag = default(string))
- : base(id, name, type, location, tags)
- {
- PolicySettings = policySettings;
- CustomRules = customRules;
- ManagedRules = managedRules;
- ProvisioningState = provisioningState;
- ResourceState = resourceState;
- Etag = etag;
- CustomInit();
- }
-
- ///
- /// An initialization method that performs custom operations like setting defaults
- ///
- partial void CustomInit();
-
- ///
- /// Gets or sets describes policySettings for policy
- ///
- [JsonProperty(PropertyName = "properties.policySettings")]
- public PolicySettings PolicySettings { get; set; }
-
- ///
- /// Gets or sets describes custom rules inside the policy
- ///
- [JsonProperty(PropertyName = "properties.customRules")]
- public CustomRules CustomRules { get; set; }
-
- ///
- /// Gets or sets describes managed rules inside the policy
- ///
- [JsonProperty(PropertyName = "properties.managedRules")]
- public ManagedRuleSets ManagedRules { get; set; }
-
- ///
- /// Gets provisioning state of the WebApplicationFirewallPolicy.
- ///
- [JsonProperty(PropertyName = "properties.provisioningState")]
- public string ProvisioningState { get; private set; }
-
- ///
- /// Gets resource status of the policy.
- ///
- ///
- /// Possible values include: 'Creating', 'Enabling', 'Enabled',
- /// 'Disabling', 'Disabled', 'Deleting'
- ///
- [JsonProperty(PropertyName = "properties.resourceState")]
- public string ResourceState { get; private set; }
-
- ///
- /// Gets a unique read-only string that changes whenever the resource
- /// is updated.
- ///
- [JsonProperty(PropertyName = "etag")]
- public string Etag { get; set; }
-
- }
-}
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperations.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperations.cs
index 66fe53465e22..05a18a0ea55d 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperations.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperations.cs
@@ -54,7 +54,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
/// Lists all of the protection policies within a resource group.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
/// Headers that will be added to request.
@@ -77,17 +77,32 @@ internal PoliciesOperations(FrontDoorManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 80)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$");
+ }
+ }
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2018-08-01";
+ string apiVersion = "2019-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -198,7 +213,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -211,7 +226,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -234,10 +249,10 @@ internal PoliciesOperations(FrontDoorManagementClient client)
/// Retrieve protection policy with specified name within a resource group.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// Headers that will be added to request.
@@ -260,12 +275,27 @@ internal PoliciesOperations(FrontDoorManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 80)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$");
+ }
+ }
if (policyName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "policyName");
@@ -281,7 +311,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2018-08-01";
+ string apiVersion = "2019-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -394,7 +424,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -407,7 +437,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -427,14 +457,62 @@ internal PoliciesOperations(FrontDoorManagementClient client)
}
///
- /// Creates or update policy with specified rule set name within a resource
+ /// Create or update policy with specified ruleset name within a resource
+ /// group.
+ ///
+ ///
+ /// Name of the Resource group within the Azure subscription.
+ ///
+ ///
+ /// The name of the Web Application Firewall Policy.
+ ///
+ ///
+ /// Policy to be created.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, policyName, parameters, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Deletes Policy
+ ///
+ ///
+ /// Name of the Resource group within the Azure subscription.
+ ///
+ ///
+ /// The name of the Web Application Firewall Policy.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, policyName, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Create or update policy with specified ruleset name within a resource
/// group.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// Policy to be created.
@@ -460,12 +538,27 @@ internal PoliciesOperations(FrontDoorManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy1 parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 80)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$");
+ }
+ }
if (policyName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "policyName");
@@ -485,7 +578,11 @@ internal PoliciesOperations(FrontDoorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "parameters");
}
- string apiVersion = "2018-08-01";
+ if (parameters != null)
+ {
+ parameters.Validate();
+ }
+ string apiVersion = "2019-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -495,10 +592,10 @@ internal PoliciesOperations(FrontDoorManagementClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("policyName", policyName);
- tracingParameters.Add("parameters", parameters);
tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("parameters", parameters);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -575,7 +672,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -605,7 +702,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -618,7 +715,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -636,7 +733,25 @@ internal PoliciesOperations(FrontDoorManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 202)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -659,32 +774,10 @@ internal PoliciesOperations(FrontDoorManagementClient client)
/// Deletes Policy
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string policyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- // Send request
- AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, policyName, customHeaders, cancellationToken).ConfigureAwait(false);
- return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Deletes Policy
- ///
- ///
- /// The name of the resource group.
- ///
- ///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// Headers that will be added to request.
@@ -710,6 +803,21 @@ internal PoliciesOperations(FrontDoorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 80)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 80);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[a-zA-Z0-9_\\-\\(\\)\\.]*[^\\.]$");
+ }
+ }
if (policyName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "policyName");
@@ -725,7 +833,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
- string apiVersion = "2018-08-01";
+ string apiVersion = "2019-03-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -884,7 +992,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -993,7 +1101,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1006,7 +1114,7 @@ internal PoliciesOperations(FrontDoorManagementClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperationsExtensions.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperationsExtensions.cs
index 7e985a8a25f4..c924fcfd301d 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperationsExtensions.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/PoliciesOperationsExtensions.cs
@@ -28,9 +28,9 @@ public static partial class PoliciesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
- public static IPage List(this IPoliciesOperations operations, string resourceGroupName)
+ public static IPage List(this IPoliciesOperations operations, string resourceGroupName)
{
return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult();
}
@@ -42,12 +42,12 @@ public static IPage List(this IPoliciesOperations
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
/// The cancellation token.
///
- public static async Task> ListAsync(this IPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListAsync(this IPoliciesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
@@ -62,12 +62,12 @@ public static IPage List(this IPoliciesOperations
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
- public static WebApplicationFirewallPolicy1 Get(this IPoliciesOperations operations, string resourceGroupName, string policyName)
+ public static WebApplicationFirewallPolicy Get(this IPoliciesOperations operations, string resourceGroupName, string policyName)
{
return operations.GetAsync(resourceGroupName, policyName).GetAwaiter().GetResult();
}
@@ -79,15 +79,15 @@ public static WebApplicationFirewallPolicy1 Get(this IPoliciesOperations operati
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false))
{
@@ -96,38 +96,38 @@ public static WebApplicationFirewallPolicy1 Get(this IPoliciesOperations operati
}
///
- /// Creates or update policy with specified rule set name within a resource
+ /// Create or update policy with specified ruleset name within a resource
/// group.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// Policy to be created.
///
- public static WebApplicationFirewallPolicy1 CreateOrUpdate(this IPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy1 parameters)
+ public static WebApplicationFirewallPolicy CreateOrUpdate(this IPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters)
{
return operations.CreateOrUpdateAsync(resourceGroupName, policyName, parameters).GetAwaiter().GetResult();
}
///
- /// Creates or update policy with specified rule set name within a resource
+ /// Create or update policy with specified ruleset name within a resource
/// group.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// Policy to be created.
@@ -135,7 +135,7 @@ public static WebApplicationFirewallPolicy1 CreateOrUpdate(this IPoliciesOperati
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy1 parameters, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, policyName, parameters, null, cancellationToken).ConfigureAwait(false))
{
@@ -150,10 +150,10 @@ public static WebApplicationFirewallPolicy1 CreateOrUpdate(this IPoliciesOperati
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
public static void Delete(this IPoliciesOperations operations, string resourceGroupName, string policyName)
{
@@ -167,10 +167,10 @@ public static void Delete(this IPoliciesOperations operations, string resourceGr
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// The cancellation token.
@@ -180,6 +180,54 @@ public static void Delete(this IPoliciesOperations operations, string resourceGr
(await operations.DeleteWithHttpMessagesAsync(resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
+ ///
+ /// Create or update policy with specified ruleset name within a resource
+ /// group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of the Resource group within the Azure subscription.
+ ///
+ ///
+ /// The name of the Web Application Firewall Policy.
+ ///
+ ///
+ /// Policy to be created.
+ ///
+ public static WebApplicationFirewallPolicy BeginCreateOrUpdate(this IPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters)
+ {
+ return operations.BeginCreateOrUpdateAsync(resourceGroupName, policyName, parameters).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or update policy with specified ruleset name within a resource
+ /// group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of the Resource group within the Azure subscription.
+ ///
+ ///
+ /// The name of the Web Application Firewall Policy.
+ ///
+ ///
+ /// Policy to be created.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginCreateOrUpdateAsync(this IPoliciesOperations operations, string resourceGroupName, string policyName, WebApplicationFirewallPolicy parameters, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, policyName, parameters, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Deletes Policy
///
@@ -187,10 +235,10 @@ public static void Delete(this IPoliciesOperations operations, string resourceGr
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
public static void BeginDelete(this IPoliciesOperations operations, string resourceGroupName, string policyName)
{
@@ -204,10 +252,10 @@ public static void BeginDelete(this IPoliciesOperations operations, string resou
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// Name of the Resource group within the Azure subscription.
///
///
- /// The name of the resource group.
+ /// The name of the Web Application Firewall Policy.
///
///
/// The cancellation token.
@@ -226,7 +274,7 @@ public static void BeginDelete(this IPoliciesOperations operations, string resou
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListNext(this IPoliciesOperations operations, string nextPageLink)
+ public static IPage ListNext(this IPoliciesOperations operations, string nextPageLink)
{
return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
}
@@ -243,7 +291,7 @@ public static IPage ListNext(this IPoliciesOperat
///
/// The cancellation token.
///
- public static async Task> ListNextAsync(this IPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListNextAsync(this IPoliciesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/SdkInfo_FrontDoorManagementClient.cs b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/SdkInfo_FrontDoorManagementClient.cs
index c045cc5e4f97..8801a23fdb58 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Generated/SdkInfo_FrontDoorManagementClient.cs
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Generated/SdkInfo_FrontDoorManagementClient.cs
@@ -27,7 +27,8 @@ public static IEnumerable> ApiInfo_FrontDoorManage
new Tuple("Network", "FrontendEndpoints", "2018-08-01"),
new Tuple("Network", "HealthProbeSettings", "2018-08-01"),
new Tuple("Network", "LoadBalancingSettings", "2018-08-01"),
- new Tuple("Network", "Policies", "2018-08-01"),
+ new Tuple("Network", "ManagedRuleSets", "2019-03-01"),
+ new Tuple("Network", "Policies", "2019-03-01"),
new Tuple("Network", "RoutingRules", "2018-08-01"),
}.AsEnumerable();
}
@@ -35,10 +36,10 @@ public static IEnumerable> ApiInfo_FrontDoorManage
// BEGIN: Code Generation Metadata Section
public static readonly String AutoRestVersion = "latest";
public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283";
- public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/frontdoor/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\azure-sdk-for-net\\src\\SDKs";
+ public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/frontdoor/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\Sources\\OSS\\azure-sdk-for-net\\src\\SDKs";
public static readonly String GithubForkName = "Azure";
public static readonly String GithubBranchName = "master";
- public static readonly String GithubCommidId = "b1de6f7bf1e46357686aabc7ab1ae3c274790148";
+ public static readonly String GithubCommidId = "aa2e344a3516adf454e8865ea7327c47a864581d";
public static readonly String CodeGenerationErrors = "";
public static readonly String GithubRepoName = "azure-rest-api-specs";
// END: Code Generation Metadata Section
diff --git a/src/SDKs/FrontDoor/Management.FrontDoor/Microsoft.Azure.Management.FrontDoor.csproj b/src/SDKs/FrontDoor/Management.FrontDoor/Microsoft.Azure.Management.FrontDoor.csproj
index 1bd15e43805c..6bbe075413ea 100644
--- a/src/SDKs/FrontDoor/Management.FrontDoor/Microsoft.Azure.Management.FrontDoor.csproj
+++ b/src/SDKs/FrontDoor/Management.FrontDoor/Microsoft.Azure.Management.FrontDoor.csproj
@@ -7,10 +7,20 @@
Microsoft.Azure.Management.FrontDoor
Provides management capabilities for Front Door services.
Microsoft.Azure.Management.FrontDoor
- 0.11.0-preview
- Microsoft Azure Front Door management;FrontDoor;Front Door management;
+ 0.12.0-preview
+ Microsoft Azure Front Door management;FrontDoor;Front Door management;
- Fixed a regression in enable/disable https for custom domain.
+
diff --git a/src/SDKs/_metadata/frontDoor_resource-manager.txt b/src/SDKs/_metadata/frontDoor_resource-manager.txt
index 9df16213ac21..c9ec7f01c827 100644
--- a/src/SDKs/_metadata/frontDoor_resource-manager.txt
+++ b/src/SDKs/_metadata/frontDoor_resource-manager.txt
@@ -3,12 +3,12 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
-cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/frontdoor/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\azure-sdk-for-net\src\SDKs
-2019-02-26 23:19:32 UTC
+cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/frontdoor/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\Sources\OSS\azure-sdk-for-net\src\SDKs
+2019-03-22 22:18:24 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
-Commit: b1de6f7bf1e46357686aabc7ab1ae3c274790148
+Commit: aa2e344a3516adf454e8865ea7327c47a864581d
AutoRest information
Requested version: latest
Bootstrapper version: autorest@2.0.4283